Salome HOME
Move Hex_defines.hxx to the list of the headers.
[modules/hexablock.git] / src / HEXABLOCK / HexEdge.hxx
1
2 // class : Gestion des aretes
3
4 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
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.
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 "Hex_defines.hxx"
26 #include "HexVertex.hxx"
27
28 BEGIN_NAMESPACE_HEXA
29
30 class HEXABLOCKENGINE_EXPORT Edge : public EltBase
31 {
32 public:
33     virtual Vertex* getVertex (int  nro);
34
35     int addAssociation (NewShape* geom, int subid, double deb, double fin);
36     virtual void clearAssociation ();
37     void setColor  (double valeur);
38     bool    getWay ()              { return e_way ; }
39
40     Edge (Vertex* va, Vertex* vb);
41
42 #ifndef SWIG
43 public:
44     virtual int  countVertex () { return V_TWO; }
45     virtual void saveXml (XmlWriter* xml);
46     virtual void replaceVertex (Vertex* old, Vertex* nouveau);
47
48     Edge (Edge* other);
49     int  anaMerge  (Vertex* orig, Vertex* couple[]);
50     bool definedBy (Vertex* v1,   Vertex* v2);
51
52     void  propager (Propagation* prop, int nro, int sens=1);
53
54     void  setPropag (int nro, bool sens);
55     int   getPropag ()                   { return e_propag ; }
56
57     Quad* getParent (int nro);
58     virtual void dump ();
59     void         dumpPlus ();
60     void         dumpAsso ();
61
62     virtual void majReferences();
63
64     int  inter (Edge* other, int& nother);
65     int  inter (Edge* other);
66     int  index (Vertex* node);
67     Vertex* commonVertex  (Edge* other);
68     Vertex* opposedVertex (Vertex* sommet);
69     double* commonPoint   (Edge* other, double point[]);
70
71     Vertex* getAmont ()       { return e_vertex [NOT e_way] ; }
72     Vertex* getAval  ()       { return e_vertex [e_way] ; }
73
74     Law* getLaw ()            { return e_law ; }
75     void setLaw (Law* law)    { e_law =  law ; }
76
77     void setScalar (double valeur)          { setColor (valeur) ; }
78
79     virtual void duplicate ();
80     Edge*   getClone  ()                    { return e_clone ;   }
81     double* getVector (double vecteur[]);
82     string  makeDefinition ();
83
84     int addAssociation (EdgeShape* gline, double deb, double fin);
85     int checkAssociation ();
86     int countAssociation () { return tab_assoc.size () ; }
87     AssoEdge* getAssociation (int nro);
88     double    getAssoLen ();
89
90 private:
91     friend class Cloner;
92     Vertex*   e_vertex [V_TWO];
93     Edge*     e_clone;
94     int       e_propag;
95     bool      e_way;     // Sens de propagation
96     Law*      e_law;     // Le soleil brille, brille, brille
97     AssoEdges tab_assoc;
98 #endif
99 };
100 END_NAMESPACE_HEXA
101 #endif
102