]> SALOME platform Git repositories - modules/shaper.git/blob - src/ConstructionAPI/ConstructionAPI_Plane.cpp
Salome HOME
103d9d6eb36ad0cf618a0800f0a8d725d9a82889
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Plane.cpp
1 // Name   : ConstructionAPI_Plane.cpp
2 // Purpose: 
3 //
4 // History:
5 // 27/05/16 - Sergey POKHODENKO - Creation of the file
6
7 //--------------------------------------------------------------------------------------
8 #include "ConstructionAPI_Plane.h"
9 //--------------------------------------------------------------------------------------
10 #include <ModelHighAPI_Double.h>
11 #include <ModelHighAPI_Selection.h>
12 //--------------------------------------------------------------------------------------
13 ConstructionAPI_Plane::ConstructionAPI_Plane(
14     const std::shared_ptr<ModelAPI_Feature> & theFeature)
15 : ModelHighAPI_Interface(theFeature)
16 {
17   initialize();
18 }
19
20 ConstructionAPI_Plane::ConstructionAPI_Plane(
21     const std::shared_ptr<ModelAPI_Feature> & theFeature,
22     const ModelHighAPI_Selection & theFace,
23     const ModelHighAPI_Double & theDistance)
24 : ModelHighAPI_Interface(theFeature)
25 {
26   if (initialize())
27     setFaceAndDistance(theFace, theDistance);
28 }
29
30 ConstructionAPI_Plane::ConstructionAPI_Plane(
31     const std::shared_ptr<ModelAPI_Feature> & theFeature,
32     const ModelHighAPI_Double & theA,
33     const ModelHighAPI_Double & theB,
34     const ModelHighAPI_Double & theC,
35     const ModelHighAPI_Double & theD)
36 : ModelHighAPI_Interface(theFeature)
37 {
38   if (initialize())
39     setGeneralEquation(theA, theB, theC, theD);
40 }
41
42 ConstructionAPI_Plane::~ConstructionAPI_Plane()
43 {
44
45 }
46
47 void ConstructionAPI_Plane::setFaceAndDistance(
48     const ModelHighAPI_Selection & theFace,
49     const ModelHighAPI_Double & theDistance)
50 {
51   theFace.fillAttribute(myface);
52   theDistance.fillAttribute(mydistance);
53
54   execute();
55 }
56
57 void ConstructionAPI_Plane::setGeneralEquation(
58     const ModelHighAPI_Double & theA,
59     const ModelHighAPI_Double & theB,
60     const ModelHighAPI_Double & theC,
61     const ModelHighAPI_Double & theD)
62 {
63   theA.fillAttribute(myA);
64   theB.fillAttribute(myB);
65   theC.fillAttribute(myC);
66   theD.fillAttribute(myD);
67
68   execute();
69 }