diff --git a/src/Mod/Assembly/App/opendcm/modulePart/module.hpp b/src/Mod/Assembly/App/opendcm/modulePart/module.hpp index 3e13ec294c..38457fec11 100644 --- a/src/Mod/Assembly/App/opendcm/modulePart/module.hpp +++ b/src/Mod/Assembly/App/opendcm/modulePart/module.hpp @@ -98,9 +98,9 @@ struct ModulePart { } Transform& m_transform; }; - - //collect all clustergraph upstream cluster transforms - void transform_traverse(Transform& t, boost::shared_ptr c); + + //collect all clustergraph upstream cluster transforms + void transform_traverse(Transform& t, boost::shared_ptr c); public: using Object::m_system; @@ -116,14 +116,14 @@ struct ModulePart { template void set(const T& geometry); - - //access the parts transformation - template + + //access the parts transformation + template T& get(); - - //get the transformation from part local to overall global. In multi layer systems - //this means the successive transformation from this part to the toplevel cluster - template + + //get the transformation from part local to overall global. In multi layer systems + //this means the successive transformation from this part to the toplevel cluster + template T getGlobal(); virtual boost::shared_ptr clone(Sys& newSys); @@ -136,9 +136,9 @@ struct ModulePart { void finishCalculation(); void fix(bool fix_value); - public: - //we hold a transform and need therefore a aligned new operator - EIGEN_MAKE_ALIGNED_OPERATOR_NEW + public: + //we hold a transform and need therefore a aligned new operator + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; struct Part_id : public Part_base { @@ -169,9 +169,9 @@ struct ModulePart { friend struct PrepareCluster; friend struct EvaljuateCluster; - public: - //we hold a transform and need therefore a aligned new operator - EIGEN_MAKE_ALIGNED_OPERATOR_NEW + public: + //we hold a transform and need therefore a aligned new operator + EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; @@ -281,16 +281,16 @@ ModulePart::type::Part_base::Part_base(const T& geometry, Sys #ifdef USE_LOGGING log.add_attribute("Tag", attrs::constant< std::string >("Part3D")); -#endif - +#endif + (typename geometry_traits::modell()).template extract::accessor >(geometry, m_transform); cluster->template setClusterProperty(false); - + //the the clustermath transform m_cluster->template getClusterProperty().getTransform() = m_transform; - + #ifdef USE_LOGGING BOOST_LOG(log) << "Init: "< typename ModulePart::template type::Part_base::Geom ModulePart::type::Part_base::addGeometry3D(const T& geom, CoordinateFrame frame) { Geom g(new Geometry3D(geom, *m_system)); - + if(frame == Local) { - //we need to collect all transforms up to this part! - Transform t; - transform_traverse(t, m_cluster); - - g->transform(t); + //we need to collect all transforms up to this part! + Transform t; + transform_traverse(t, m_cluster); + + g->transform(t); } fusion::vector res = m_cluster->addVertex(); @@ -328,15 +328,15 @@ ModulePart::type::Part_base::addGeometry3D(const T& geom, Coo template template -void ModulePart::type::Part_base::transform_traverse(ModulePart::type::Part_base::Transform& t, - boost::shared_ptr::type::Part_base::Cluster> c) { - +void ModulePart::type::Part_base::transform_traverse(typename ModulePart::template type::Part_base::Transform& t, + boost::shared_ptr::template type::Part_base::Cluster> c) { + t *= c->template getClusterProperty().m_transform; - + if(c->isRoot()) - return; - - transform_traverse(t, c->parent()); + return; + + transform_traverse(t, c->parent()); } template @@ -346,7 +346,7 @@ void ModulePart::type::Part_base::set(const T& geometry) { Part_base::m_geometry = geometry; (typename geometry_traits::modell()).template extract::accessor >(geometry, Part_base::m_transform); - + //set the clustermath transform m_cluster->template getClusterProperty().getTransform() = m_transform; }; @@ -367,12 +367,12 @@ T ModulePart::type::Part_base::getGlobal() { //get the successive transform Transform t; transform_traverse(t, m_cluster); - + //put it into the user type T ut; (typename geometry_traits::modell()).template inject::accessor >(ut, t); - + typename geometry_traits::accessor >(ut, t); + return ut; }; @@ -403,7 +403,7 @@ ModulePart::type::Part_base::clone(Sys& newSys) { template template void ModulePart::type::Part_base::finishCalculation() { - + m_transform.normalize(); apply_visitor vis(m_transform); apply(vis); @@ -411,7 +411,7 @@ void ModulePart::type::Part_base::finishCalculation() { #ifdef USE_LOGGING BOOST_LOG(log) << "New Value: "<(((Part*)this)->shared_from_this()); }; @@ -453,7 +453,8 @@ template template bool ModulePart::type::Part_id::hasGeometry3D(Identifier id) { typename Part_base::Geom g = Part_base::m_system->getGeometry3D(id); - if(!g) return false; + if(!g) + return false; //get the global vertex and check if it is a child of the part cluster GlobalVertex v = g->template getProperty(); @@ -505,7 +506,7 @@ ModulePart::type::inheriter_base::createPart(const T& geometr std::pair, LocalVertex> res = m_this->m_cluster->createCluster(); Partptr p(new Part(geometry, * ((Sys*) this), res.first)); - m_this->m_cluster->template setObject (res.second, p); + m_this->m_cluster->template setObject (res.second, p); m_this->push_back(p); res.first->template setClusterProperty(clusterPart); @@ -566,7 +567,8 @@ ModulePart::type::inheriter_id::createPart(const T& geometry, template template bool ModulePart::type::inheriter_id::hasPart(Identifier id) { - if(getPart(id)) return true; + if(getPart(id)) + return true; return false; }; @@ -577,7 +579,8 @@ ModulePart::type::inheriter_id::getPart(Identifier id) { std::vector< Partptr >& vec = inheriter_base::m_this->template objectVector(); typedef typename std::vector::iterator iter; for(iter it=vec.begin(); it!=vec.end(); it++) { - if(compare_traits::compare((*it)->getIdentifier(), id)) return *it; + if(compare_traits::compare((*it)->getIdentifier(), id)) + return *it; }; return Partptr(); };