UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_bound.hpp
1 /* u3d_bound.hpp */
2 /* $Id: u3d_bound.hpp,v 1.3 2008/06/04 12:23:19 sad Exp $ */
3 #ifndef __u3d_bound_hpp
4 #define __u3d_bound_hpp
5 
6 //#include<vector>
7 //#include <u3d_defines.hpp>
8 #include <mth/u3d_point.hpp>
9 #include <mth/u3d_box.hpp>
10 
11 #include <mth/u3d_bspl3_surface3d.hpp>
12 #include <mth/u3d_curvature_triangled_surface.hpp>
13 #include <mth/u3d_plane_triangled_surface.hpp>
14 
15 #include "u3d_model_defines.hpp"
16 
17 
18 
19 //----------------------------------------------------------------------------
21 class U3dBound
22 {
23 
24 public:
25 
27  U3dBound(U3dBox modelBox, U3dPointsAr points, U3dSignAr relations,
28  U3dInterpolationType iType);
29 
31  U3dBound(U3dBox modelBox, U3dPoint p, double dip, double az);
32 
35  ~U3dBound();
36 
38  U3dBox* getBoundBox() const { return m_box; }
39 
41  bool getSideColor(U3dPoint, U3D_COLOR&);
42 
43  void severance(const U3dBound *b, U3D_COLOR color) { m_trianSurf->severance(b->getTrSurf(), color); }
44 
46  void getInitialPoints(U3dPointsAr &ps);
47 
49  const U3dPointsAr& getInitialPoints() const;
50 
52  int getApproxType() const { return m_intType; }
53 
55  U3dSignAr getRelations() const { return m_relations; }
56 
57  // -------------------------------------------------------------------
58  // Getting data from "triangled surface" object
59 
62 
65 
66 
68  const std::set<int>& getActTrIds() { return m_trianSurf->getActTrNums(); }
69 
71  int getActTrNum() const { return m_trianSurf->getActTrNums().size(); }
72 
74  U3dPoint getPoint(int pId) const throw(std::out_of_range) { return U3dPoint(*m_trianSurf->getPoint(pId)); }
75 
77  const U3dTriangle* getTriangle(int id) const throw(std::out_of_range) { return m_trianSurf->getTriangle(id); }
78 
80  bool getTrianglePoints(int trId, U3dPoint& p1, U3dPoint& p2, U3dPoint& p3);
81 
82 
84  U3dInterpolationType getIntType() const { return m_intType; };
85 
86  //--------------------------------------------------------------------
87 
88 protected:
89 
90  bool m_ready;
92  void calculateBoundBox(); /*< Temporary: calcultion of surface box */
93 
99  U3dSignAr m_relations;
102  U3dInterpolationType m_intType;
103 };
104 
105 typedef std::vector<U3dBound*> U3dBoundsAr;
106 
107 
108 
109 
110 
111 #endif /* u3d_bound.hpp */
112 
U3dTriangledAbstractSurface * getTrSurf() const
Definition: u3d_bound.hpp:61
const U3dPoint * getPoint(int id) const
Definition: u3d_triangled_abstract_surface.hpp:91
U3dBox * getBoundBox() const
Definition: u3d_bound.hpp:38
const U3dTriangle * getTriangle(int id) const
Definition: u3d_triangled_abstract_surface.hpp:52
Definition: u3d_math_abstract_surface.hpp:11
Definition: u3d_triangled_abstract_surface.hpp:31
U3dInterpolationType m_intType
Definition: u3d_bound.hpp:102
const std::set< int > & getActTrIds()
Definition: u3d_bound.hpp:68
Definition: u3d_box.hpp:24
Definition: u3d_bound.hpp:21
int getActTrNum() const
Definition: u3d_bound.hpp:71
bool getSideColor(U3dPoint, U3D_COLOR &)
U3dBound(U3dBox modelBox, U3dPointsAr points, U3dSignAr relations, U3dInterpolationType iType)
U3dPoint getPoint(int pId) const
Definition: u3d_bound.hpp:74
Definition: u3d_triangle.hpp:18
U3dSignAr m_relations
Definition: u3d_bound.hpp:99
U3dSignAr getRelations() const
Definition: u3d_bound.hpp:55
void severance(U3dTriangledAbstractSurface *other, const U3D_COLOR &)
bool getTrianglePoints(int trId, U3dPoint &p1, U3dPoint &p2, U3dPoint &p3)
const U3dTriangle * getTriangle(int id) const
Definition: u3d_bound.hpp:77
Definition: u3d_point.hpp:16
U3dMathAbstractSurface * getMathSurf() const
Definition: u3d_bound.hpp:64
bool m_ready
Definition: u3d_bound.hpp:84
U3dInterpolationType getIntType() const
Definition: u3d_bound.hpp:84
const U3dPointsAr & getInitialPoints() const
U3dBox * m_box
Definition: u3d_bound.hpp:97
U3dMathAbstractSurface * m_mathSurf
Definition: u3d_bound.hpp:94
U3dTriangledAbstractSurface * m_trianSurf
Definition: u3d_bound.hpp:95
int getApproxType() const
Definition: u3d_bound.hpp:52
const std::set< int > & getActTrNums()
Definition: u3d_triangled_abstract_surface.hpp:143