-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathSketcher_PropertyPoint.cxx
81 lines (69 loc) · 1.99 KB
/
Sketcher_PropertyPoint.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* \file Sketcher_PropertyPoint.cxx
* \brief Implementation file for the class Sketcher_PropertyPoint
* \author <a href="mailto:[email protected]?subject=Sketcher_PropertyPoint.cxx">Sergei Maslov</a>
*/
#include "Sketcher_PropertyPoint.hxx"
/**
* \fn Sketcher_PropertyPoint( QWidget* parent, const char* name, WFlags fl )
* \brief Constructs a Sketcher_PropertyPoint which is a child of 'parent', with the name 'name' and widget flags set to 'f'
* \param parent QWidget*
* \param name const char*
* \param fl WFlags
*/
Sketcher_PropertyPoint::Sketcher_PropertyPoint( QWidget* parent, const char* name)
: Sketcher_Property( parent, name)
{
if ( !name )
setWindowTitle( "Property Points" );
//setCaption( tr( "PointsProperties" ) );
TextLabelPoint1->setText( tr( "Point " ) );
isPointWindow = true;
}
/**
* \fn ~Sketcher_PropertyPoint()
* \brief destructor
*/
Sketcher_PropertyPoint::~Sketcher_PropertyPoint()
{
// no need to delete child widgets, Qt does it all for us
}
/**
* \fn SetGeometry()
* \brief show object geometry in dialog window
* \return void
*/
void Sketcher_PropertyPoint::SetGeometry()
{
curGeom2d_Point = Handle(Geom2d_CartesianPoint)::DownCast(mySObject->GetGeometry());
firstPnt2d = curGeom2d_Point->Pnt2d();
SetCoord(LineEditPoint1,firstPnt2d);
}
/**
* \fn CheckGeometry()
* \brief check geometry for change
* \return bool
*/
bool Sketcher_PropertyPoint::CheckGeometry()
{
return CheckCoord(LineEditPoint1,tempPnt2d);
}
/**
* \fn GetGeometry()
* \brief create new object
* \return bool
*/
bool Sketcher_PropertyPoint::GetGeometry()
{
if(!firstPnt2d.IsEqual(tempPnt2d,1.0e-6))
{
firstPnt2d = tempPnt2d;
curGeom2d_Point->SetPnt2d(firstPnt2d);
Handle (Geom_CartesianPoint) newGeom_Point = new Geom_CartesianPoint(ElCLib::To3d(myCoordinateSystem.Ax2(),firstPnt2d));
Handle(AIS_Point) newAIS_Point = new AIS_Point(newGeom_Point);
myContext->Remove(myAIS_Object, true);
myAIS_Object = newAIS_Point;
return true;
}
return false;
}