[Assembly] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
This commit is contained in:
@@ -100,7 +100,7 @@ bool PartRef::holdsObject(App::DocumentObject* obj) const {
|
||||
return std::find(vector.begin(), vector.end(), obj)!=vector.end();
|
||||
}
|
||||
|
||||
void PartRef::setCalculatedPlacement(boost::shared_ptr< Part3D > part) {
|
||||
void PartRef::setCalculatedPlacement(std::shared_ptr< Part3D > part) {
|
||||
|
||||
//part is the same as m_part, so it doasn't matter which one we use
|
||||
Base::Placement p = dcm::get<Base::Placement>(part);
|
||||
@@ -135,7 +135,7 @@ void PartRef::ensureInitialisation() {
|
||||
if(!ass)
|
||||
throw AssemblyItemException();
|
||||
|
||||
boost::shared_ptr<Solver> solver = ass->m_solver;
|
||||
std::shared_ptr<Solver> solver = ass->m_solver;
|
||||
if(!solver)
|
||||
throw AssemblyItemException();
|
||||
|
||||
@@ -153,13 +153,13 @@ void PartRef::ensureInitialisation() {
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr< Geometry3D > PartRef::getGeometry3D(const char* Type) {
|
||||
std::shared_ptr< Geometry3D > PartRef::getGeometry3D(const char* Type) {
|
||||
|
||||
//check if the item is initialized
|
||||
if(!m_part)
|
||||
return boost::shared_ptr< Geometry3D >();
|
||||
return std::shared_ptr< Geometry3D >();
|
||||
|
||||
boost::shared_ptr<Geometry3D> geometry;
|
||||
std::shared_ptr<Geometry3D> geometry;
|
||||
if(m_part->hasGeometry3D(Type)) {
|
||||
return m_part->getGeometry3D(Type);
|
||||
}
|
||||
@@ -171,7 +171,7 @@ boost::shared_ptr< Geometry3D > PartRef::getGeometry3D(const char* Type) {
|
||||
ts = static_cast<Part::Feature*>(obj)->Shape.getShape();
|
||||
}
|
||||
else
|
||||
return boost::shared_ptr< Geometry3D >();
|
||||
return std::shared_ptr< Geometry3D >();
|
||||
|
||||
TopoDS_Shape s = ts.getSubShape(Type);
|
||||
if(s.ShapeType() == TopAbs_FACE) {
|
||||
@@ -194,7 +194,7 @@ boost::shared_ptr< Geometry3D > PartRef::getGeometry3D(const char* Type) {
|
||||
}
|
||||
default:
|
||||
Base::Console().Message("Unsupported Surface Geometry Type at selection\n");
|
||||
return boost::shared_ptr< Geometry3D >();
|
||||
return std::shared_ptr< Geometry3D >();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -210,7 +210,7 @@ boost::shared_ptr< Geometry3D > PartRef::getGeometry3D(const char* Type) {
|
||||
}
|
||||
default:
|
||||
Base::Console().Message("Unsupported Curve Geometry Type at selection \n");
|
||||
return boost::shared_ptr< Geometry3D >();
|
||||
return std::shared_ptr< Geometry3D >();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -223,7 +223,7 @@ boost::shared_ptr< Geometry3D > PartRef::getGeometry3D(const char* Type) {
|
||||
}
|
||||
else {
|
||||
Base::Console().Message("Unsupported Topology Type at selection\n");
|
||||
return boost::shared_ptr< Geometry3D >();
|
||||
return std::shared_ptr< Geometry3D >();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ public:
|
||||
Product* getParentAssembly();
|
||||
void ensureInitialisation();
|
||||
|
||||
boost::shared_ptr<Part3D> m_part;
|
||||
virtual boost::shared_ptr<Geometry3D> getGeometry3D(const char* Type );
|
||||
void setCalculatedPlacement( boost::shared_ptr<Part3D> part );
|
||||
std::shared_ptr<Part3D> m_part;
|
||||
virtual std::shared_ptr<Geometry3D> getGeometry3D(const char* Type );
|
||||
void setCalculatedPlacement( std::shared_ptr<Part3D> part );
|
||||
};
|
||||
|
||||
} //namespace Assembly
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <boost/mpl/find.hpp>
|
||||
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
||||
#include <boost/fusion/include/as_vector.hpp>
|
||||
@@ -63,14 +63,14 @@ namespace details {
|
||||
* @brief Creates a fusion::vector of boost shared_ptr's from the given types
|
||||
*
|
||||
* Creates a shared pointer sequence (sps) of the supplied types by converting them to
|
||||
* boost::shared_ptr's first and creating a fusion::vector of all pointers afterwards which can be
|
||||
* std::shared_ptr's first and creating a fusion::vector of all pointers afterwards which can be
|
||||
* accessed by the type typedef. Usage: @code sps<types>::type @endcode
|
||||
*
|
||||
* @tparam seq the mpl::sequence with the types to convert to shared_ptr's
|
||||
**/
|
||||
template<typename seq>
|
||||
struct sps { //shared_ptr sequence
|
||||
typedef typename mpl::transform<seq, boost::shared_ptr<mpl::_1> >::type spv;
|
||||
typedef typename mpl::transform<seq, std::shared_ptr<mpl::_1> >::type spv;
|
||||
typedef typename fusion::result_of::as_vector<spv>::type type;
|
||||
};
|
||||
/**@}*/
|
||||
@@ -153,7 +153,7 @@ struct cluster_error : virtual boost::exception {};
|
||||
/**
|
||||
* @brief Pointer type to share a common ID generator @ref IDgen
|
||||
**/
|
||||
typedef boost::shared_ptr<IDgen> IDpointer;
|
||||
typedef std::shared_ptr<IDgen> IDpointer;
|
||||
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ public:
|
||||
typedef typename boost::graph_traits<Graph>::edge_iterator local_edge_iterator;
|
||||
typedef typename boost::graph_traits<Graph>::out_edge_iterator local_out_edge_iterator;
|
||||
|
||||
typedef std::map<LocalVertex, boost::shared_ptr<ClusterGraph> > ClusterMap;
|
||||
typedef std::map<LocalVertex, std::shared_ptr<ClusterGraph> > ClusterMap;
|
||||
|
||||
|
||||
struct global_extractor {
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
template<typename Obj>
|
||||
struct object_extractor {
|
||||
|
||||
typedef boost::shared_ptr<Obj> base_type;
|
||||
typedef std::shared_ptr<Obj> base_type;
|
||||
typedef base_type& result_type;
|
||||
typedef typename mpl::find<objects, Obj>::type iterator;
|
||||
typedef typename mpl::distance<typename mpl::begin<objects>::type, iterator>::type distance;
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
/**
|
||||
* @brief Iterator for objects of given type
|
||||
*
|
||||
* Allows to iterate over all objects of given type, dereferencing gives the boost::shared_ptr<Obj>
|
||||
* Allows to iterate over all objects of given type, dereferencing gives the std::shared_ptr<Obj>
|
||||
*
|
||||
* @tparam Obj the object type to iterate over
|
||||
**/
|
||||
@@ -383,7 +383,7 @@ public:
|
||||
*
|
||||
* @param g the parent cluster graph
|
||||
**/
|
||||
ClusterGraph(boost::shared_ptr<ClusterGraph> g) : m_parent(g), m_id(new details::IDgen) {
|
||||
ClusterGraph(std::shared_ptr<ClusterGraph> g) : m_parent(g), m_id(new details::IDgen) {
|
||||
if(g)
|
||||
m_id = g->m_id;
|
||||
};
|
||||
@@ -402,7 +402,7 @@ public:
|
||||
* copied graph
|
||||
*/
|
||||
template<typename Functor>
|
||||
void copyInto(boost::shared_ptr<ClusterGraph> into, Functor& functor) const;
|
||||
void copyInto(std::shared_ptr<ClusterGraph> into, Functor& functor) const;
|
||||
|
||||
/**
|
||||
* @brief Compare by address, not by content
|
||||
@@ -466,9 +466,9 @@ public:
|
||||
* subcluster is fully defined by its object and the vertex descriptor which is it's position
|
||||
* in the current cluster.
|
||||
*
|
||||
* @return :pair< boost::shared_ptr< ClusterGraph >, LocalVertex > Subcluster and its descriptor
|
||||
* @return :pair< std::shared_ptr< ClusterGraph >, LocalVertex > Subcluster and its descriptor
|
||||
**/
|
||||
std::pair<boost::shared_ptr<ClusterGraph>, LocalVertex> createCluster();
|
||||
std::pair<std::shared_ptr<ClusterGraph>, LocalVertex> createCluster();
|
||||
|
||||
/**
|
||||
* @brief Returns the parent cluster
|
||||
@@ -478,14 +478,14 @@ public:
|
||||
*
|
||||
* @return :shared_ptr< ClusterGraph > the parent cluster or empty pointer
|
||||
**/
|
||||
boost::shared_ptr<ClusterGraph> parent();
|
||||
std::shared_ptr<ClusterGraph> parent();
|
||||
|
||||
/**
|
||||
* @brief const version of \ref parent()
|
||||
*
|
||||
* @return :shared_ptr< ClusterGraph >
|
||||
**/
|
||||
const boost::shared_ptr<ClusterGraph> parent() const;
|
||||
const std::shared_ptr<ClusterGraph> parent() const;
|
||||
|
||||
/**
|
||||
* @brief Is this the toplevel cluster?
|
||||
@@ -499,14 +499,14 @@ public:
|
||||
*
|
||||
* @return :shared_ptr< ClusterGraph >
|
||||
**/
|
||||
boost::shared_ptr<ClusterGraph> root();
|
||||
std::shared_ptr<ClusterGraph> root();
|
||||
|
||||
/**
|
||||
* @brief const equivalent of \ref root()
|
||||
*
|
||||
* @return :shared_ptr< ClusterGraph >
|
||||
**/
|
||||
const boost::shared_ptr<ClusterGraph> root() const;
|
||||
const std::shared_ptr<ClusterGraph> root() const;
|
||||
|
||||
/**
|
||||
* @brief Iterators for all subclusters
|
||||
@@ -554,9 +554,9 @@ public:
|
||||
* a cluster an empty pointer is returned.
|
||||
*
|
||||
* @param v The vertex for which the cluster is wanted
|
||||
* @return boost::shared_ptr<ClusterGraph> the coresponding cluster orempty pointer
|
||||
* @return std::shared_ptr<ClusterGraph> the coresponding cluster orempty pointer
|
||||
**/
|
||||
boost::shared_ptr<ClusterGraph> getVertexCluster(LocalVertex v);
|
||||
std::shared_ptr<ClusterGraph> getVertexCluster(LocalVertex v);
|
||||
|
||||
/**
|
||||
* @brief Get the vertex descrptor which descripes the clusters position in the graph
|
||||
@@ -566,17 +566,17 @@ public:
|
||||
* @param g the graph for which the vertex is searched
|
||||
* @return :LocalVertex
|
||||
**/
|
||||
LocalVertex getClusterVertex(boost::shared_ptr<ClusterGraph> g);
|
||||
LocalVertex getClusterVertex(std::shared_ptr<ClusterGraph> g);
|
||||
|
||||
/**
|
||||
* @brief Convenience function for \ref removeCluster
|
||||
**/
|
||||
template<typename Functor>
|
||||
void removeCluster(boost::shared_ptr<ClusterGraph> g, Functor& f);
|
||||
void removeCluster(std::shared_ptr<ClusterGraph> g, Functor& f);
|
||||
/**
|
||||
* @brief Convenience function for \ref removeCluster
|
||||
**/
|
||||
void removeCluster(boost::shared_ptr<ClusterGraph> g);
|
||||
void removeCluster(std::shared_ptr<ClusterGraph> g);
|
||||
/**
|
||||
* @brief Delete all subcluster
|
||||
*
|
||||
@@ -764,7 +764,7 @@ public:
|
||||
* @param v GlobalVertex for which the containing local one is wanted
|
||||
* @return fusion::vector<LocalVertex, ClusterGraph*, bool> with the containing LocalVertex, the cluster which holds it and a bool indicator if function was successful.
|
||||
**/
|
||||
fusion::vector<LocalVertex, boost::shared_ptr<ClusterGraph>, bool> getLocalVertexGraph(GlobalVertex v);
|
||||
fusion::vector<LocalVertex, std::shared_ptr<ClusterGraph>, bool> getLocalVertexGraph(GlobalVertex v);
|
||||
|
||||
|
||||
/* *******************************************************
|
||||
@@ -853,7 +853,7 @@ public:
|
||||
* @return shared_ptr< Obj > the pointer to the desired object
|
||||
**/
|
||||
template<typename Obj, typename key>
|
||||
boost::shared_ptr<Obj> getObject(key k);
|
||||
std::shared_ptr<Obj> getObject(key k);
|
||||
|
||||
/**
|
||||
* @brief Set a object at the specified vertex or edge
|
||||
@@ -869,7 +869,7 @@ public:
|
||||
* @return void
|
||||
**/
|
||||
template<typename Obj, typename key>
|
||||
void setObject(key k, boost::shared_ptr<Obj> val);
|
||||
void setObject(key k, std::shared_ptr<Obj> val);
|
||||
|
||||
/**
|
||||
* @brief Get iterator range for all GlobalEdge objects hold by this local edge
|
||||
@@ -974,7 +974,7 @@ public:
|
||||
* @param cg reference to the subcluster to which v should be moved
|
||||
* @return LocalVertex the local descriptor of the moved vertex in the subcluster
|
||||
**/
|
||||
LocalVertex moveToSubcluster(LocalVertex v, boost::shared_ptr<ClusterGraph> cg);
|
||||
LocalVertex moveToSubcluster(LocalVertex v, std::shared_ptr<ClusterGraph> cg);
|
||||
|
||||
/**
|
||||
* @brief Move a vertex to a subcluster
|
||||
@@ -1003,7 +1003,7 @@ public:
|
||||
* @param cg reference to the subcluster to which v should be moved
|
||||
* @return LocalVertex the local descriptor of the moved vertex in the subcluster
|
||||
**/
|
||||
LocalVertex moveToSubcluster(LocalVertex v, LocalVertex Cluster, boost::shared_ptr<ClusterGraph> cg);
|
||||
LocalVertex moveToSubcluster(LocalVertex v, LocalVertex Cluster, std::shared_ptr<ClusterGraph> cg);
|
||||
|
||||
|
||||
/**
|
||||
@@ -1046,7 +1046,7 @@ protected:
|
||||
/* Searches the local vertex holding the specified global one in this and all it's subclusters.
|
||||
* If found, the holding local vertex and the graph in which it is valid will be returned.
|
||||
* */
|
||||
fusion::vector<LocalVertex, boost::shared_ptr<ClusterGraph>, bool> getContainingVertexGraph(GlobalVertex id);
|
||||
fusion::vector<LocalVertex, std::shared_ptr<ClusterGraph>, bool> getContainingVertexGraph(GlobalVertex id);
|
||||
|
||||
/* Searches the global edge in all local edges of this graph, and returns the local
|
||||
* one which holds the global edge. If not successful the local edge returned will be
|
||||
|
||||
@@ -65,7 +65,7 @@ class Constraint {
|
||||
typedef typename Kernel::DynStride DS;
|
||||
typedef typename Kernel::MappedEquationSystem MES;
|
||||
|
||||
typedef boost::shared_ptr<details::Geometry<Kernel, Dim, typename Sys::geometries> > geom_ptr;
|
||||
typedef std::shared_ptr<details::Geometry<Kernel, Dim, typename Sys::geometries> > geom_ptr;
|
||||
typedef std::vector<typename Kernel::Vector3, Eigen::aligned_allocator<typename Kernel::Vector3> > Vec;
|
||||
|
||||
//metafunction to create equation from consraint and tags
|
||||
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
return m_parameterCount;
|
||||
};
|
||||
template<typename T>
|
||||
void test_linkTo(boost::shared_ptr< Geometry< Kernel, Dim > > geom, int offset) {
|
||||
void test_linkTo(std::shared_ptr< Geometry< Kernel, Dim > > geom, int offset) {
|
||||
linkTo<T>(geom, offset);
|
||||
};
|
||||
bool test_isLinked() {
|
||||
@@ -316,10 +316,10 @@ public:
|
||||
};
|
||||
|
||||
int m_link_offset;
|
||||
boost::shared_ptr<Geometry<Kernel, Dim, TagList> > m_link;
|
||||
std::shared_ptr<Geometry<Kernel, Dim, TagList> > m_link;
|
||||
|
||||
template<typename T>
|
||||
void linkTo(boost::shared_ptr< Geometry< Kernel, Dim, TagList > > geom, int offset);
|
||||
void linkTo(std::shared_ptr< Geometry< Kernel, Dim, TagList > > geom, int offset);
|
||||
bool isLinked() {
|
||||
return m_link!=0;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace dcm {
|
||||
//functors needed for implementation only
|
||||
//***************************************
|
||||
|
||||
/* All objects are boost::shared_ptr, therefore they can be cleared by calling the reset() method. As
|
||||
/* All objects are std::shared_ptr, therefore they can be cleared by calling the reset() method. As
|
||||
* objects are stored within fusion::sequences a functor is needed to clear all of them.
|
||||
**/
|
||||
struct clear_ptr {
|
||||
@@ -259,7 +259,7 @@ ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::object_extractor<Ob
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
template<typename Functor>
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::copyInto(boost::shared_ptr<ClusterGraph> into, Functor& functor) const {
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::copyInto(std::shared_ptr<ClusterGraph> into, Functor& functor) const {
|
||||
|
||||
//lists does not provide vertex index, so we have to build our own (can't use the internal
|
||||
//vertex_index_property as we would need to reset the indices and that's not possible in const graph)
|
||||
@@ -289,7 +289,7 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::copyInto(boost
|
||||
|
||||
for(; it.first != it.second; it.first++) {
|
||||
//create the new Graph
|
||||
boost::shared_ptr<ClusterGraph> ng = boost::shared_ptr<ClusterGraph> (new ClusterGraph(into));
|
||||
std::shared_ptr<ClusterGraph> ng = std::shared_ptr<ClusterGraph> (new ClusterGraph(into));
|
||||
|
||||
//we already have the new vertex, however, we need to find it
|
||||
GlobalVertex gv = getGlobalVertex((*it.first).first);
|
||||
@@ -336,23 +336,23 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::setChanged() {
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
std::pair<boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >, LocalVertex> ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::createCluster() {
|
||||
std::pair<std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >, LocalVertex> ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::createCluster() {
|
||||
vertex_bundle vp;
|
||||
fusion::at_c<0> (vp) = m_id->generate();
|
||||
LocalVertex v = boost::add_vertex(vp, *this);
|
||||
return std::pair<boost::shared_ptr<ClusterGraph>, LocalVertex> (m_clusters[v] = boost::shared_ptr<ClusterGraph> (new ClusterGraph(sp_base::shared_from_this())), v);
|
||||
return std::pair<std::shared_ptr<ClusterGraph>, LocalVertex> (m_clusters[v] = std::shared_ptr<ClusterGraph> (new ClusterGraph(sp_base::shared_from_this())), v);
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
inline boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
inline std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>:: parent() {
|
||||
return boost::shared_ptr<ClusterGraph> (m_parent);
|
||||
return std::shared_ptr<ClusterGraph> (m_parent);
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
inline const boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
inline const std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::parent() const {
|
||||
return boost::shared_ptr<ClusterGraph> (m_parent);
|
||||
return std::shared_ptr<ClusterGraph> (m_parent);
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
@@ -361,13 +361,13 @@ bool ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::isRoot() const
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::root() {
|
||||
return isRoot() ? sp_base::shared_from_this() : parent()->root();
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
const boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
const std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::root() const {
|
||||
return isRoot() ? sp_base::shared_from_this() : parent()->root();
|
||||
};
|
||||
@@ -396,7 +396,7 @@ bool ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::isCluster(cons
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getVertexCluster(LocalVertex v) {
|
||||
if(isCluster(v))
|
||||
return m_clusters[v];
|
||||
@@ -406,7 +406,7 @@ ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getVertexCluster(Lo
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
LocalVertex ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getClusterVertex(boost::shared_ptr<ClusterGraph> g) {
|
||||
LocalVertex ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getClusterVertex(std::shared_ptr<ClusterGraph> g) {
|
||||
std::pair<cluster_iterator, cluster_iterator> it = clusters();
|
||||
|
||||
for(; it.first != it.second; it.first++) {
|
||||
@@ -419,12 +419,12 @@ LocalVertex ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getClus
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
template<typename Functor>
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeCluster(boost::shared_ptr<ClusterGraph> g, Functor& f) {
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeCluster(std::shared_ptr<ClusterGraph> g, Functor& f) {
|
||||
removeCluster(getClusterVertex(g), f);
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeCluster(boost::shared_ptr<ClusterGraph> g) {
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeCluster(std::shared_ptr<ClusterGraph> g) {
|
||||
placehoder p;
|
||||
removeCluster(getClusterVertex(g), p);
|
||||
};
|
||||
@@ -443,7 +443,7 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeCluster(
|
||||
if(it == m_clusters.end())
|
||||
throw details::cluster_error() << boost::errinfo_errno(11) << error_message("Cluster is not part of this graph");
|
||||
|
||||
std::pair<LocalVertex, boost::shared_ptr<ClusterGraph> > res = *it;
|
||||
std::pair<LocalVertex, std::shared_ptr<ClusterGraph> > res = *it;
|
||||
|
||||
//apply functor to all vertices and edges in the subclusters
|
||||
f(res.second);
|
||||
@@ -659,7 +659,7 @@ ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getLocalVertex(Glob
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
fusion::vector<LocalVertex, boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >, bool>
|
||||
fusion::vector<LocalVertex, std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >, bool>
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getLocalVertexGraph(GlobalVertex v) {
|
||||
return getContainingVertexGraph(v);
|
||||
};
|
||||
@@ -759,14 +759,14 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::removeEdge(Loc
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
template<typename Obj, typename key>
|
||||
boost::shared_ptr<Obj>
|
||||
std::shared_ptr<Obj>
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getObject(key k) {
|
||||
return apply_to_bundle(k, obj_helper<details::get, Obj, key, ClusterGraph> (k));
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
template<typename Obj, typename key>
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::setObject(key k, boost::shared_ptr<Obj> val) {
|
||||
void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::setObject(key k, std::shared_ptr<Obj> val) {
|
||||
apply_to_bundle(k, obj_helper<details::set, Obj, key, ClusterGraph> (k)) = val;
|
||||
|
||||
setChanged();
|
||||
@@ -794,7 +794,7 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::for_each(Funct
|
||||
std::pair<local_vertex_iterator, local_vertex_iterator> it = boost::vertices(*this);
|
||||
|
||||
for(; it.first != it.second; it.first++) {
|
||||
boost::shared_ptr<Obj> ptr = getObject<Obj> (* (it.first)) ;
|
||||
std::shared_ptr<Obj> ptr = getObject<Obj> (* (it.first)) ;
|
||||
|
||||
if(ptr)
|
||||
f(ptr);
|
||||
@@ -888,7 +888,7 @@ void ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::initIndexMaps(
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
LocalVertex
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::moveToSubcluster(LocalVertex v, boost::shared_ptr<ClusterGraph> cg) {
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::moveToSubcluster(LocalVertex v, std::shared_ptr<ClusterGraph> cg) {
|
||||
|
||||
LocalVertex cv = getClusterVertex(cg);
|
||||
return moveToSubcluster(v, cv, cg);
|
||||
@@ -898,13 +898,13 @@ template< typename edge_prop, typename vertex_prop, typename cluster_prop, typen
|
||||
LocalVertex
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::moveToSubcluster(LocalVertex v, LocalVertex Cluster) {
|
||||
|
||||
boost::shared_ptr<ClusterGraph> cg = getVertexCluster(Cluster);
|
||||
std::shared_ptr<ClusterGraph> cg = getVertexCluster(Cluster);
|
||||
return moveToSubcluster(v, Cluster, cg);
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
LocalVertex
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::moveToSubcluster(LocalVertex v, LocalVertex Cluster, boost::shared_ptr<ClusterGraph> cg) {
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::moveToSubcluster(LocalVertex v, LocalVertex Cluster, std::shared_ptr<ClusterGraph> cg) {
|
||||
|
||||
std::pair<local_out_edge_iterator, local_out_edge_iterator> it = boost::out_edges(v, *this);
|
||||
|
||||
@@ -1106,7 +1106,7 @@ ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getContainingVertex
|
||||
};
|
||||
|
||||
template< typename edge_prop, typename vertex_prop, typename cluster_prop, typename objects>
|
||||
fusion::vector<LocalVertex, boost::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >, bool>
|
||||
fusion::vector<LocalVertex, std::shared_ptr< ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects> >, bool>
|
||||
ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getContainingVertexGraph(GlobalVertex id) {
|
||||
|
||||
LocalVertex v;
|
||||
@@ -1114,7 +1114,7 @@ ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::getContainingVertex
|
||||
boost::tie(v, done) = getContainingVertex(id);
|
||||
|
||||
if(!done)
|
||||
return fusion::make_vector(LocalVertex(), boost::shared_ptr<ClusterGraph>(), false);
|
||||
return fusion::make_vector(LocalVertex(), std::shared_ptr<ClusterGraph>(), false);
|
||||
|
||||
if(isCluster(v) && (getGlobalVertex(v) != id))
|
||||
return m_clusters[v]->getContainingVertexGraph(id);
|
||||
@@ -1185,7 +1185,7 @@ ClusterGraph<edge_prop, vertex_prop, cluster_prop, objects>::apply_to_bundle(Glo
|
||||
}
|
||||
|
||||
//check all clusters if they have the object
|
||||
fusion::vector<LocalVertex, boost::shared_ptr<ClusterGraph>, bool> res = getContainingVertexGraph(k);
|
||||
fusion::vector<LocalVertex, std::shared_ptr<ClusterGraph>, bool> res = getContainingVertexGraph(k);
|
||||
|
||||
if(!fusion::at_c<2> (res)) {
|
||||
//TODO: Throw (propeties return reference, but can't init a reference temporarily)
|
||||
|
||||
@@ -128,7 +128,7 @@ typename Kernel::VectorMap& Geometry<Kernel, Dim, TagList>::getParameterMap() {
|
||||
|
||||
template< typename Kernel, int Dim, typename TagList>
|
||||
template<typename T>
|
||||
void Geometry<Kernel, Dim, TagList>::linkTo(boost::shared_ptr<Geometry<Kernel, Dim, TagList> > geom, int offset) {
|
||||
void Geometry<Kernel, Dim, TagList>::linkTo(std::shared_ptr<Geometry<Kernel, Dim, TagList> > geom, int offset) {
|
||||
|
||||
init<T>();
|
||||
m_link = geom;
|
||||
|
||||
@@ -65,10 +65,10 @@ template<typename Sys, typename Derived, typename Sig>
|
||||
Object<Sys, Derived, Sig>::Object(Sys& system) : m_system(&system) {};
|
||||
|
||||
template<typename Sys, typename Derived, typename Sig>
|
||||
boost::shared_ptr<Derived> Object<Sys, Derived, Sig>::clone(Sys& newSys)
|
||||
std::shared_ptr<Derived> Object<Sys, Derived, Sig>::clone(Sys& newSys)
|
||||
{
|
||||
|
||||
boost::shared_ptr<Derived> np = boost::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
std::shared_ptr<Derived> np = std::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
np->m_system = &newSys;
|
||||
return np;
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ struct cloner {
|
||||
|
||||
template<typename T>
|
||||
struct test : mpl::and_<details::is_shared_ptr<T>,
|
||||
mpl::not_<boost::is_same<T, boost::shared_ptr<typename System::Cluster> > > > {};
|
||||
mpl::not_<boost::is_same<T, std::shared_ptr<typename System::Cluster> > > > {};
|
||||
|
||||
template<typename T>
|
||||
typename boost::enable_if< test<T>, void>::type operator()(T& p) const {
|
||||
@@ -104,9 +104,9 @@ SolverInfo System<KernelType, T1, T2, T3>::solve() {
|
||||
};
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
boost::shared_ptr<System<KernelType, T1, T2, T3> > System<KernelType, T1, T2, T3>::createSubsystem() {
|
||||
std::shared_ptr<System<KernelType, T1, T2, T3> > System<KernelType, T1, T2, T3>::createSubsystem() {
|
||||
|
||||
boost::shared_ptr<System> s = boost::shared_ptr<System>(new System());
|
||||
std::shared_ptr<System> s = std::shared_ptr<System>(new System());
|
||||
s->m_cluster = m_cluster->createCluster().first;
|
||||
s->m_storage = m_storage;
|
||||
s->m_cluster->template setProperty<dcm::type_prop>(details::subcluster);
|
||||
@@ -127,12 +127,12 @@ boost::shared_ptr<System<KernelType, T1, T2, T3> > System<KernelType, T1, T2, T3
|
||||
};
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
typename std::vector<boost::shared_ptr<System<KernelType, T1, T2, T3> > >::iterator System<KernelType, T1, T2, T3>::beginSubsystems() {
|
||||
typename std::vector<std::shared_ptr<System<KernelType, T1, T2, T3> > >::iterator System<KernelType, T1, T2, T3>::beginSubsystems() {
|
||||
return m_subsystems.begin();
|
||||
};
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
typename std::vector<boost::shared_ptr<System<KernelType, T1, T2, T3> > >::iterator System<KernelType, T1, T2, T3>::endSubsystems() {
|
||||
typename std::vector<std::shared_ptr<System<KernelType, T1, T2, T3> > >::iterator System<KernelType, T1, T2, T3>::endSubsystems() {
|
||||
return m_subsystems.end();
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <boost/log/sources/record_ostream.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
|
||||
namespace logging = boost::log;
|
||||
namespace sinks = boost::log::sinks;
|
||||
@@ -59,16 +59,16 @@ static int counter = 0;
|
||||
typedef sinks::synchronous_sink< sinks::text_file_backend > sink_t;
|
||||
typedef src::severity_logger< severity_level > dcm_logger;
|
||||
|
||||
inline boost::shared_ptr< sink_t > init_log() {
|
||||
inline std::shared_ptr< sink_t > init_log() {
|
||||
|
||||
//create the filename
|
||||
std::stringstream str;
|
||||
str<<"openDCM_"<<counter<<"_%N.log";
|
||||
counter++;
|
||||
|
||||
boost::shared_ptr< logging::core > core = logging::core::get();
|
||||
std::shared_ptr< logging::core > core = logging::core::get();
|
||||
|
||||
boost::shared_ptr< sinks::text_file_backend > backend =
|
||||
std::shared_ptr< sinks::text_file_backend > backend =
|
||||
boost::make_shared< sinks::text_file_backend >(
|
||||
keywords::file_name = str.str(), //file name pattern
|
||||
keywords::rotation_size = 10 * 1024 * 1024 //Rotation size is 10MB
|
||||
@@ -76,7 +76,7 @@ inline boost::shared_ptr< sink_t > init_log() {
|
||||
|
||||
// Wrap it into the frontend and register in the core.
|
||||
// The backend requires synchronization in the frontend.
|
||||
boost::shared_ptr< sink_t > sink(new sink_t(backend));
|
||||
std::shared_ptr< sink_t > sink(new sink_t(backend));
|
||||
|
||||
sink->set_formatter(
|
||||
expr::stream <<"[" << expr::attr<std::string>("Tag") <<"] "
|
||||
@@ -89,9 +89,9 @@ inline boost::shared_ptr< sink_t > init_log() {
|
||||
return sink;
|
||||
};
|
||||
|
||||
inline void stop_log(boost::shared_ptr< sink_t >& sink) {
|
||||
inline void stop_log(std::shared_ptr< sink_t >& sink) {
|
||||
|
||||
boost::shared_ptr< logging::core > core = logging::core::get();
|
||||
std::shared_ptr< logging::core > core = logging::core::get();
|
||||
|
||||
// Remove the sink from the core, so that no records are passed to it
|
||||
core->remove_sink(sink);
|
||||
|
||||
@@ -172,7 +172,7 @@ struct Object : public PropertyOwner<typename details::properties_by_object<type
|
||||
* @tparam Prop property type which should be accessed
|
||||
* @return Prop::type& a reference to the properties actual value.
|
||||
**/
|
||||
virtual boost::shared_ptr<Derived> clone(Sys& newSys);
|
||||
virtual std::shared_ptr<Derived> clone(Sys& newSys);
|
||||
|
||||
Sys* m_system;
|
||||
};
|
||||
|
||||
@@ -386,10 +386,10 @@ public:
|
||||
*
|
||||
* @param g shared ptr of the cluster graph on which the algorithm is used
|
||||
**/
|
||||
property_map(boost::shared_ptr<Graph> g)
|
||||
property_map(std::shared_ptr<Graph> g)
|
||||
: m_graph(g) { }
|
||||
|
||||
boost::shared_ptr<Graph> m_graph;
|
||||
std::shared_ptr<Graph> m_graph;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -113,7 +113,7 @@ struct EmptyModule {
|
||||
template<typename T>
|
||||
struct type {
|
||||
struct inheriter {
|
||||
void system_sub(boost::shared_ptr<T> subsys) {};
|
||||
void system_sub(std::shared_ptr<T> subsys) {};
|
||||
};
|
||||
typedef mpl::vector<> properties;
|
||||
typedef mpl::vector<> objects;
|
||||
@@ -129,7 +129,7 @@ struct EmptyModule {
|
||||
template <class T>
|
||||
struct is_shared_ptr : boost::mpl::false_ {};
|
||||
template <class T>
|
||||
struct is_shared_ptr<boost::shared_ptr<T> > : boost::mpl::true_ {};
|
||||
struct is_shared_ptr<std::shared_ptr<T> > : boost::mpl::true_ {};
|
||||
|
||||
template<typename Sys, typename M1, typename M2, typename M3>
|
||||
struct inheriter : public M1::inheriter, public M2::inheriter, public M3::inheriter,
|
||||
@@ -201,12 +201,12 @@ public:
|
||||
//we hold our own PropertyOwner which we use for system settings. Don't inherit it as the user
|
||||
//should not access the settings via the proeprty getter and setter functions.
|
||||
typedef PropertyOwner<typename details::properties_by_kind<properties, setting_property>::type> OptionOwner;
|
||||
boost::shared_ptr<OptionOwner> m_options;
|
||||
std::shared_ptr<OptionOwner> m_options;
|
||||
|
||||
|
||||
protected:
|
||||
//object storage
|
||||
typedef typename mpl::transform<objects, boost::shared_ptr<mpl::_1> >::type sp_objects;
|
||||
typedef typename mpl::transform<objects, std::shared_ptr<mpl::_1> >::type sp_objects;
|
||||
typedef typename mpl::fold< sp_objects, mpl::vector<>,
|
||||
mpl::push_back<mpl::_1, std::vector<mpl::_2> > >::type object_vectors;
|
||||
typedef typename fusion::result_of::as_vector<object_vectors>::type Storage;
|
||||
@@ -215,7 +215,7 @@ protected:
|
||||
friend struct Object;
|
||||
|
||||
#ifdef USE_LOGGING
|
||||
boost::shared_ptr< sink_t > sink;
|
||||
std::shared_ptr< sink_t > sink;
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -230,25 +230,25 @@ public:
|
||||
void clear();
|
||||
|
||||
template<typename Object>
|
||||
typename std::vector< boost::shared_ptr<Object> >::iterator begin();
|
||||
typename std::vector< std::shared_ptr<Object> >::iterator begin();
|
||||
|
||||
template<typename Object>
|
||||
typename std::vector< boost::shared_ptr<Object> >::iterator end();
|
||||
typename std::vector< std::shared_ptr<Object> >::iterator end();
|
||||
|
||||
template<typename Object>
|
||||
std::vector< boost::shared_ptr<Object> >& objectVector();
|
||||
std::vector< std::shared_ptr<Object> >& objectVector();
|
||||
|
||||
template<typename Object>
|
||||
void push_back(boost::shared_ptr<Object> ptr);
|
||||
void push_back(std::shared_ptr<Object> ptr);
|
||||
|
||||
template<typename Object>
|
||||
void erase(boost::shared_ptr<Object> ptr);
|
||||
void erase(std::shared_ptr<Object> ptr);
|
||||
|
||||
SolverInfo solve();
|
||||
|
||||
boost::shared_ptr< System > createSubsystem();
|
||||
typename std::vector< boost::shared_ptr<System> >::iterator beginSubsystems();
|
||||
typename std::vector< boost::shared_ptr<System> >::iterator endSubsystems();
|
||||
std::shared_ptr< System > createSubsystem();
|
||||
typename std::vector< std::shared_ptr<System> >::iterator beginSubsystems();
|
||||
typename std::vector< std::shared_ptr<System> >::iterator endSubsystems();
|
||||
|
||||
//a kernel has it's own settings, therefore we need to decide which is accessed
|
||||
template<typename Option>
|
||||
@@ -278,11 +278,11 @@ public:
|
||||
|
||||
System* clone() const;
|
||||
|
||||
boost::shared_ptr<Cluster> m_cluster;
|
||||
boost::shared_ptr<Storage> m_storage;
|
||||
std::shared_ptr<Cluster> m_cluster;
|
||||
std::shared_ptr<Storage> m_storage;
|
||||
Shedule m_sheduler;
|
||||
Kernel m_kernel;
|
||||
std::vector<boost::shared_ptr<System> > m_subsystems;
|
||||
std::vector<std::shared_ptr<System> > m_subsystems;
|
||||
|
||||
#ifdef USE_LOGGING
|
||||
template<typename Expr>
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
template<typename Object>
|
||||
typename std::vector< boost::shared_ptr<Object> >::iterator System<KernelType, T1, T2, T3>::begin() {
|
||||
typename std::vector< std::shared_ptr<Object> >::iterator System<KernelType, T1, T2, T3>::begin() {
|
||||
|
||||
typedef typename mpl::find<objects, Object>::type iterator;
|
||||
typedef typename mpl::distance<typename mpl::begin<objects>::type, iterator>::type distance;
|
||||
@@ -307,7 +307,7 @@ typename std::vector< boost::shared_ptr<Object> >::iterator System<KernelType, T
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
template<typename Object>
|
||||
typename std::vector< boost::shared_ptr<Object> >::iterator System<KernelType, T1, T2, T3>::end() {
|
||||
typename std::vector< std::shared_ptr<Object> >::iterator System<KernelType, T1, T2, T3>::end() {
|
||||
|
||||
typedef typename mpl::find<objects, Object>::type iterator;
|
||||
typedef typename mpl::distance<typename mpl::begin<objects>::type, iterator>::type distance;
|
||||
@@ -317,7 +317,7 @@ typename std::vector< boost::shared_ptr<Object> >::iterator System<KernelType, T
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
template<typename Object>
|
||||
std::vector< boost::shared_ptr<Object> >& System<KernelType, T1, T2, T3>::objectVector() {
|
||||
std::vector< std::shared_ptr<Object> >& System<KernelType, T1, T2, T3>::objectVector() {
|
||||
|
||||
typedef typename mpl::find<objects, Object>::type iterator;
|
||||
typedef typename mpl::distance<typename mpl::begin<objects>::type, iterator>::type distance;
|
||||
@@ -327,15 +327,15 @@ std::vector< boost::shared_ptr<Object> >& System<KernelType, T1, T2, T3>::object
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
template<typename Object>
|
||||
void System<KernelType, T1, T2, T3>::push_back(boost::shared_ptr<Object> ptr) {
|
||||
void System<KernelType, T1, T2, T3>::push_back(std::shared_ptr<Object> ptr) {
|
||||
objectVector<Object>().push_back(ptr);
|
||||
};
|
||||
|
||||
template< typename KernelType, typename T1, typename T2, typename T3 >
|
||||
template<typename Object>
|
||||
void System<KernelType, T1, T2, T3>::erase(boost::shared_ptr<Object> ptr) {
|
||||
void System<KernelType, T1, T2, T3>::erase(std::shared_ptr<Object> ptr) {
|
||||
|
||||
std::vector< boost::shared_ptr<Object> >& vec = objectVector<Object>();
|
||||
std::vector< std::shared_ptr<Object> >& vec = objectVector<Object>();
|
||||
vec.erase(std::remove(vec.begin(), vec.end(), ptr), vec.end());
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
typedef typename Sys::Cluster Cluster;
|
||||
typedef typename system_traits<Sys>::template getModule<m3d>::type module3d;
|
||||
typedef typename module3d::Geometry3D Geometry3D;
|
||||
typedef boost::shared_ptr<Geometry3D> Geom;
|
||||
typedef std::shared_ptr<Geometry3D> Geom;
|
||||
typedef typename module3d::math_prop math_prop;
|
||||
typedef typename module3d::fix_prop fix_prop;
|
||||
|
||||
@@ -122,10 +122,10 @@ public:
|
||||
map_downstream(details::ClusterMath<Sys>& cm, bool fix);
|
||||
|
||||
void operator()(Geom g);
|
||||
void operator()(boost::shared_ptr<Cluster> c);
|
||||
void operator()(std::shared_ptr<Cluster> c);
|
||||
};
|
||||
|
||||
void mapClusterDownstreamGeometry(boost::shared_ptr<Cluster> cluster);
|
||||
void mapClusterDownstreamGeometry(std::shared_ptr<Cluster> cluster);
|
||||
|
||||
//Calculate the scale of the cluster. Therefore the midpoint is calculated and the scale is
|
||||
// defined as the max distance between the midpoint and the points.
|
||||
|
||||
@@ -343,7 +343,7 @@ void ClusterMath<Sys>::map_downstream::operator()(Geom g) {
|
||||
};
|
||||
|
||||
template<typename Sys>
|
||||
void ClusterMath<Sys>::map_downstream::operator()(boost::shared_ptr<Cluster> c) {
|
||||
void ClusterMath<Sys>::map_downstream::operator()(std::shared_ptr<Cluster> c) {
|
||||
//we transform the GLOBAL geometries to local ones in the subcluster! therefore
|
||||
//we are not interested in the successive transformations, we only transform the
|
||||
//global geometries with the cluster transform we want them to be local in, and thats
|
||||
@@ -353,7 +353,7 @@ void ClusterMath<Sys>::map_downstream::operator()(boost::shared_ptr<Cluster> c)
|
||||
|
||||
|
||||
template<typename Sys>
|
||||
void ClusterMath<Sys>::mapClusterDownstreamGeometry(boost::shared_ptr<Cluster> cluster) {
|
||||
void ClusterMath<Sys>::mapClusterDownstreamGeometry(std::shared_ptr<Cluster> cluster) {
|
||||
|
||||
#ifdef USE_LOGGING
|
||||
BOOST_LOG(log) << "Map downstream geometry";
|
||||
|
||||
@@ -67,10 +67,10 @@ namespace dcm {
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<Derived> Module3D<Typelist, ID>::type<Sys>::Constraint3D_base<Derived>::clone(Sys& newSys) {
|
||||
std::shared_ptr<Derived> Module3D<Typelist, ID>::type<Sys>::Constraint3D_base<Derived>::clone(Sys& newSys) {
|
||||
|
||||
//copy the standart stuff
|
||||
boost::shared_ptr<Derived> np = boost::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
std::shared_ptr<Derived> np = std::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
np->m_system = &newSys;
|
||||
//copy the internals
|
||||
np->content = CBase::content->clone();
|
||||
|
||||
@@ -125,10 +125,10 @@ typename Visitor::result_type Module3D<Typelist, ID>::type<Sys>::Geometry3D_base
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<Derived> Module3D<Typelist, ID>::type<Sys>::Geometry3D_base<Derived>::clone(Sys& newSys) {
|
||||
std::shared_ptr<Derived> Module3D<Typelist, ID>::type<Sys>::Geometry3D_base<Derived>::clone(Sys& newSys) {
|
||||
|
||||
//copy the standart stuff
|
||||
boost::shared_ptr<Derived> np = boost::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
std::shared_ptr<Derived> np = std::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
np->m_system = &newSys;
|
||||
//it's possible that the variant contains pointers, so we need to clone them
|
||||
details::cloner<Variant> clone_fnc(np->m_geometry);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace details {
|
||||
|
||||
|
||||
template<typename Sys>
|
||||
MES<Sys>::MES(boost::shared_ptr<Cluster> cl, int par, int eqn) : Base(par, eqn), m_cluster(cl) {
|
||||
MES<Sys>::MES(std::shared_ptr<Cluster> cl, int par, int eqn) : Base(par, eqn), m_cluster(cl) {
|
||||
#ifdef USE_LOGGING
|
||||
log.add_attribute("Tag", attrs::constant< std::string >("MES3D"));
|
||||
#endif
|
||||
@@ -101,7 +101,7 @@ void MES<Sys>::removeLocalGradientZeros() {
|
||||
|
||||
|
||||
template<typename Sys>
|
||||
SystemSolver<Sys>::Rescaler::Rescaler(boost::shared_ptr<Cluster> c, Mes& m) : cluster(c), mes(m), rescales(0) {
|
||||
SystemSolver<Sys>::Rescaler::Rescaler(std::shared_ptr<Cluster> c, Mes& m) : cluster(c), mes(m), rescales(0) {
|
||||
|
||||
};
|
||||
|
||||
@@ -153,7 +153,7 @@ typename SystemSolver<Sys>::Scalar SystemSolver<Sys>::Rescaler::scaleClusters(Sc
|
||||
for(; it.first != it.second; it.first++) {
|
||||
|
||||
if(cluster->isCluster(*it.first)) {
|
||||
boost::shared_ptr<Cluster> c = cluster->getVertexCluster(*it.first);
|
||||
std::shared_ptr<Cluster> c = cluster->getVertexCluster(*it.first);
|
||||
c->template getProperty<math_prop>().applyClusterScale(sc,
|
||||
c->template getProperty<fix_prop>());
|
||||
}
|
||||
@@ -168,7 +168,7 @@ typename SystemSolver<Sys>::Scalar SystemSolver<Sys>::Rescaler::scaleClusters(Sc
|
||||
|
||||
template<typename Sys>
|
||||
void SystemSolver<Sys>::Rescaler::collectPseudoPoints(
|
||||
boost::shared_ptr<typename SystemSolver<Sys>::Cluster> parent,
|
||||
std::shared_ptr<typename SystemSolver<Sys>::Cluster> parent,
|
||||
LocalVertex cluster,
|
||||
std::vector<typename SystemSolver<Sys>::Kernel::Vector3,
|
||||
Eigen::aligned_allocator<typename SystemSolver<Sys>::Kernel::Vector3> >& vec) {
|
||||
@@ -217,7 +217,7 @@ void SystemSolver<Sys>::execute(Sys& sys) {
|
||||
};
|
||||
|
||||
template<typename Sys>
|
||||
void SystemSolver<Sys>::solveCluster(boost::shared_ptr<Cluster> cluster, Sys& sys) {
|
||||
void SystemSolver<Sys>::solveCluster(std::shared_ptr<Cluster> cluster, Sys& sys) {
|
||||
|
||||
//set out and solve all relevant subclusters
|
||||
typedef typename Cluster::cluster_iterator citer;
|
||||
@@ -225,7 +225,7 @@ void SystemSolver<Sys>::solveCluster(boost::shared_ptr<Cluster> cluster, Sys& sy
|
||||
|
||||
for(; cit.first != cit.second; cit.first++) {
|
||||
|
||||
boost::shared_ptr<Cluster> c = (*cit.first).second;
|
||||
std::shared_ptr<Cluster> c = (*cit.first).second;
|
||||
|
||||
if(c->template getProperty<changed_prop>() &&
|
||||
((c->template getProperty<type_prop>() == details::cluster3D)
|
||||
@@ -283,7 +283,7 @@ void SystemSolver<Sys>::solveCluster(boost::shared_ptr<Cluster> cluster, Sys& sy
|
||||
for(; it.first != it.second; it.first++) {
|
||||
|
||||
if(cluster->isCluster(*it.first)) {
|
||||
boost::shared_ptr<Cluster> c = cluster->getVertexCluster(*it.first);
|
||||
std::shared_ptr<Cluster> c = cluster->getVertexCluster(*it.first);
|
||||
details::ClusterMath<Sys>& cm = c->template getProperty<math_prop>();
|
||||
|
||||
//only get maps and propagate downstream if not fixed
|
||||
@@ -454,7 +454,7 @@ void SystemSolver<Sys>::solveCluster(boost::shared_ptr<Cluster> cluster, Sys& sy
|
||||
};
|
||||
|
||||
template<typename Sys>
|
||||
void SystemSolver<Sys>::finish(boost::shared_ptr<Cluster> cluster, Sys& sys, Mes& mes) {
|
||||
void SystemSolver<Sys>::finish(std::shared_ptr<Cluster> cluster, Sys& sys, Mes& mes) {
|
||||
|
||||
//solving is done, now go to all relevant geometries and clusters and write the values back
|
||||
//(no need to emit recalculated signal as this cluster is never recalculated in this run)
|
||||
@@ -464,7 +464,7 @@ void SystemSolver<Sys>::finish(boost::shared_ptr<Cluster> cluster, Sys& sys, Mes
|
||||
for(; it.first != it.second; it.first++) {
|
||||
|
||||
if(cluster->isCluster(*it.first)) {
|
||||
boost::shared_ptr<Cluster> c = cluster->getVertexCluster(*it.first);
|
||||
std::shared_ptr<Cluster> c = cluster->getVertexCluster(*it.first);
|
||||
|
||||
if(!cluster->template getSubclusterProperty<fix_prop>(*it.first))
|
||||
c->template getProperty<math_prop>().finishCalculation();
|
||||
|
||||
@@ -83,7 +83,7 @@ struct geom_visitor : public boost::static_visitor<std::string> {
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
std::string getWeight(boost::shared_ptr<T> ptr) {
|
||||
std::string getWeight(std::shared_ptr<T> ptr) {
|
||||
geom_visitor v;
|
||||
return ptr->apply(v);
|
||||
};
|
||||
@@ -104,7 +104,7 @@ typedef std::vector< fusion::vector2<std::string, std::vector<double> > > string
|
||||
typedef std::vector< fusion::vector2<std::vector<char>, std::vector<double> > > char_vec;
|
||||
|
||||
template<typename C>
|
||||
string_vec getConstraints(boost::shared_ptr<C> con) {
|
||||
string_vec getConstraints(std::shared_ptr<C> con) {
|
||||
|
||||
string_vec vec;
|
||||
std::vector<boost::any> cvec = con->getGenericConstraints();
|
||||
@@ -174,7 +174,7 @@ string_vec getConstraints(boost::shared_ptr<C> con) {
|
||||
template<typename C>
|
||||
void constraintCreation(typename char_vec::iterator it,
|
||||
typename char_vec::iterator end,
|
||||
boost::shared_ptr<C> con) {
|
||||
std::shared_ptr<C> con) {
|
||||
|
||||
std::string first(fusion::at_c<0>(*it).begin(), fusion::at_c<0>(*it).end());
|
||||
std::vector<double> second = fusion::at_c<1>(*it);
|
||||
@@ -212,7 +212,7 @@ void constraintCreation(typename char_vec::iterator it,
|
||||
};
|
||||
|
||||
template<typename C>
|
||||
void setConstraints(char_vec& vec, boost::shared_ptr<C> con) {
|
||||
void setConstraints(char_vec& vec, std::shared_ptr<C> con) {
|
||||
constraintCreation<C>(vec.begin(), vec.end(), con);
|
||||
};
|
||||
|
||||
@@ -301,7 +301,7 @@ struct inject_set<mpl::void_> {
|
||||
|
||||
template<typename System>
|
||||
bool Create(System* sys, std::string& type,
|
||||
boost::shared_ptr<typename details::getModule3D<System>::type::Geometry3D> geom,
|
||||
std::shared_ptr<typename details::getModule3D<System>::type::Geometry3D> geom,
|
||||
typename System::Kernel::Vector& v) {
|
||||
|
||||
typedef typename details::getModule3D<System>::type::geometry_types Typelist;
|
||||
@@ -416,7 +416,7 @@ void parser_generator<typename details::getModule3D<System>::type::fix_prop, Sys
|
||||
template<typename System, typename iterator>
|
||||
void parser_parser< typename details::getModule3D<System>::type::Geometry3D, System, iterator >::init(parser& r) {
|
||||
|
||||
r = qi::lit("<type>Geometry3D</type>")[ qi::_val = phx::construct<boost::shared_ptr<object_type> >(phx::new_<object_type>(*qi::_r1))]
|
||||
r = qi::lit("<type>Geometry3D</type>")[ qi::_val = phx::construct<std::shared_ptr<object_type> >(phx::new_<object_type>(*qi::_r1))]
|
||||
>> "<class>" >> (+qi::char_("a-zA-Z"))[qi::_a = phx::construct<std::string>(phx::begin(qi::_1), phx::end(qi::_1))] >> "</class>"
|
||||
>> "<value>" >> *qi::double_[ vector_in(qi::_b, qi::_c, qi::_1) ] >> "</value>"
|
||||
>> qi::eps[ create(qi::_r1, qi::_a, qi::_val, qi::_b) ];
|
||||
@@ -440,7 +440,7 @@ void parser_parser< typename details::getModule3D<System>::type::Constraint3D, S
|
||||
|
||||
r = qi::lit("<type>Constraint3D</type>")
|
||||
>> ("<connect first=" >> qi::int_ >> "second=" >> qi::int_ >> "></connect>")[
|
||||
qi::_val = phx::construct<boost::shared_ptr<Constraint3D> >(
|
||||
qi::_val = phx::construct<std::shared_ptr<Constraint3D> >(
|
||||
phx::new_<Constraint3D>(*qi::_r1,
|
||||
phx::bind(&System::Cluster::template getObject<Geometry3D, GlobalVertex>, phx::bind(&System::m_cluster, qi::_r1), qi::_1),
|
||||
phx::bind(&System::Cluster::template getObject<Geometry3D, GlobalVertex>, phx::bind(&System::m_cluster, qi::_r1), qi::_2)))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <boost/mpl/map.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
@@ -60,8 +60,8 @@ struct Module3D {
|
||||
struct vertex_prop;
|
||||
struct inheriter_base;
|
||||
|
||||
typedef boost::shared_ptr<Geometry3D> Geom;
|
||||
typedef boost::shared_ptr<Constraint3D> Cons;
|
||||
typedef std::shared_ptr<Geometry3D> Geom;
|
||||
typedef std::shared_ptr<Constraint3D> Cons;
|
||||
|
||||
typedef mpl::map3< mpl::pair<reset, boost::function<void (Geom) > >,
|
||||
mpl::pair<remove, boost::function<void (Geom) > > ,
|
||||
@@ -105,7 +105,7 @@ struct Module3D {
|
||||
template<typename T>
|
||||
T convertTo();
|
||||
|
||||
virtual boost::shared_ptr<Derived> clone(Sys& newSys);
|
||||
virtual std::shared_ptr<Derived> clone(Sys& newSys);
|
||||
|
||||
protected:
|
||||
typedef typename mpl::push_front<Typelist, boost::blank>::type ExtTypeList;
|
||||
@@ -178,7 +178,7 @@ struct Module3D {
|
||||
Constraint3D_base(Sys& system, Geom f, Geom s) : detail::Constraint<Sys, 3>(f,s),
|
||||
Object<Sys, Derived, ConsSignal>(system) {};
|
||||
|
||||
virtual boost::shared_ptr<Derived> clone(Sys& newSys);
|
||||
virtual std::shared_ptr<Derived> clone(Sys& newSys);
|
||||
};
|
||||
|
||||
template<typename Derived>
|
||||
@@ -217,7 +217,7 @@ struct Module3D {
|
||||
Cons createConstraint3D(Geom first, Geom second, T1 constraint1);
|
||||
void removeConstraint3D(Cons c);
|
||||
|
||||
void system_sub(boost::shared_ptr<Sys> subsys) {};
|
||||
void system_sub(std::shared_ptr<Sys> subsys) {};
|
||||
|
||||
protected:
|
||||
Sys* m_this;
|
||||
|
||||
@@ -35,21 +35,21 @@ struct MES : public Sys::Kernel::MappedEquationSystem {
|
||||
typedef typename Sys::Cluster Cluster;
|
||||
typedef typename system_traits<Sys>::template getModule<m3d>::type module3d;
|
||||
typedef typename module3d::Geometry3D Geometry3D;
|
||||
typedef boost::shared_ptr<Geometry3D> Geom;
|
||||
typedef std::shared_ptr<Geometry3D> Geom;
|
||||
typedef typename module3d::Constraint3D Constraint3D;
|
||||
typedef boost::shared_ptr<Constraint3D> Cons;
|
||||
typedef std::shared_ptr<Constraint3D> Cons;
|
||||
typedef typename module3d::math_prop math_prop;
|
||||
typedef typename module3d::fix_prop fix_prop;
|
||||
typedef typename Kernel::number_type Scalar;
|
||||
typedef typename Sys::Kernel::MappedEquationSystem Base;
|
||||
|
||||
boost::shared_ptr<Cluster> m_cluster;
|
||||
std::shared_ptr<Cluster> m_cluster;
|
||||
|
||||
#ifdef USE_LOGGING
|
||||
dcm_logger log;
|
||||
#endif
|
||||
|
||||
MES(boost::shared_ptr<Cluster> cl, int par, int eqn);
|
||||
MES(std::shared_ptr<Cluster> cl, int par, int eqn);
|
||||
virtual void recalculate();
|
||||
virtual void removeLocalGradientZeros();
|
||||
};
|
||||
@@ -62,9 +62,9 @@ struct SystemSolver : public Job<Sys> {
|
||||
typedef typename Kernel::number_type Scalar;
|
||||
typedef typename system_traits<Sys>::template getModule<m3d>::type module3d;
|
||||
typedef typename module3d::Geometry3D Geometry3D;
|
||||
typedef boost::shared_ptr<Geometry3D> Geom;
|
||||
typedef std::shared_ptr<Geometry3D> Geom;
|
||||
typedef typename module3d::Constraint3D Constraint3D;
|
||||
typedef boost::shared_ptr<Constraint3D> Cons;
|
||||
typedef std::shared_ptr<Constraint3D> Cons;
|
||||
typedef typename module3d::math_prop math_prop;
|
||||
typedef typename module3d::fix_prop fix_prop;
|
||||
typedef typename module3d::vertex_prop vertex_prop;
|
||||
@@ -76,17 +76,17 @@ struct SystemSolver : public Job<Sys> {
|
||||
#endif
|
||||
struct Rescaler {
|
||||
|
||||
boost::shared_ptr<Cluster> cluster;
|
||||
std::shared_ptr<Cluster> cluster;
|
||||
Mes& mes;
|
||||
int rescales;
|
||||
|
||||
Rescaler(boost::shared_ptr<Cluster> c, Mes& m);
|
||||
Rescaler(std::shared_ptr<Cluster> c, Mes& m);
|
||||
|
||||
void operator()();
|
||||
|
||||
Scalar calculateScale();
|
||||
Scalar scaleClusters(Scalar sc);
|
||||
void collectPseudoPoints(boost::shared_ptr<Cluster> parent,
|
||||
void collectPseudoPoints(std::shared_ptr<Cluster> parent,
|
||||
LocalVertex cluster,
|
||||
std::vector<typename Kernel::Vector3,
|
||||
Eigen::aligned_allocator<typename Kernel::Vector3> >& vec);
|
||||
@@ -111,8 +111,8 @@ struct SystemSolver : public Job<Sys> {
|
||||
|
||||
SystemSolver();
|
||||
virtual void execute(Sys& sys);
|
||||
void solveCluster(boost::shared_ptr<Cluster> cluster, Sys& sys);
|
||||
void finish(boost::shared_ptr< Cluster > cluster, Sys& sys, Mes& mes);
|
||||
void solveCluster(std::shared_ptr<Cluster> cluster, Sys& sys);
|
||||
void finish(std::shared_ptr< Cluster > cluster, Sys& sys, Mes& mes);
|
||||
};
|
||||
|
||||
}//details
|
||||
|
||||
@@ -48,7 +48,7 @@ template<typename System, typename iterator>
|
||||
struct parser_generator< typename details::getModule3D<System>::type::Geometry3D , System, iterator > {
|
||||
|
||||
typedef typename details::getModule3D<System>::type::Geometry3D Geometry;
|
||||
typedef karma::rule<iterator, boost::shared_ptr<Geometry>(), karma::locals<int> > generator;
|
||||
typedef karma::rule<iterator, std::shared_ptr<Geometry>(), karma::locals<int> > generator;
|
||||
static void init(generator& r);
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ struct parser_generator< typename details::getModule3D<System>::type::Constraint
|
||||
typedef typename details::getModule3D<System>::type::Constraint3D Constraint3D;
|
||||
typedef typename details::getModule3D<System>::type::vertex_prop vertex_prop;
|
||||
typedef typename details::getModule3D<System>::type::edge_prop edge_prop;
|
||||
typedef karma::rule<iterator, boost::shared_ptr<Constraint3D>()> generator;
|
||||
typedef karma::rule<iterator, std::shared_ptr<Constraint3D>()> generator;
|
||||
static void init(generator& r);
|
||||
};
|
||||
|
||||
@@ -124,7 +124,7 @@ struct parser_parser< typename details::getModule3D<System>::type::Geometry3D, S
|
||||
typedef typename details::getModule3D<System>::type::Geometry3D object_type;
|
||||
typedef typename System::Kernel Kernel;
|
||||
|
||||
typedef qi::rule<iterator, boost::shared_ptr<object_type>(System*), qi::space_type, qi::locals<std::string, typename Kernel::Vector, int> > parser;
|
||||
typedef qi::rule<iterator, std::shared_ptr<object_type>(System*), qi::space_type, qi::locals<std::string, typename Kernel::Vector, int> > parser;
|
||||
static void init(parser& r);
|
||||
};
|
||||
|
||||
@@ -161,7 +161,7 @@ struct parser_parser< typename details::getModule3D<System>::type::Constraint3D,
|
||||
typedef typename details::getModule3D<System>::type::Constraint3D Constraint3D;
|
||||
typedef typename System::Kernel Kernel;
|
||||
|
||||
typedef qi::rule<iterator, boost::shared_ptr<Constraint3D>(System*), qi::space_type > parser;
|
||||
typedef qi::rule<iterator, std::shared_ptr<Constraint3D>(System*), qi::space_type > parser;
|
||||
static void init(parser& r);
|
||||
};
|
||||
|
||||
|
||||
@@ -47,12 +47,12 @@ struct ModulePart {
|
||||
struct Part;
|
||||
struct PrepareCluster;
|
||||
struct EvaljuateCluster;
|
||||
typedef boost::shared_ptr<Part> Partptr;
|
||||
typedef std::shared_ptr<Part> Partptr;
|
||||
typedef mpl::map2< mpl::pair<remove, boost::function<void (Partptr) > >,
|
||||
mpl::pair<recalculated, boost::function<void (Partptr) > > > PartSignal;
|
||||
|
||||
typedef ID Identifier;
|
||||
typedef mpl::map1<mpl::pair<recalculated, boost::function<void (boost::shared_ptr<Sys>)> > > signals;
|
||||
typedef mpl::map1<mpl::pair<recalculated, boost::function<void (std::shared_ptr<Sys>)> > > signals;
|
||||
|
||||
class Part_base : public Object<Sys, Part, PartSignal > {
|
||||
protected:
|
||||
@@ -67,7 +67,7 @@ struct ModulePart {
|
||||
|
||||
//define what we need
|
||||
typedef typename module3d::Geometry3D Geometry3D;
|
||||
typedef boost::shared_ptr<Geometry3D> Geom;
|
||||
typedef std::shared_ptr<Geometry3D> Geom;
|
||||
|
||||
typedef typename boost::make_variant_over< Typelist >::type Variant;
|
||||
typedef Object<Sys, Part, PartSignal> base;
|
||||
@@ -101,13 +101,13 @@ struct ModulePart {
|
||||
};
|
||||
|
||||
//collect all clustergraph upstream cluster transforms
|
||||
void transform_traverse(Transform& t, boost::shared_ptr<Cluster> c);
|
||||
void transform_traverse(Transform& t, std::shared_ptr<Cluster> c);
|
||||
|
||||
public:
|
||||
using Object<Sys, Part, PartSignal >::m_system;
|
||||
|
||||
template<typename T>
|
||||
Part_base(const T& geometry, Sys& system, boost::shared_ptr<Cluster> cluster);
|
||||
Part_base(const T& geometry, Sys& system, std::shared_ptr<Cluster> cluster);
|
||||
|
||||
template<typename Visitor>
|
||||
typename Visitor::result_type apply(Visitor& vis);
|
||||
@@ -124,12 +124,12 @@ struct ModulePart {
|
||||
template<typename T>
|
||||
T getGlobal();
|
||||
|
||||
virtual boost::shared_ptr<Part> clone(Sys& newSys);
|
||||
virtual std::shared_ptr<Part> clone(Sys& newSys);
|
||||
|
||||
public:
|
||||
Variant m_geometry;
|
||||
Transform m_transform;
|
||||
boost::shared_ptr<Cluster> m_cluster;
|
||||
std::shared_ptr<Cluster> m_cluster;
|
||||
|
||||
void finishCalculation();
|
||||
void fix(bool fix_value);
|
||||
@@ -142,7 +142,7 @@ struct ModulePart {
|
||||
struct Part_id : public Part_base {
|
||||
|
||||
template<typename T>
|
||||
Part_id(const T& geometry, Sys& system, boost::shared_ptr<typename Part_base::Cluster> cluster);
|
||||
Part_id(const T& geometry, Sys& system, std::shared_ptr<typename Part_base::Cluster> cluster);
|
||||
|
||||
template<typename T>
|
||||
typename Part_base::Geom addGeometry3D(const T& geom, Identifier id, CoordinateFrame frame = Global);
|
||||
@@ -162,7 +162,7 @@ struct ModulePart {
|
||||
typedef typename mpl::if_<boost::is_same<Identifier, No_Identifier>, Part_base, Part_id>::type base;
|
||||
|
||||
template<typename T>
|
||||
Part(const T& geometry, Sys& system, boost::shared_ptr<typename base::Cluster> cluster);
|
||||
Part(const T& geometry, Sys& system, std::shared_ptr<typename base::Cluster> cluster);
|
||||
|
||||
friend struct PrepareCluster;
|
||||
friend struct EvaljuateCluster;
|
||||
@@ -209,7 +209,7 @@ struct ModulePart {
|
||||
};
|
||||
|
||||
//needed system functions
|
||||
void system_sub(boost::shared_ptr<Sys> subsys) {};
|
||||
void system_sub(std::shared_ptr<Sys> subsys) {};
|
||||
|
||||
protected:
|
||||
Sys* m_this;
|
||||
@@ -219,9 +219,9 @@ struct ModulePart {
|
||||
typedef typename Sys::Cluster Cluster;
|
||||
typedef typename system_traits<Sys>::template getModule<details::m3d>::type module3d;
|
||||
typedef typename module3d::Geometry3D Geometry3D;
|
||||
typedef boost::shared_ptr<Geometry3D> Geom;
|
||||
typedef std::shared_ptr<Geometry3D> Geom;
|
||||
typedef typename module3d::Constraint3D Constraint3D;
|
||||
typedef boost::shared_ptr<Constraint3D> Cons;
|
||||
typedef std::shared_ptr<Constraint3D> Cons;
|
||||
|
||||
Sys& system;
|
||||
remover(Sys& s);
|
||||
@@ -229,7 +229,7 @@ struct ModulePart {
|
||||
void operator()(GlobalVertex v);
|
||||
//we delete all global edges connecting to this part
|
||||
void operator()(GlobalEdge e);
|
||||
void operator()(boost::shared_ptr<Cluster> g) {};
|
||||
void operator()(std::shared_ptr<Cluster> g) {};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -283,7 +283,7 @@ struct ModulePart {
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename T>
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part_base::Part_base(const T& geometry, Sys& system, boost::shared_ptr<Cluster> cluster)
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part_base::Part_base(const T& geometry, Sys& system, std::shared_ptr<Cluster> cluster)
|
||||
: Object<Sys, Part, PartSignal>(system), m_geometry(geometry), m_cluster(cluster) {
|
||||
|
||||
#ifdef USE_LOGGING
|
||||
@@ -336,7 +336,7 @@ ModulePart<Typelist, ID>::type<Sys>::Part_base::addGeometry3D(const T& geom, Coo
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
void ModulePart<Typelist, ID>::type<Sys>::Part_base::transform_traverse(typename ModulePart<Typelist, ID>::template type<Sys>::Part_base::Transform& t,
|
||||
boost::shared_ptr<typename ModulePart<Typelist, ID>::template type<Sys>::Part_base::Cluster> c) {
|
||||
std::shared_ptr<typename ModulePart<Typelist, ID>::template type<Sys>::Part_base::Cluster> c) {
|
||||
|
||||
t *= c->template getProperty<typename Part_base::module3d::math_prop>().m_transform;
|
||||
|
||||
@@ -386,19 +386,19 @@ T ModulePart<Typelist, ID>::type<Sys>::Part_base::getGlobal() {
|
||||
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
boost::shared_ptr<typename ModulePart<Typelist, ID>::template type<Sys>::Part>
|
||||
std::shared_ptr<typename ModulePart<Typelist, ID>::template type<Sys>::Part>
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part_base::clone(Sys& newSys) {
|
||||
|
||||
//we need to reset the cluster pointer to the new system cluster
|
||||
LocalVertex lv = Object<Sys, Part, PartSignal>::m_system->m_cluster->getClusterVertex(m_cluster);
|
||||
GlobalVertex gv = Object<Sys, Part, PartSignal>::m_system->m_cluster->getGlobalVertex(lv);
|
||||
|
||||
boost::shared_ptr<Part> np = Object<Sys, Part, PartSignal>::clone(newSys);
|
||||
std::shared_ptr<Part> np = Object<Sys, Part, PartSignal>::clone(newSys);
|
||||
//there may be pointer inside the variant
|
||||
cloner clone_fnc(np->m_geometry);
|
||||
boost::apply_visitor(clone_fnc, m_geometry);
|
||||
|
||||
fusion::vector<LocalVertex, boost::shared_ptr<Cluster>, bool> res = newSys.m_cluster->getLocalVertexGraph(gv);
|
||||
fusion::vector<LocalVertex, std::shared_ptr<Cluster>, bool> res = newSys.m_cluster->getLocalVertexGraph(gv);
|
||||
|
||||
if(!fusion::at_c<2>(res)) {
|
||||
//todo: throw
|
||||
@@ -435,7 +435,7 @@ void ModulePart<Typelist, ID>::type<Sys>::Part_base::fix(bool fix_value) {
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename T>
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part_id::Part_id(const T& geometry, Sys& system, boost::shared_ptr<typename Part_base::Cluster> cluster)
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part_id::Part_id(const T& geometry, Sys& system, std::shared_ptr<typename Part_base::Cluster> cluster)
|
||||
: Part_base(geometry, system, cluster) {
|
||||
|
||||
};
|
||||
@@ -495,7 +495,7 @@ void ModulePart<Typelist, ID>::type<Sys>::Part_id::setIdentifier(Identifier id)
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename T>
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part::Part(const T& geometry, Sys& system, boost::shared_ptr<typename base::Cluster> cluster)
|
||||
ModulePart<Typelist, ID>::type<Sys>::Part::Part(const T& geometry, Sys& system, std::shared_ptr<typename base::Cluster> cluster)
|
||||
: mpl::if_<boost::is_same<Identifier, No_Identifier>,
|
||||
Part_base, Part_id>::type(geometry, system, cluster) {
|
||||
|
||||
@@ -514,7 +514,7 @@ typename ModulePart<Typelist, ID>::template type<Sys>::Partptr
|
||||
ModulePart<Typelist, ID>::type<Sys>::inheriter_base::createPart(const T& geometry) {
|
||||
|
||||
typedef typename Sys::Cluster Cluster;
|
||||
std::pair<boost::shared_ptr<Cluster>, LocalVertex> res = m_this->m_cluster->createCluster();
|
||||
std::pair<std::shared_ptr<Cluster>, LocalVertex> res = m_this->m_cluster->createCluster();
|
||||
Partptr p(new Part(geometry, * ((Sys*) this), res.first));
|
||||
|
||||
m_this->m_cluster->template setObject<Part> (res.second, p);
|
||||
@@ -642,7 +642,7 @@ void ModulePart<Typelist, ID>::type<Sys>::EvaljuateCluster::execute(Sys& sys) {
|
||||
};
|
||||
|
||||
//get all subsystems and report their recalculation
|
||||
typedef typename std::vector<boost::shared_ptr<Sys> >::iterator siter;
|
||||
typedef typename std::vector<std::shared_ptr<Sys> >::iterator siter;
|
||||
|
||||
for(siter it = sys.beginSubsystems(); it != sys.endSubsystems(); it++) {
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ struct ShapeGeneratorBase {
|
||||
typedef typename moduleShape3d::shape_constraint_prop shape_constraint_prop;
|
||||
|
||||
Sys* m_system;
|
||||
boost::shared_ptr<Shape3D> m_shape;
|
||||
std::shared_ptr<Shape3D> m_shape;
|
||||
GeometryVector* m_geometries;
|
||||
ShapeVector* m_shapes;
|
||||
ConstraintVector* m_constraints;
|
||||
@@ -62,7 +62,7 @@ struct ShapeGeneratorBase {
|
||||
ShapeGeneratorBase(Sys* system) : m_system(system) {};
|
||||
virtual ~ShapeGeneratorBase() {};
|
||||
|
||||
void set(boost::shared_ptr<Shape3D> shape,
|
||||
void set(std::shared_ptr<Shape3D> shape,
|
||||
GeometryVector* geometries,
|
||||
ShapeVector* shapes,
|
||||
ConstraintVector* constraints) {
|
||||
@@ -78,18 +78,18 @@ struct ShapeGeneratorBase {
|
||||
//initialise all relations between the geometries
|
||||
virtual void init() = 0;
|
||||
//get geometry3d for optional types (e.g. midpoints)
|
||||
virtual boost::shared_ptr<Geometry3D> getOrCreateG3d(int type) = 0;
|
||||
virtual std::shared_ptr<Geometry3D> getOrCreateG3d(int type) = 0;
|
||||
//get hlgeometry3d for optional types
|
||||
virtual boost::shared_ptr<Shape3D> getOrCreateHLG3d(int type) = 0;
|
||||
virtual std::shared_ptr<Shape3D> getOrCreateHLG3d(int type) = 0;
|
||||
|
||||
//append needs to be on this base class as the shape appends are protected
|
||||
void append(boost::shared_ptr<Geometry3D> g) {
|
||||
void append(std::shared_ptr<Geometry3D> g) {
|
||||
m_shape->append(g);
|
||||
};
|
||||
void append(boost::shared_ptr<Shape3D> g) {
|
||||
void append(std::shared_ptr<Shape3D> g) {
|
||||
m_shape->append(g);
|
||||
};
|
||||
void append(boost::shared_ptr<Constraint3D> g) {
|
||||
void append(std::shared_ptr<Constraint3D> g) {
|
||||
m_shape->append(g);
|
||||
};
|
||||
};
|
||||
@@ -113,11 +113,11 @@ struct dummy_generator {
|
||||
throw creation_error() << boost::errinfo_errno(211) << error_message("dummy generator can't create high level geometry");
|
||||
};
|
||||
//get geometry3d for optional types (e.g. midpoints)
|
||||
virtual boost::shared_ptr<typename details::ShapeGeneratorBase<Sys>::Geometry3D> getOrCreateG3d(int type) {
|
||||
virtual std::shared_ptr<typename details::ShapeGeneratorBase<Sys>::Geometry3D> getOrCreateG3d(int type) {
|
||||
throw creation_error() << boost::errinfo_errno(212) << error_message("dummy generator has no geometry to access");
|
||||
};
|
||||
//get hlgeometry3d for optional types
|
||||
virtual boost::shared_ptr<typename details::ShapeGeneratorBase<Sys>::Shape3D> getOrCreateHLG3d(int type) {
|
||||
virtual std::shared_ptr<typename details::ShapeGeneratorBase<Sys>::Shape3D> getOrCreateHLG3d(int type) {
|
||||
throw creation_error() << boost::errinfo_errno(213) << error_message("dummy generator has no high level geometry to access");
|
||||
};
|
||||
};
|
||||
@@ -156,17 +156,17 @@ struct segment3D {
|
||||
if(base::m_shape->getGeometryType() == dcm::tag::weight::segment::value) {
|
||||
|
||||
//link the line geometrie to our shape
|
||||
boost::shared_ptr<Geometry3D> g1 = base::m_system->createGeometry3D();
|
||||
std::shared_ptr<Geometry3D> g1 = base::m_system->createGeometry3D();
|
||||
base::append(g1);
|
||||
g1->template linkTo<tag::segment3D>(base::m_shape,0);
|
||||
g1->template setProperty<typename base::shape_purpose_prop>(line);
|
||||
g1->template connectSignal<recalculated>(boost::bind(&base::Shape3D::recalc, base::m_shape, bp::_1));
|
||||
|
||||
//we have a segment, lets link the two points to it
|
||||
boost::shared_ptr<Geometry3D> g2 = base::m_system->createGeometry3D();
|
||||
std::shared_ptr<Geometry3D> g2 = base::m_system->createGeometry3D();
|
||||
base::append(g2);
|
||||
g2->template setProperty<typename base::shape_purpose_prop>(startpoint);
|
||||
boost::shared_ptr<Geometry3D> g3 = base::m_system->createGeometry3D();
|
||||
std::shared_ptr<Geometry3D> g3 = base::m_system->createGeometry3D();
|
||||
base::append(g3);
|
||||
g3->template setProperty<typename base::shape_purpose_prop>(endpoint);
|
||||
|
||||
@@ -175,8 +175,8 @@ struct segment3D {
|
||||
g3->template linkTo<tag::point3D>(base::m_shape, 3);
|
||||
|
||||
//add the fix constraints
|
||||
boost::shared_ptr<Constraint3D> c1 = base::m_system->createConstraint3D(g1,g2, details::fixed);
|
||||
boost::shared_ptr<Constraint3D> c2 = base::m_system->createConstraint3D(g1,g3, details::fixed);
|
||||
std::shared_ptr<Constraint3D> c1 = base::m_system->createConstraint3D(g1,g2, details::fixed);
|
||||
std::shared_ptr<Constraint3D> c2 = base::m_system->createConstraint3D(g1,g3, details::fixed);
|
||||
c1->disable(); //required by fixed constraint
|
||||
base::append(c1);
|
||||
c2->disable(); //requiered by fixed constraint
|
||||
@@ -184,8 +184,8 @@ struct segment3D {
|
||||
}
|
||||
else if(base::m_geometries->size() == 2) {
|
||||
//we have two points, lets get them
|
||||
boost::shared_ptr<Geometry3D> g1 = fusion::at_c<0>(base::m_geometries->operator[](0));
|
||||
boost::shared_ptr<Geometry3D> g2 = fusion::at_c<0>(base::m_geometries->operator[](1));
|
||||
std::shared_ptr<Geometry3D> g1 = fusion::at_c<0>(base::m_geometries->operator[](0));
|
||||
std::shared_ptr<Geometry3D> g2 = fusion::at_c<0>(base::m_geometries->operator[](1));
|
||||
|
||||
//possibility 1: two points. we add a segment line an link the point in
|
||||
if(g1->getGeometryType() == tag::weight::point::value || g2->getGeometryType() == tag::weight::point::value) {
|
||||
@@ -202,7 +202,7 @@ struct segment3D {
|
||||
base::m_shape->template setValue<tag::segment3D>(val);
|
||||
|
||||
//and create a segment geometry we use as line
|
||||
boost::shared_ptr<Geometry3D> g3 = base::m_system->createGeometry3D();
|
||||
std::shared_ptr<Geometry3D> g3 = base::m_system->createGeometry3D();
|
||||
base::append(g3);
|
||||
g3->template linkTo<tag::segment3D>(base::m_shape,0);
|
||||
g3->template setProperty<typename base::shape_purpose_prop>(line);
|
||||
@@ -213,8 +213,8 @@ struct segment3D {
|
||||
g2->template linkTo<tag::point3D>(base::m_shape, 3);
|
||||
|
||||
//add the fix constraints to show our relation
|
||||
boost::shared_ptr<Constraint3D> c1 = base::m_system->createConstraint3D(g1,g3, details::fixed);
|
||||
boost::shared_ptr<Constraint3D> c2 = base::m_system->createConstraint3D(g1,g3, details::fixed);
|
||||
std::shared_ptr<Constraint3D> c1 = base::m_system->createConstraint3D(g1,g3, details::fixed);
|
||||
std::shared_ptr<Constraint3D> c2 = base::m_system->createConstraint3D(g1,g3, details::fixed);
|
||||
c1->disable(); //required by fixed constraint
|
||||
base::append(c1);
|
||||
c2->disable(); //requiered by fixed constraint
|
||||
@@ -226,12 +226,12 @@ struct segment3D {
|
||||
};
|
||||
};
|
||||
//get geometry3d for optional types (e.g. midpoints)
|
||||
virtual boost::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Geometry3D> getOrCreateG3d(int type) {
|
||||
return boost::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Geometry3D>();
|
||||
virtual std::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Geometry3D> getOrCreateG3d(int type) {
|
||||
return std::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Geometry3D>();
|
||||
};
|
||||
//get hlgeometry3d for optional types
|
||||
virtual boost::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Shape3D> getOrCreateHLG3d(int type) {
|
||||
return boost::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Shape3D>();
|
||||
virtual std::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Shape3D> getOrCreateHLG3d(int type) {
|
||||
return std::shared_ptr<typename dcm::details::ShapeGeneratorBase<Sys>::Shape3D>();
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
typename Generator \
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(n, typename Arg) \
|
||||
> \
|
||||
boost::shared_ptr<Shape3D> createShape3D( \
|
||||
std::shared_ptr<Shape3D> createShape3D( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(n, Arg, const& arg) \
|
||||
);
|
||||
|
||||
@@ -76,16 +76,16 @@
|
||||
typename Generator \
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(n, typename Arg)\
|
||||
> \
|
||||
boost::shared_ptr<typename ModuleShape3D<TypeList, ID>::template type<Sys>::Shape3D> \
|
||||
std::shared_ptr<typename ModuleShape3D<TypeList, ID>::template type<Sys>::Shape3D> \
|
||||
ModuleShape3D<TypeList, ID>::type<Sys>::inheriter_base::createShape3D( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(n, Arg, const& arg) \
|
||||
) \
|
||||
{ \
|
||||
typedef typename system_traits<Sys>::template getModule<details::m3d>::type module3d; \
|
||||
typedef typename module3d::Geometry3D Geometry3D; \
|
||||
boost::shared_ptr<Geometry3D> g_ptr; \
|
||||
boost::shared_ptr<Shape3D> hlg_ptr; \
|
||||
boost::shared_ptr<Shape3D> ptr = boost::shared_ptr<Shape3D>(new Shape3D(*m_this)); \
|
||||
std::shared_ptr<Geometry3D> g_ptr; \
|
||||
std::shared_ptr<Shape3D> hlg_ptr; \
|
||||
std::shared_ptr<Shape3D> ptr = std::shared_ptr<Shape3D>(new Shape3D(*m_this)); \
|
||||
BOOST_PP_REPEAT(n, APPEND_SINGLE, ptr) \
|
||||
ptr->template initShape<Generator>();\
|
||||
m_this->push_back(ptr);\
|
||||
@@ -108,7 +108,7 @@ struct converter_g {
|
||||
mpl::and_<
|
||||
mpl::not_< boost::is_same<typename mpl::find<gtypes, T>::type,typename mpl::end<gtypes>::type> >,
|
||||
mpl::not_<boost::is_same<Identifier, T> >
|
||||
>, boost::shared_ptr<R> >::type apply(T const& t, Sys* sys) {
|
||||
>, std::shared_ptr<R> >::type apply(T const& t, Sys* sys) {
|
||||
return sys->createGeometry3D(t);
|
||||
};
|
||||
|
||||
@@ -118,22 +118,22 @@ struct converter_g {
|
||||
mpl::and_<
|
||||
boost::is_same<typename mpl::find<gtypes, T>::type, typename mpl::end<gtypes>::type>,
|
||||
mpl::not_<boost::is_same<Identifier, T> >
|
||||
>, boost::shared_ptr<R> >::type apply(T const& t, Sys* sys) {
|
||||
return boost::shared_ptr<R>();
|
||||
>, std::shared_ptr<R> >::type apply(T const& t, Sys* sys) {
|
||||
return std::shared_ptr<R>();
|
||||
};
|
||||
|
||||
//seems to be an identifier type, lets check if we have such a geometry
|
||||
template<typename gtypes, typename Sys, typename Identifier>
|
||||
static typename boost::enable_if<
|
||||
boost::is_same<Identifier, T>, boost::shared_ptr<R> >::type apply(T const& t, Sys* sys) {
|
||||
boost::is_same<Identifier, T>, std::shared_ptr<R> >::type apply(T const& t, Sys* sys) {
|
||||
return sys->getGeometry3D(t);
|
||||
};
|
||||
};
|
||||
|
||||
template<typename R>
|
||||
struct converter_g< boost::shared_ptr<R>, R> {
|
||||
struct converter_g< std::shared_ptr<R>, R> {
|
||||
template<typename gtypes, typename Sys, typename Identifier>
|
||||
static boost::shared_ptr<R> apply(boost::shared_ptr<R> t, Sys* sys) {
|
||||
static std::shared_ptr<R> apply(std::shared_ptr<R> t, Sys* sys) {
|
||||
return t;
|
||||
};
|
||||
};
|
||||
@@ -146,14 +146,14 @@ struct converter_hlg {
|
||||
boost::is_same<typename mpl::find<gtypes, T>::type, typename mpl::end<gtypes>::type>,
|
||||
mpl::not_<boost::is_same<Identifier, T> >
|
||||
>,
|
||||
boost::shared_ptr<R> >::type apply(T const& t, boost::shared_ptr<R> self, Sys* sys) {
|
||||
return boost::shared_ptr<R>();
|
||||
std::shared_ptr<R> >::type apply(T const& t, std::shared_ptr<R> self, Sys* sys) {
|
||||
return std::shared_ptr<R>();
|
||||
};
|
||||
|
||||
template<typename gtypes, typename Sys, typename Identifier>
|
||||
static typename boost::enable_if<
|
||||
mpl::not_< boost::is_same<typename mpl::find<gtypes, T>::type, typename mpl::end<gtypes>::type> >,
|
||||
boost::shared_ptr<R> >::type apply(T const& t, boost::shared_ptr<R> self, Sys* sys) {
|
||||
std::shared_ptr<R> >::type apply(T const& t, std::shared_ptr<R> self, Sys* sys) {
|
||||
|
||||
//shape can only be set one time, throw an error otherwise
|
||||
if(self->holdsType())
|
||||
@@ -166,15 +166,15 @@ struct converter_hlg {
|
||||
//seems to be an identifier type, lets check if we have such a geometry
|
||||
template<typename gtypes, typename Sys, typename Identifier>
|
||||
static typename boost::enable_if<
|
||||
boost::is_same<Identifier, T>, boost::shared_ptr<R> >::type apply(T const& t, boost::shared_ptr<R> self, Sys* sys) {
|
||||
boost::is_same<Identifier, T>, std::shared_ptr<R> >::type apply(T const& t, std::shared_ptr<R> self, Sys* sys) {
|
||||
return sys->getShape3D(t);
|
||||
};
|
||||
};
|
||||
|
||||
template<typename R>
|
||||
struct converter_hlg<boost::shared_ptr<R>, R> {
|
||||
struct converter_hlg<std::shared_ptr<R>, R> {
|
||||
template<typename gtypes, typename Sys, typename Identifier>
|
||||
static boost::shared_ptr<R> apply(boost::shared_ptr<R> t, boost::shared_ptr<R> self, Sys* sys) {
|
||||
static std::shared_ptr<R> apply(std::shared_ptr<R> t, std::shared_ptr<R> self, Sys* sys) {
|
||||
return t;
|
||||
};
|
||||
};
|
||||
@@ -194,8 +194,8 @@ struct ModuleShape3D {
|
||||
struct Shape3D;
|
||||
|
||||
typedef mpl::map2<
|
||||
mpl::pair<remove, boost::function<void (boost::shared_ptr<Shape3D>) > >,
|
||||
mpl::pair<remove, boost::function<void (boost::shared_ptr<Shape3D>) > > > ShapeSig;
|
||||
mpl::pair<remove, boost::function<void (std::shared_ptr<Shape3D>) > >,
|
||||
mpl::pair<remove, boost::function<void (std::shared_ptr<Shape3D>) > > > ShapeSig;
|
||||
|
||||
template<typename Derived>
|
||||
struct Shape3D_base : public details::Geometry<typename Sys::Kernel, 3, typename Sys::geometries>, public Object<Sys, Derived, ShapeSig > {
|
||||
@@ -237,29 +237,29 @@ struct ModuleShape3D {
|
||||
return t;
|
||||
};
|
||||
|
||||
virtual boost::shared_ptr<Derived> clone(Sys& newSys);
|
||||
virtual std::shared_ptr<Derived> clone(Sys& newSys);
|
||||
|
||||
/*shape access functions and extractors to mimic vector<> iterators*/
|
||||
typedef std::vector<fusion::vector<boost::shared_ptr<Geometry3D>, Connection> > GeometryVector;
|
||||
typedef std::vector<fusion::vector<boost::shared_ptr<Derived>, Connection> > ShapeVector;
|
||||
typedef std::vector<fusion::vector<boost::shared_ptr<Constraint3D>, Connection> > ConstraintVector;
|
||||
typedef std::vector<fusion::vector<std::shared_ptr<Geometry3D>, Connection> > GeometryVector;
|
||||
typedef std::vector<fusion::vector<std::shared_ptr<Derived>, Connection> > ShapeVector;
|
||||
typedef std::vector<fusion::vector<std::shared_ptr<Constraint3D>, Connection> > ConstraintVector;
|
||||
|
||||
struct geom_extractor {
|
||||
typedef boost::shared_ptr<Geometry3D> result_type;
|
||||
typedef std::shared_ptr<Geometry3D> result_type;
|
||||
template<typename T>
|
||||
result_type operator()(T& pair) const {
|
||||
return fusion::at_c<0>(pair);
|
||||
};
|
||||
};
|
||||
struct shape_extractor {
|
||||
typedef boost::shared_ptr<Shape3D> result_type;
|
||||
typedef std::shared_ptr<Shape3D> result_type;
|
||||
template<typename T>
|
||||
result_type operator()(T& pair) const {
|
||||
return fusion::at_c<0>(pair);
|
||||
};
|
||||
};
|
||||
struct cons_extractor {
|
||||
typedef boost::shared_ptr<Constraint3D> result_type;
|
||||
typedef std::shared_ptr<Constraint3D> result_type;
|
||||
template<typename T>
|
||||
result_type operator()(T& pair) const {
|
||||
return fusion::at_c<0>(pair);
|
||||
@@ -288,15 +288,15 @@ struct ModuleShape3D {
|
||||
return boost::make_transform_iterator(m_constraints.end(), cons_extractor());
|
||||
};
|
||||
|
||||
boost::shared_ptr<Geometry3D> geometry(purpose f);
|
||||
std::shared_ptr<Geometry3D> geometry(purpose f);
|
||||
template<typename T>
|
||||
boost::shared_ptr<Shape3D> subshape();
|
||||
std::shared_ptr<Shape3D> subshape();
|
||||
|
||||
//callbacks
|
||||
void recalc(boost::shared_ptr<Geometry3D> g);
|
||||
void remove(boost::shared_ptr<Geometry3D> g);
|
||||
void remove(boost::shared_ptr<Derived> g);
|
||||
void remove(boost::shared_ptr<Constraint3D> g);
|
||||
void recalc(std::shared_ptr<Geometry3D> g);
|
||||
void remove(std::shared_ptr<Geometry3D> g);
|
||||
void remove(std::shared_ptr<Derived> g);
|
||||
void remove(std::shared_ptr<Constraint3D> g);
|
||||
|
||||
private:
|
||||
|
||||
@@ -342,13 +342,13 @@ struct ModuleShape3D {
|
||||
};
|
||||
|
||||
Variant m_geometry; //Variant holding the real geometry type
|
||||
boost::shared_ptr< details::ShapeGeneratorBase<Sys> > m_generator;
|
||||
std::shared_ptr< details::ShapeGeneratorBase<Sys> > m_generator;
|
||||
|
||||
using Object<Sys, Derived, ShapeSig>::m_system;
|
||||
|
||||
template<typename generator>
|
||||
void initShape() {
|
||||
m_generator = boost::shared_ptr<details::ShapeGeneratorBase<Sys> >(new typename generator::template type<Sys>(m_system));
|
||||
m_generator = std::shared_ptr<details::ShapeGeneratorBase<Sys> >(new typename generator::template type<Sys>(m_system));
|
||||
m_generator->set(ObjBase::shared_from_this(), &m_geometries, &m_shapes, &m_constraints);
|
||||
|
||||
if(!m_generator->check())
|
||||
@@ -362,9 +362,9 @@ struct ModuleShape3D {
|
||||
|
||||
//the storage is private, all things need to be added by this methods.
|
||||
//this is used to ensure the proper event connections
|
||||
boost::shared_ptr<Derived> append(boost::shared_ptr<Geometry3D> g);
|
||||
boost::shared_ptr<Derived> append(boost::shared_ptr<Derived> g);
|
||||
boost::shared_ptr<Derived> append(boost::shared_ptr<Constraint3D> g);
|
||||
std::shared_ptr<Derived> append(std::shared_ptr<Geometry3D> g);
|
||||
std::shared_ptr<Derived> append(std::shared_ptr<Derived> g);
|
||||
std::shared_ptr<Derived> append(std::shared_ptr<Constraint3D> g);
|
||||
|
||||
//override protected event functions to emit signals
|
||||
void reset() {};
|
||||
@@ -428,7 +428,7 @@ struct ModuleShape3D {
|
||||
m_this = (Sys*)this;
|
||||
};
|
||||
|
||||
void system_sub(boost::shared_ptr<Sys> subsys) {};
|
||||
void system_sub(std::shared_ptr<Sys> subsys) {};
|
||||
|
||||
protected:
|
||||
Sys* m_this;
|
||||
@@ -437,7 +437,7 @@ struct ModuleShape3D {
|
||||
//with no vararg templates before c++11 we need preprocessor to create the overloads of create we need
|
||||
BOOST_PP_REPEAT(5, CREATE_DEF, ~)
|
||||
|
||||
void removeShape3D(boost::shared_ptr<Shape3D> g);
|
||||
void removeShape3D(std::shared_ptr<Shape3D> g);
|
||||
};
|
||||
|
||||
struct inheriter_id : public inheriter_base {
|
||||
@@ -446,7 +446,7 @@ struct ModuleShape3D {
|
||||
|
||||
void removeShape3D(ID id);
|
||||
bool hasShape3D(ID id);
|
||||
boost::shared_ptr<Shape3D> getShape3D(ID id);
|
||||
std::shared_ptr<Shape3D> getShape3D(ID id);
|
||||
|
||||
using inheriter_base::removeShape3D;
|
||||
|
||||
@@ -539,10 +539,10 @@ void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::set(const T&
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<Derived> ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::clone(Sys& newSys) {
|
||||
std::shared_ptr<Derived> ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::clone(Sys& newSys) {
|
||||
|
||||
//copy the standard stuff
|
||||
boost::shared_ptr<Derived> np = boost::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
std::shared_ptr<Derived> np = std::shared_ptr<Derived>(new Derived(*static_cast<Derived*>(this)));
|
||||
np->m_system = &newSys;
|
||||
//it's possible that the variant contains pointers, so we need to clone them
|
||||
cloner clone_fnc(np->m_geometry);
|
||||
@@ -553,7 +553,7 @@ boost::shared_ptr<Derived> ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<typename system_traits<Sys>::template getModule<details::m3d>::type::Geometry3D>
|
||||
std::shared_ptr<typename system_traits<Sys>::template getModule<details::m3d>::type::Geometry3D>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::geometry(purpose f) {
|
||||
|
||||
for(geometry3d_iterator it = beginGeometry3D(); it != endGeometry3D(); it++) {
|
||||
@@ -562,17 +562,17 @@ ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::geometry(purpose
|
||||
return *it;
|
||||
};
|
||||
|
||||
return boost::shared_ptr<Geometry3D>();
|
||||
return std::shared_ptr<Geometry3D>();
|
||||
};
|
||||
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<Derived>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::shared_ptr<Geometry3D> g) {
|
||||
std::shared_ptr<Derived>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(std::shared_ptr<Geometry3D> g) {
|
||||
|
||||
g->template setProperty<shape_geometry_prop>(true);
|
||||
Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Geometry3D>)>(&Shape3D_base::remove) , this, _1));
|
||||
Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(std::shared_ptr<Geometry3D>)>(&Shape3D_base::remove) , this, _1));
|
||||
m_geometries.push_back(fusion::make_vector(g,c));
|
||||
|
||||
return ObjBase::shared_from_this();
|
||||
@@ -582,10 +582,10 @@ ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::sha
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<Derived>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::shared_ptr<Derived> g) {
|
||||
std::shared_ptr<Derived>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(std::shared_ptr<Derived> g) {
|
||||
|
||||
Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Derived>)>(&Shape3D_base::remove) , this, _1));
|
||||
Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(std::shared_ptr<Derived>)>(&Shape3D_base::remove) , this, _1));
|
||||
m_shapes.push_back(fusion::make_vector(g,c));
|
||||
|
||||
return ObjBase::shared_from_this();
|
||||
@@ -594,10 +594,10 @@ ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::sha
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
boost::shared_ptr<Derived>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(boost::shared_ptr<Constraint3D> g) {
|
||||
std::shared_ptr<Derived>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::append(std::shared_ptr<Constraint3D> g) {
|
||||
|
||||
Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(boost::shared_ptr<Constraint3D>)>(&Shape3D_base::remove) , this, _1));
|
||||
Connection c = g->template connectSignal<dcm::remove>(boost::bind(static_cast<void (Shape3D_base::*)(std::shared_ptr<Constraint3D>)>(&Shape3D_base::remove) , this, _1));
|
||||
m_constraints.push_back(fusion::make_vector(g,c));
|
||||
|
||||
return ObjBase::shared_from_this();
|
||||
@@ -626,7 +626,7 @@ void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::disconnectAl
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::recalc(boost::shared_ptr<Geometry3D> g) {
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::recalc(std::shared_ptr<Geometry3D> g) {
|
||||
|
||||
//we recalculated thebase line, that means we have our new value. use it.
|
||||
Base::finishCalculation();
|
||||
@@ -635,7 +635,7 @@ void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::recalc(boost
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(boost::shared_ptr<Geometry3D> g) {
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(std::shared_ptr<Geometry3D> g) {
|
||||
|
||||
//before we delete this shape by calling the system remove function, we need to remove
|
||||
//this geometry as this would be deleted again by the system call and we would go into infinite recursion
|
||||
@@ -656,7 +656,7 @@ void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(boost
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(boost::shared_ptr<Derived> g) {
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(std::shared_ptr<Derived> g) {
|
||||
|
||||
//before we delete this shape by calling the system remove function, we need to remove
|
||||
//this geometry as this would be deleted again by the system call and we would go into infinite recursion
|
||||
@@ -677,7 +677,7 @@ void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(boost
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
template<typename Derived>
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(boost::shared_ptr<Constraint3D> g) {
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D_base<Derived>::remove(std::shared_ptr<Constraint3D> g) {
|
||||
|
||||
//before we delete this shape by calling the system remove function, we need to remove
|
||||
//this geometry as this would be deleted again by the system call and we would go into infinite recursion
|
||||
@@ -785,7 +785,7 @@ ModuleShape3D<Typelist, ID>::type<Sys>::Shape3D::Shape3D(const T& geometry, Sys&
|
||||
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::inheriter_base::removeShape3D(boost::shared_ptr<Shape3D> g) {
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::inheriter_base::removeShape3D(std::shared_ptr<Shape3D> g) {
|
||||
|
||||
//disconnect all shapes, geometries and constraints, as otherwise we would go into infinite
|
||||
//recursion
|
||||
@@ -822,24 +822,24 @@ bool ModuleShape3D<Typelist, ID>::type<Sys>::inheriter_id::hasShape3D(Identifier
|
||||
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
boost::shared_ptr<typename ModuleShape3D<Typelist, ID>::template type<Sys>::Shape3D>
|
||||
std::shared_ptr<typename ModuleShape3D<Typelist, ID>::template type<Sys>::Shape3D>
|
||||
ModuleShape3D<Typelist, ID>::type<Sys>::inheriter_id::getShape3D(Identifier id) {
|
||||
std::vector< boost::shared_ptr<Shape3D> >& vec = inheriter_base::m_this->template objectVector<Shape3D>();
|
||||
typedef typename std::vector< boost::shared_ptr<Shape3D> >::iterator iter;
|
||||
std::vector< std::shared_ptr<Shape3D> >& vec = inheriter_base::m_this->template objectVector<Shape3D>();
|
||||
typedef typename std::vector< std::shared_ptr<Shape3D> >::iterator iter;
|
||||
|
||||
for(iter it=vec.begin(); it!=vec.end(); it++) {
|
||||
if(compare_traits<Identifier>::compare((*it)->getIdentifier(), id))
|
||||
return *it;
|
||||
};
|
||||
|
||||
return boost::shared_ptr<Shape3D>();
|
||||
return std::shared_ptr<Shape3D>();
|
||||
};
|
||||
|
||||
template<typename Typelist, typename ID>
|
||||
template<typename Sys>
|
||||
void ModuleShape3D<Typelist, ID>::type<Sys>::inheriter_id::removeShape3D(Identifier id) {
|
||||
|
||||
boost::shared_ptr<Shape3D> s = getShape3D(id);
|
||||
std::shared_ptr<Shape3D> s = getShape3D(id);
|
||||
|
||||
if(s)
|
||||
removeShape3D(s);
|
||||
|
||||
@@ -63,7 +63,7 @@ BOOST_FUSION_ADAPT_TPL_STRUCT(
|
||||
(dcm::System)(Kernel)(M1)(M2)(M3),
|
||||
(typename t1<Kernel>::template t2<M1>::template t3<M2>::template t4<M3>::type::OptionOwner::Properties, m_options->m_properties)
|
||||
(typename Kernel::Properties, m_kernel.m_properties)
|
||||
(boost::shared_ptr<typename t1<Kernel>::template t2<M1>::template t3<M2>::template t4<M3>::type::Cluster>, m_cluster)
|
||||
(std::shared_ptr<typename t1<Kernel>::template t2<M1>::template t3<M2>::template t4<M3>::type::Cluster>, m_cluster)
|
||||
)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,7 @@ struct Extractor {
|
||||
else
|
||||
l = 0;
|
||||
};
|
||||
void getClusterRange(typename Sys::Cluster& cluster, std::vector<std::pair<GlobalVertex, boost::shared_ptr<typename Sys::Cluster> > >& range) {
|
||||
void getClusterRange(typename Sys::Cluster& cluster, std::vector<std::pair<GlobalVertex, std::shared_ptr<typename Sys::Cluster> > >& range) {
|
||||
|
||||
typedef typename Sys::Cluster::const_cluster_iterator iter;
|
||||
|
||||
@@ -104,11 +104,11 @@ struct Injector {
|
||||
void setVertexProperty(typename Sys::Cluster* cluster, int value) {
|
||||
cluster->template setProperty<details::cluster_vertex_prop>(value);
|
||||
};
|
||||
void addClusters(std::vector<boost::shared_ptr<typename Sys::Cluster> >& clusters, typename Sys::Cluster* cluster) {
|
||||
void addClusters(std::vector<std::shared_ptr<typename Sys::Cluster> >& clusters, typename Sys::Cluster* cluster) {
|
||||
|
||||
//vertices for the cluster need to be added already (as edges need vertices created)
|
||||
//so we don't create a vertex here.
|
||||
typename std::vector<boost::shared_ptr<typename Sys::Cluster> >::iterator it;
|
||||
typename std::vector<std::shared_ptr<typename Sys::Cluster> >::iterator it;
|
||||
for(it = clusters.begin(); it != clusters.end(); it++) {
|
||||
LocalVertex v = cluster->getLocalVertex((*it)->template getProperty<details::cluster_vertex_prop>()).first;
|
||||
cluster->m_clusters[v] = *it;
|
||||
|
||||
@@ -64,7 +64,7 @@ struct generator : karma::grammar<Iterator, Sys&()> {
|
||||
|
||||
karma::rule<Iterator, Sys& ()> start;
|
||||
|
||||
karma::rule<Iterator, std::pair<GlobalVertex, boost::shared_ptr<graph> >()> cluster_pair;
|
||||
karma::rule<Iterator, std::pair<GlobalVertex, std::shared_ptr<graph> >()> cluster_pair;
|
||||
karma::rule<Iterator, graph&()> cluster;
|
||||
karma::rule<Iterator, Sys&()> system;
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace spirit {
|
||||
namespace traits
|
||||
{
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
struct transform_attribute<boost::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> > const, dcm::ClusterGraph<T1,T2,T3,T4>&, karma::domain>
|
||||
struct transform_attribute<std::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> > const, dcm::ClusterGraph<T1,T2,T3,T4>&, karma::domain>
|
||||
{
|
||||
typedef dcm::ClusterGraph<T1,T2,T3,T4>& type;
|
||||
static type pre(boost::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> > const& val) {
|
||||
static type pre(std::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> > const& val) {
|
||||
return *val;
|
||||
}
|
||||
};
|
||||
@@ -56,11 +56,11 @@ generator<Sys>::generator() : generator<Sys>::base_type(start) {
|
||||
<< karma::lit("</Cluster>");
|
||||
|
||||
cluster_pair %= karma::lit("<Cluster id=") << karma::int_ << ">#"
|
||||
<< qi::attr_cast<boost::shared_ptr<graph>, graph&>(cluster);
|
||||
<< qi::attr_cast<std::shared_ptr<graph>, graph&>(cluster);
|
||||
|
||||
system %= system_prop << karma::lit("<Kernel>#") << kernel_prop
|
||||
<< "$" << karma::eol << karma::lit("</Kernel>") << karma::eol
|
||||
<< karma::lit("<Cluster id=0>#") << qi::attr_cast<boost::shared_ptr<graph>, graph&>(cluster);
|
||||
<< karma::lit("<Cluster id=0>#") << qi::attr_cast<std::shared_ptr<graph>, graph&>(cluster);
|
||||
|
||||
start %= karma::lit("<openDCM>#") << karma::eol << system << "$" << karma::eol << karma::lit("</openDCM>");
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ obj_grammar<Sys, Object,Gen>::obj_grammar() : obj_grammar<Sys, Object,Gen>::base
|
||||
};
|
||||
|
||||
template<typename Sys, typename Object, typename Gen>
|
||||
void obj_grammar<Sys, Object,Gen>::getProperties(boost::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq) {
|
||||
void obj_grammar<Sys, Object,Gen>::getProperties(std::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq) {
|
||||
|
||||
if(ptr) seq = ptr->m_properties;
|
||||
else {
|
||||
|
||||
@@ -56,7 +56,7 @@ obj_parser<Sys, ObjList, Object, Par>::obj_parser(): obj_parser::base_type(start
|
||||
};
|
||||
|
||||
template<typename Sys, typename ObjList, typename Object, typename Par>
|
||||
void obj_parser<Sys, ObjList, Object, Par>::setProperties(boost::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq) {
|
||||
void obj_parser<Sys, ObjList, Object, Par>::setProperties(std::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq) {
|
||||
if(ptr) ptr->m_properties = seq;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace spirit {
|
||||
namespace traits
|
||||
{
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
struct transform_attribute<boost::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> >, typename dcm::ClusterGraph<T1,T2,T3,T4>::Properties, qi::domain>
|
||||
struct transform_attribute<std::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> >, typename dcm::ClusterGraph<T1,T2,T3,T4>::Properties, qi::domain>
|
||||
{
|
||||
typedef typename dcm::ClusterGraph<T1,T2,T3,T4>::Properties& type;
|
||||
static type pre(boost::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> >& val) {
|
||||
static type pre(std::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> >& val) {
|
||||
return val->m_properties;
|
||||
}
|
||||
static void post(boost::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> >const& val, typename dcm::ClusterGraph<T1,T2,T3,T4>::Properties const& attr) {}
|
||||
static void fail(boost::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> > const&) {}
|
||||
static void post(std::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> >const& val, typename dcm::ClusterGraph<T1,T2,T3,T4>::Properties const& attr) {}
|
||||
static void fail(std::shared_ptr<dcm::ClusterGraph<T1,T2,T3,T4> > const&) {}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -57,10 +57,10 @@ template<typename Sys>
|
||||
parser<Sys>::parser() : parser<Sys>::base_type(system) {
|
||||
|
||||
cluster %= qi::lit("<Cluster id=") >> qi::omit[qi::int_[qi::_a = qi::_1]] >> ">"
|
||||
>> -(qi::eps(qi::_a > 0)[qi::_val = phx::construct<boost::shared_ptr<graph> >(phx::new_<typename Sys::Cluster>())])
|
||||
>> -(qi::eps(qi::_a > 0)[qi::_val = phx::construct<std::shared_ptr<graph> >(phx::new_<typename Sys::Cluster>())])
|
||||
>> qi::eps[phx::bind(&Sys::Cluster::setCopyMode, &(*qi::_val), true)]
|
||||
>> qi::eps[phx::bind(&Injector<Sys>::setVertexProperty, &in, &(*qi::_val), qi::_a)]
|
||||
>> qi::attr_cast<boost::shared_ptr<graph>, typename graph::Properties>(cluster_prop >> qi::eps)
|
||||
>> qi::attr_cast<std::shared_ptr<graph>, typename graph::Properties>(cluster_prop >> qi::eps)
|
||||
>> qi::omit[(*cluster(qi::_r1))[qi::_b = qi::_1]]
|
||||
>> qi::omit[*vertex(&(*qi::_val), qi::_r1)]
|
||||
>> qi::omit[*edge(&(*qi::_val), qi::_r1)]
|
||||
|
||||
@@ -43,7 +43,7 @@ struct ModuleState {
|
||||
void saveState(std::ostream& stream);
|
||||
void loadState(std::istream& stream);
|
||||
|
||||
void system_sub(boost::shared_ptr<Sys> subsys) {};
|
||||
void system_sub(std::shared_ptr<Sys> subsys) {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace details {
|
||||
|
||||
//grammar for a single object
|
||||
template<typename Sys, typename Object, typename Gen>
|
||||
struct obj_grammar : public karma::grammar<Iterator, boost::shared_ptr<Object>()> {
|
||||
struct obj_grammar : public karma::grammar<Iterator, std::shared_ptr<Object>()> {
|
||||
typename Gen::generator subrule;
|
||||
karma::rule<Iterator, boost::shared_ptr<Object>()> start;
|
||||
karma::rule<Iterator, std::shared_ptr<Object>()> start;
|
||||
details::prop_gen<Sys, typename Object::PropertySequence > prop;
|
||||
|
||||
obj_grammar();
|
||||
static void getProperties(boost::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq);
|
||||
static void getProperties(std::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq);
|
||||
};
|
||||
|
||||
//when objects should not be generated we need to get a empy rule, as obj_rule_init
|
||||
|
||||
@@ -38,7 +38,7 @@ struct obj_parser : public qi::grammar<IIterator, qi::unused_type(typename detai
|
||||
|
||||
obj_parser();
|
||||
|
||||
static void setProperties(boost::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq);
|
||||
static void setProperties(std::shared_ptr<Object> ptr, typename details::pts<typename Object::PropertySequence>::type& seq);
|
||||
};
|
||||
|
||||
//when objects should not be generated we need to get a empy rule, as obj_rule_init
|
||||
|
||||
@@ -69,7 +69,7 @@ struct parser : qi::grammar<IIterator, Sys(), qi::space_type> {
|
||||
details::kernel_prop_par<Sys> kernel_prop;
|
||||
details::system_prop_par<Sys> system_prop;
|
||||
|
||||
qi::rule<IIterator, boost::shared_ptr<graph>(Sys*), qi::locals<int, std::vector<boost::shared_ptr<graph> > >, qi::space_type> cluster;
|
||||
qi::rule<IIterator, std::shared_ptr<graph>(Sys*), qi::locals<int, std::vector<std::shared_ptr<graph> > >, qi::space_type> cluster;
|
||||
details::cluster_prop_par<Sys> cluster_prop;
|
||||
|
||||
details::obj_par<Sys> objects;
|
||||
|
||||
@@ -402,7 +402,7 @@ void TaskAssemblyConstraints::setPossibleOptions() {
|
||||
// Assembly::Product* ass = p1->getParentAssembly();
|
||||
|
||||
// //extract the geometries to use for comparison
|
||||
// boost::shared_ptr<Geometry3D> g1 = ass->m_solver->getGeometry3D(obj->First.getSubValues()[0].c_str());
|
||||
// std::shared_ptr<Geometry3D> g1 = ass->m_solver->getGeometry3D(obj->First.getSubValues()[0].c_str());
|
||||
|
||||
// if(!g1)
|
||||
// return;
|
||||
@@ -414,7 +414,7 @@ void TaskAssemblyConstraints::setPossibleOptions() {
|
||||
// if(!p2)
|
||||
// return;
|
||||
|
||||
// boost::shared_ptr<Geometry3D> g2 = ass->m_solver->getGeometry3D(obj->Second.getSubValues()[0].c_str());
|
||||
// std::shared_ptr<Geometry3D> g2 = ass->m_solver->getGeometry3D(obj->Second.getSubValues()[0].c_str());
|
||||
|
||||
// if(!g2)
|
||||
// return;
|
||||
@@ -505,7 +505,7 @@ void TaskAssemblyConstraints::setPossibleConstraints()
|
||||
// Assembly::Product* ass = p1->getParentAssembly();
|
||||
|
||||
// //extract the geometries to use for comparison
|
||||
// boost::shared_ptr<Geometry3D> g1 = ass->m_solver->getGeometry3D(obj->First.getSubValues()[0].c_str());
|
||||
// std::shared_ptr<Geometry3D> g1 = ass->m_solver->getGeometry3D(obj->First.getSubValues()[0].c_str());
|
||||
|
||||
// //let's see if we have a part, if not give feedback to the user by color
|
||||
// if(!g1) {
|
||||
@@ -525,7 +525,7 @@ void TaskAssemblyConstraints::setPossibleConstraints()
|
||||
// if(!p2)
|
||||
// return;
|
||||
|
||||
// boost::shared_ptr<Geometry3D> g2 = ass->m_solver->getGeometry3D(obj->Second.getSubValues()[0].c_str());
|
||||
// std::shared_ptr<Geometry3D> g2 = ass->m_solver->getGeometry3D(obj->Second.getSubValues()[0].c_str());
|
||||
|
||||
// //let's see if we have a part, if not give feedback to the user by color
|
||||
// if(!g2) {
|
||||
@@ -616,7 +616,7 @@ void TaskAssemblyConstraints::setPossibleConstraints()
|
||||
//}
|
||||
}
|
||||
|
||||
bool TaskAssemblyConstraints::isCombination(boost::shared_ptr<Geometry3D> g1, boost::shared_ptr<Geometry3D> g2, dcm::geometry::types t1, dcm::geometry::types t2)
|
||||
bool TaskAssemblyConstraints::isCombination(std::shared_ptr<Geometry3D> g1, std::shared_ptr<Geometry3D> g2, dcm::geometry::types t1, dcm::geometry::types t2)
|
||||
{
|
||||
if(g1->getGeometryType() == t1 && g2->getGeometryType() == t2)
|
||||
return true;
|
||||
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
dcm::SolutionSpace getSolutionSpace();
|
||||
void setPossibleConstraints();
|
||||
void setPossibleOptions();
|
||||
bool isCombination(boost::shared_ptr<Geometry3D> g1, boost::shared_ptr<Geometry3D> g2, dcm::geometry::types t1, dcm::geometry::types t2);
|
||||
bool isCombination(std::shared_ptr<Geometry3D> g1, std::shared_ptr<Geometry3D> g2, dcm::geometry::types t1, dcm::geometry::types t2);
|
||||
};
|
||||
|
||||
} //namespace AssemblyGui
|
||||
|
||||
@@ -203,7 +203,7 @@ void ViewProviderPartRef::onChanged(const App::Property* prop) {
|
||||
m_switch->whichChild = 0;
|
||||
|
||||
int counter = 0;
|
||||
boost::shared_ptr<Part3D> part = static_cast<Assembly::PartRef*>(getObject())->m_part;
|
||||
std::shared_ptr<Part3D> part = static_cast<Assembly::PartRef*>(getObject())->m_part;
|
||||
|
||||
if(!part) {
|
||||
ViewProviderItem::onChanged(prop);
|
||||
@@ -253,7 +253,7 @@ void ViewProviderPartRef::onChanged(const App::Property* prop) {
|
||||
m_points->numPoints = counter;
|
||||
|
||||
//test
|
||||
boost::shared_ptr<Geometry3D> g = part->m_cluster->getProperty<Module3D::type<Solver>::math_prop>().m_geometry[0];
|
||||
std::shared_ptr<Geometry3D> g = part->m_cluster->getProperty<Module3D::type<Solver>::math_prop>().m_geometry[0];
|
||||
|
||||
std::stringstream str;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user