]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewLine.cpp
DFCH: imageUndoRedo + Manual Paint: It doesn't works :s :s
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewLine.cpp
1 #include "manualViewLine.h"
2
3
4 // ----------------------------------------------------------------------------
5 // ----------------------------------------------------------------------------
6 // ----------------------------------------------------------------------------
7
8 // AD:02-09
9
10 manualViewLine::manualViewLine()
11 {
12         _sizePointsContour=20;
13 }
14 // ----------------------------------------------------------------------------
15 manualViewLine::~manualViewLine()
16 {
17 }
18
19
20 // ----------------------------------------------------------------------------
21 manualViewLine * manualViewLine :: Clone()
22 {
23         manualViewLine * clone = new manualViewLine();
24         CopyAttributesTo(clone);
25         return clone;
26 }
27
28 // ---------------------------------------------------------------------------
29
30 void manualViewLine::CopyAttributesTo( manualViewLine * cloneObject)
31 {
32         // Fathers object
33         manualViewBaseContour::CopyAttributesTo(cloneObject);
34 }
35
36 // ----------------------------------------------------------------------------
37 int manualViewLine::GetType() // virtual
38 {
39         return 6;
40 }
41
42
43 // ----------------------------------------------------------------------------
44
45 void manualViewLine::InitMove(int x, int y, int z)  // virtual
46 {
47         manualPoint *mp;
48         double XX=x;
49         double YY=y;
50         double ZZ=z;
51         TransfromCoordViewWorld(XX,YY,ZZ);
52
53         if (_manContModel->GetSizeLstPoints()==2)
54         {
55                 mp = _manContModel->GetManualPoint(0);
56                 _dp0[0]= mp->GetX() - XX;
57                 _dp0[1]= mp->GetY() - YY;
58                 _dp0[2]= mp->GetZ();
59
60                 mp = _manContModel->GetManualPoint(1);
61                 _dp1[0]= mp->GetX() - XX;
62                 _dp1[1]= mp->GetY() - YY;
63                 _dp1[2]= mp->GetZ();
64
65         }
66 }
67
68
69 // ----------------------------------------------------------------------------
70 void manualViewLine::MoveContour(int x, int y, int z) // virtual 
71 {
72         manualPoint *mp;
73         double XX=x;
74         double YY=y;
75         double ZZ=z;
76         TransfromCoordViewWorld(XX,YY,ZZ);
77
78         mp = _manContModel->GetManualPoint(0);
79         mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
80
81         mp = _manContModel->GetManualPoint(1);
82         mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
83
84
85         UpdateViewPoint(0);
86         UpdateViewPoint(1);
87 }
88