2 // class : Gestion des formes associees (Hexa 5)
7 #include "HexEltBase.hxx"
10 #include <TopTools_IndexedMapOfShape.hxx>
11 #include <TopoDS_Shape.hxx>
12 #include <TopoDS_Compound.hxx>
13 #include <BRep_Builder.hxx>
18 class NewShape : public EltBase
21 virtual int countVertex () { return tab_vertex.size (); }
22 virtual int countEdge () { return tab_edge.size (); }
23 virtual int countFace () { return tab_face.size (); }
25 int getVertex (int nro);
26 int getEdge (int nro);
27 int getFace (int nro);
29 cpchar getNameVertex (int nro);
30 cpchar getNameEdge (int nro);
31 cpchar getNameFace (int nro);
33 const string& getBrep ();
34 const TopoDS_Shape& getShape ();
37 EnumShape getOrigin () { return sh_origin ; }
38 VertexShape* getVertexShape (int nro);
39 EdgeShape* getEdgeShape (int nro);
40 FaceShape* getFaceShape (int nro);
42 public : // for Others
43 NewShape (Document* dad, EnumShape type=SH_NONE);
44 void setShape (const TopoDS_Shape& shape, EnumShape type=SH_IMPORT);
45 void setBrep (rcstring brep);
46 int addPoint (double* coord);
47 void addAssociation (Vertex* elt, int subid, double param);
48 void addAssociation (Edge* elt, int subid, double pmin, double pmax);
49 void addAssociation (Quad* elt, int subid);
51 VertexShape* findVertex (int subid);
52 EdgeShape* findEdge (int subid);
53 FaceShape* findFace (int subid);
55 SubShape* findSubShape (int subid);
57 const TopoDS_Shape& getGeoShape (int subid);
60 void saveXml (XmlWriter* xml);
63 int addCircle (double* center, double rad, double* norm, double* base);
64 int addSphere (double* center, double radius);
70 // ---------------------------- Parcours
71 void parseShape (const TopoDS_Shape& shape);
72 void push_level () { sh_level ++ ; }
73 void pop_level () { sh_level -- ; }
74 void addSubShape (const TopoDS_Shape& shape);
76 private : // ________________________________________________________
77 TopoDS_Shape geo_shape;
81 bool brep_defined, shape_defined;
83 TopTools_IndexedMapOfShape map_shape;
84 std::vector <FaceShape*> tab_face;
85 std::vector <EdgeShape*> tab_edge;
86 std::vector <VertexShape*> tab_vertex;
88 // Pour Construire les shapes internes
90 TopoDS_Compound geo_compound;
91 BRep_Builder geo_builder;
93 std::vector <Vertex*> asso_vertex;
96 RealVector asso_pmin, asso_pmax, asso_param;
97 IntVector asso_edid, asso_quid, asso_vxid;