S_Polyhedron.h
Go to the documentation of this file.
1 #ifndef _S_POLYHEDRON
2 # define _S_POLYHEDRON
3 
4 # pragma once
8 # include <sch/sch_api.h>
9 # include <string>
10 # include <vector>
11 
12 # ifdef WITH_BOOST_1_36
14 # endif
15 # include <boost/serialization/split_member.hpp>
16 
17 namespace sch
18 {
20 {
21 public:
24  SCH_API virtual ~S_Polyhedron(void);
25 
27 
28  SCH_API virtual S_Polyhedron * clone() const;
29 
34  SCH_API virtual void constructFromFile(const std::string & filename);
35 
40  SCH_API virtual void loadFromBinary(const std::string & filename);
41 
46  SCH_API virtual void saveToBinary(const std::string & filename);
47 
52 
53  SCH_API Point3 naiveSupport(const Vector3 & v) const;
54 
60 
65 
69  SCH_API void clear();
70 
75 
78  {
79  return &poly;
80  }
81 
82  template<class Archive>
83  void save(Archive & ar, const unsigned int /*version*/) const
84  {
85  ar & boost::serialization::base_object<S_ObjectNonNormalized>(*this);
86  ar & poly;
87  }
88 
89  template<class Archive>
90  void load(Archive & ar, const unsigned int /*version*/)
91  {
92  ar & boost::serialization::base_object<S_ObjectNonNormalized>(*this);
93  ar & poly;
96  }
97 
98  BOOST_SERIALIZATION_SPLIT_MEMBER()
99 
100 protected:
101  SCH_API virtual Point3 l_Support(const Vector3 & v, int & lastFeature) const;
102  SCH_API virtual S_ObjectType getType() const;
103 
104 protected:
106 };
107 } // namespace sch
108 #endif
109 
Definition: S_ObjectNonNormalized.h:17
S_ObjectType
type of a solid object. Don't use it to cast !
Definition: S_Object.h:234
Definition: S_Polyhedron.h:20
virtual SCH_API S_Polyhedron * clone() const
Returns a copy of this S_Object.
void save(Archive &ar, const unsigned int) const
Definition: S_Polyhedron.h:83
virtual SCH_API Point3 l_Support(const Vector3 &v, int &lastFeature) const
gives the support point for a given vector in local cordinates and a given last feature....
SCH_API void updateVertexNeighbors()
updates the Neighborhood of the vertexes, must be called on polyhedron \which vertexes have no neighb...
SCH_API void clearNeighbors()
clears the neighbors tables;
SCH_API Point3 naiveSupport(const Vector3 &v) const
Polyhedron_algorithms poly
Definition: S_Polyhedron.h:105
virtual SCH_API void constructFromFile(const std::string &filename)
loads the polyhedron from a file. the file must be in the format of Qhull qconvex output,...
SCH_API const S_Polyhedron & operator=(const S_Polyhedron &)
virtual SCH_API void saveToBinary(const std::string &filename)
Save the object to a binary archive.
SCH_API void clear()
clears all the polyhedron;
SCH_API S_Polyhedron(void)
SCH_API void deleteVertexesWithoutNeighbors()
deletes aal the vertexes that dont have neighbors;
virtual SCH_API void loadFromBinary(const std::string &filename)
Load the object from a binary archive.
SCH_API void updateFastArrays()
updates the fast access arrays, must be called after each polyhedron modification
virtual SCH_API S_ObjectType getType() const
must be overloaded to return the type
SCH_API Polyhedron_algorithms * getPolyhedronAlgorithm()
Definition: S_Polyhedron.h:77
SCH_API int getTrianglesNumber() const
virtual SCH_API ~S_Polyhedron(void)
SCH_API S_Polyhedron(const S_Polyhedron &)
void load(Archive &ar, const unsigned int)
Definition: S_Polyhedron.h:90
Definition: CD_Pair.h:12
#define SCH_API
Definition: sch_api.h:13
Definition: Polyhedron_algorithms.h:50