Salome HOME
9cb3bbe9b0d33e1e598a71e38dab68b8866e5632
[modules/hexablock.git] / src / HEXABLOCK / HexEdge.hxx
1
2 // class : Gestion des aretes
3
4 // Copyright (C) 2009-2023  CEA, EDF
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef __EDGE_H
23 #define __EDGE_H
24
25 #include "HexVertex.hxx"
26
27 BEGIN_NAMESPACE_HEXA
28
29 class HexaExport Edge : public EltBase
30 {
31 public:
32     virtual Vertex* getVertex (int  nro);
33
34     int addAssociation  (NewShape* geom, int subid, double deb, double fin);
35     int setAssociation  (NewShape* geom, int subid);
36     int findAssociation (NewShape* geom);
37     virtual void clearAssociation ();
38     void setColor  (double valeur);
39     bool    getWay ()              { return e_way ; }
40     double  getLength ();
41
42     Edge (Vertex* va, Vertex* vb);
43
44 #ifndef SWIG
45 public:
46     virtual int  countVertex () { return V_TWO; }
47     virtual void saveXml (XmlWriter* xml);
48     virtual void replaceVertex (Vertex* old, Vertex* nouveau);
49
50     Edge (Edge* other);
51     int  anaMerge  (Vertex* orig, Vertex* couple[]);
52     bool definedBy (Vertex* v1,   Vertex* v2);
53
54     void  propager (Propagation* prop, int nro, int sens=1);
55
56     void  setPropag (int nro, bool sens);
57     int   getPropag ()                   { return e_propag ; }
58
59     Quad* getParent (int nro);
60     virtual void dump ();
61     void         dumpPlus ();
62     void         dumpAsso ();
63
64     virtual void majReferences();
65
66     int  inter (Edge* other, int& nother);
67     int  inter (Edge* other);
68     int  index (Vertex* node);
69     Vertex* commonVertex  (Edge* other);
70     Vertex* opposedVertex (Vertex* sommet);
71     double* commonPoint   (Edge* other, double point[]);
72
73     Vertex* getAmont ()       { return e_vertex [NOT e_way] ; }
74     Vertex* getAval  ()       { return e_vertex [e_way] ; }
75
76     Law* getLaw ()            { return e_law ; }
77     void setLaw (Law* law)    { e_law =  law ; }
78
79     void setScalar (double valeur)          { setColor (valeur) ; }
80
81     virtual void duplicate ();
82     Edge*   getClone  ()                    { return e_clone ;   }
83     double* getVector (double vecteur[]);
84     std::string  makeDefinition ();
85
86     int addAssociation (EdgeShape* gline, double deb, double fin);
87     int checkAssociation ();
88     int countAssociation () { return tab_assoc.size () ; }
89     AssoEdge* getAssociation (int nro);
90     double    getAssoLen ();
91
92 private:
93     friend class Cloner;
94     Vertex*   e_vertex [V_TWO];
95     Edge*     e_clone;
96     int       e_propag;
97     bool      e_way;     // Sens de propagation
98     Law*      e_law;     // Le soleil brille, brille, brille
99     AssoEdges tab_assoc;
100 #endif
101 };
102 END_NAMESPACE_HEXA
103 #endif
104