Salome HOME
Issue 0020336: [CEA 339] specifying a cut line with 2 points
[modules/visu.git] / src / VISU_I / VISU_CutLinesBase_i.hh
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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 //  File   : VISU_CutLinesBase_i.hh
23 //  Author : Oleg UVAROV
24 //  Module : VISU
25 //
26 #ifndef VISU_CutLinesBase_i_HeaderFile
27 #define VISU_CutLinesBase_i_HeaderFile
28
29 #include "VISU_I.hxx"
30 #include "VISU_ScalarMap_i.hh"
31
32 class VISU_CutLinesBasePL;
33
34 namespace VISU
35 {
36   //----------------------------------------------------------------------------
37   class VISU_I_EXPORT CutLinesBase_i : public virtual POA_VISU::CutLinesBase,
38                                        public virtual ScalarMap_i
39   {
40     CutLinesBase_i(const CutLinesBase_i&);
41
42   public:
43     //----------------------------------------------------------------------------
44     typedef ScalarMap_i TSuperClass;
45     typedef VISU::CutLinesBase TInterface;
46
47     explicit
48     CutLinesBase_i(EPublishInStudyMode thePublishInStudyModep);
49
50     virtual
51     ~CutLinesBase_i();
52
53     virtual 
54     void 
55     SetNbLines(CORBA::Long theNb);
56
57     virtual
58     CORBA::Long
59     GetNbLines();
60
61     virtual
62     void
63     SetAllCurvesInverted(CORBA::Boolean theInvert);
64
65     virtual
66     CORBA::Boolean
67     IsAllCurvesInverted();
68
69     virtual
70     void
71     SetCurveInverted(CORBA::Long theCurveNumber,
72                      CORBA::Boolean theInvert);
73
74     virtual
75     CORBA::Boolean
76     IsCurveInverted(CORBA::Long theCurveNumber);
77
78     virtual
79     void
80     SetUseAbsoluteLength(CORBA::Boolean theAbsLength);
81
82     virtual
83     CORBA::Boolean 
84     IsUseAbsoluteLength();
85
86     typedef std::map<int,bool> TCurvesInv;
87     TCurvesInv
88     GetCurvesInverted() 
89     {
90       return myMapCurvesInverted;
91     }
92
93     void
94     CopyCurvesInverted(const TCurvesInv& theCurves);
95
96     VISU_CutLinesBasePL* 
97     GetSpecificPL() const
98     { 
99       return myCutLinesBasePL; 
100     }
101     
102   protected:
103     //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
104     virtual 
105     void
106     CreatePipeLine(VISU_PipeLine* thePipeLine);
107
108     VISU_CutLinesBasePL *myCutLinesBasePL;
109     TCurvesInv myMapCurvesInverted;
110     CORBA::Boolean myUseAbsLength;
111
112   public:
113     //! Extends VISU_ColoredPrs3d_i::Create
114     virtual 
115     Storable* 
116     Create(const std::string& theMeshName, 
117            VISU::Entity theEntity,
118            const std::string& theFieldName, 
119            CORBA::Long theTimeStampNumber);
120
121     //! Extends VISU_ColoredPrs3d_i::ToStream
122     virtual 
123     void
124     ToStream(std::ostringstream& theStr);
125
126     //! Extends VISU_ColoredPrs3d_i::Restore
127     virtual
128     Storable* 
129     Restore(SALOMEDS::SObject_ptr theSObject,
130             const Storable::TRestoringMap& theMap);
131
132     virtual 
133     void
134     SameAs(const Prs3d_i* theOrigin);
135
136     void BuildTableOfReal(SALOMEDS::SObject_var theSObject,
137                           bool theIsCutSegment = false);
138   };
139 }
140
141 #endif