Commit f2e1a640 authored by Bob Obara's avatar Bob Obara Committed by Kitware Robot

Merge topic 'replacingAttributeSet'

4de48d78 STYLE: Replaced model::AttributeSet with common::UUIDs
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: David Thompson's avatarDavid Thompson <david.thompson@kitware.com>
Merge-request: !714
parents 2625cee4 4de48d78
......@@ -136,7 +136,7 @@ void RewriteLabels(vtkImageData* img, T* lblp, double thresh,
if ((dist = (x - basept).Dot(normal)) < -delta) // Below the lower cutoff plane?
lblp[p] = VOXEL_VOID;
else if ((dist < delta) && (lblp[p] == 1)) // "On" the lower cutoff plane?
lblp[p] = OUTLET;
lblp[p] = static_cast<char>(OUTLET);
else if ((dist = sqrt((ray = (x - scenter)).Dot(ray)) - sradius) <
delta) // In or on the nose sphere?
{
......
......@@ -437,13 +437,13 @@ QList<smtk::attribute::DefinitionPtr> qtAssociationWidget::processDefUniqueness(
{
QList<smtk::attribute::DefinitionPtr> uniqueDefs;
smtk::model::AttributeSet associatedAtts = theEntity.attributes();
smtk::common::UUIDs associatedAtts = theEntity.attributes();
if (associatedAtts.size() == 0)
{
return uniqueDefs;
}
typedef smtk::model::AttributeSet::const_iterator cit;
typedef smtk::common::UUIDs::const_iterator cit;
for (cit i = associatedAtts.begin(); i != associatedAtts.end(); ++i)
{
smtk::attribute::AttributePtr attPtr = attSystem->findAttribute((*i));
......@@ -609,7 +609,7 @@ void qtAssociationWidget::addDomainListItem(
QComboBox* combo = new QComboBox(this);
combo->addItems(attNames);
int idx = -1;
smtk::model::AttributeSet associatedAtts = domainEnt.attributes();
smtk::common::UUIDs associatedAtts = domainEnt.attributes();
if (associatedAtts.size() > 0)
{
smtk::attribute::AttributePtr first_att = attSystem->findAttribute((*associatedAtts.begin()));
......
......@@ -34,9 +34,6 @@ namespace smtk
namespace model
{
/// A set of attribute identifiers.
typedef std::set<smtk::common::UUID> AttributeSet;
/**\brief Store a list of attributes assigned to solid model entities.
*
*/
......@@ -47,11 +44,11 @@ public:
bool disassociateAttribute(const smtk::common::UUID& attribId);
bool isAssociated(const smtk::common::UUID& attribId) const;
AttributeSet& attributes() { return this->m_attributes; }
const AttributeSet& attributes() const { return this->m_attributes; }
smtk::common::UUIDs& attributes() { return this->m_attributes; }
const smtk::common::UUIDs& attributes() const { return this->m_attributes; }
protected:
AttributeSet m_attributes; // IDs of attributes assigned to an entity.
smtk::common::UUIDs m_attributes; // IDs of attributes assigned to an entity.
};
#ifdef SMTK_HASH_STORAGE
......
......@@ -32,7 +32,7 @@ AttributeListPhrase::AttributeListPhrase()
* Note that \a subset must not contain any attribute IDs not present in entity.attributes().
*/
AttributeListPhrase::Ptr AttributeListPhrase::setup(
const EntityRef& entity, const AttributeSet& subset, DescriptivePhrasePtr parnt)
const EntityRef& entity, const smtk::common::UUIDs& subset, DescriptivePhrasePtr parnt)
{
this->m_entity = entity;
this->m_attributes = subset;
......
......@@ -35,7 +35,7 @@ public:
smtkSharedPtrCreateMacro(DescriptivePhrase);
// This method has no implementation!
Ptr setup(const EntityRef& ent, DescriptivePhrasePtr parent);
Ptr setup(const EntityRef& ent, const AttributeSet& subset, DescriptivePhrasePtr parent);
Ptr setup(const EntityRef& ent, const smtk::common::UUIDs& subset, DescriptivePhrasePtr parent);
virtual std::string title();
virtual std::string subtitle();
......@@ -49,7 +49,7 @@ protected:
virtual bool buildSubphrasesInternal();
EntityRef m_entity;
AttributeSet m_attributes; // Subset to be presented, modifications do not affect storage!
smtk::common::UUIDs m_attributes; // Subset to be presented, modifications do not affect storage!
};
} // model namespace
......
......@@ -868,8 +868,8 @@ bool EntityRef::disassociateAttribute(
*/
bool EntityRef::disassociateAllAttributes(smtk::attribute::SystemPtr sys, bool reverse)
{
AttributeSet atts = this->attributes();
AttributeSet::const_iterator it;
smtk::common::UUIDs atts = this->attributes();
smtk::common::UUIDs::const_iterator it;
bool res = true;
for (it = atts.begin(); it != atts.end(); ++it)
{
......@@ -881,14 +881,14 @@ bool EntityRef::disassociateAllAttributes(smtk::attribute::SystemPtr sys, bool r
/**\brief Does the entityref have any attributes associated with it?
*/
AttributeSet EntityRef::attributes() const
smtk::common::UUIDs EntityRef::attributes() const
{
ManagerPtr mgr = this->m_manager.lock();
UUIDsToAttributeAssignments::const_iterator entry =
mgr->attributeAssignments().find(this->m_entity);
if (entry == mgr->attributeAssignments().end())
{
return AttributeSet();
return smtk::common::UUIDs();
}
return entry->second.attributes();
}
......
......@@ -218,7 +218,7 @@ public:
return removedAny;
}
AttributeSet attributes() const;
smtk::common::UUIDs attributes() const;
#ifndef SHIBOKEN_SKIP
// For T = {IntegerData, FloatData, StringData}:
......
......@@ -30,8 +30,8 @@ py::class_< smtk::model::AttributeAssignments > pybind11_init_smtk_model_Attribu
.def("associateAttribute", &smtk::model::AttributeAssignments::associateAttribute, py::arg("attribId"))
.def("disassociateAttribute", &smtk::model::AttributeAssignments::disassociateAttribute, py::arg("attribId"))
.def("isAssociated", &smtk::model::AttributeAssignments::isAssociated, py::arg("attribId"))
.def("attributes", (smtk::model::AttributeSet & (smtk::model::AttributeAssignments::*)()) &smtk::model::AttributeAssignments::attributes)
.def("attributes", (smtk::model::AttributeSet const & (smtk::model::AttributeAssignments::*)() const) &smtk::model::AttributeAssignments::attributes)
.def("attributes", (smtk::common::UUIDs & (smtk::model::AttributeAssignments::*)()) &smtk::model::AttributeAssignments::attributes)
.def("attributes", (smtk::common::UUIDs const & (smtk::model::AttributeAssignments::*)() const) &smtk::model::AttributeAssignments::attributes)
;
return instance;
}
......
......@@ -34,7 +34,7 @@ PySharedPtrClass< smtk::model::AttributeListPhrase, smtk::model::DescriptivePhra
.def("relatedEntity", &smtk::model::AttributeListPhrase::relatedEntity)
.def("relatedEntityId", &smtk::model::AttributeListPhrase::relatedEntityId)
// .def("setup", (smtk::model::AttributeListPhrase::Ptr (smtk::model::AttributeListPhrase::*)(::smtk::model::EntityRef const &, ::smtk::model::DescriptivePhrasePtr)) &smtk::model::AttributeListPhrase::setup, py::arg("ent"), py::arg("parent"))
.def("setup", (smtk::model::AttributeListPhrase::Ptr (smtk::model::AttributeListPhrase::*)(::smtk::model::EntityRef const &, ::smtk::model::AttributeSet const &, ::smtk::model::DescriptivePhrasePtr)) &smtk::model::AttributeListPhrase::setup, py::arg("ent"), py::arg("subset"), py::arg("parent"))
.def("setup", (smtk::model::AttributeListPhrase::Ptr (smtk::model::AttributeListPhrase::*)(::smtk::model::EntityRef const &, ::smtk::common::UUIDs const &, ::smtk::model::DescriptivePhrasePtr)) &smtk::model::AttributeListPhrase::setup, py::arg("ent"), py::arg("subset"), py::arg("parent"))
.def("shared_from_this", (std::shared_ptr<const smtk::model::AttributeListPhrase> (smtk::model::AttributeListPhrase::*)() const) &smtk::model::AttributeListPhrase::shared_from_this)
.def("shared_from_this", (std::shared_ptr<smtk::model::AttributeListPhrase> (smtk::model::AttributeListPhrase::*)()) &smtk::model::AttributeListPhrase::shared_from_this)
.def("subtitle", &smtk::model::AttributeListPhrase::subtitle)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment