Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed usage of fuzzy value as parameter in API
[modules/shaper.git]
/
src
/
GeomAPI
/
GeomAPI_AISObject.cpp
diff --git
a/src/GeomAPI/GeomAPI_AISObject.cpp
b/src/GeomAPI/GeomAPI_AISObject.cpp
index b150bffca1345bb50a393a42901721ee072c9ebe..9cf540f8b2a5e4e712ebf567b12d0e7a6f9daae9 100644
(file)
--- a/
src/GeomAPI/GeomAPI_AISObject.cpp
+++ b/
src/GeomAPI/GeomAPI_AISObject.cpp
@@
-1,4
+1,4
@@
-// Copyright (C) 2014-202
0
CEA/DEN, EDF R&D
+// Copyright (C) 2014-202
2
CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@
-34,13
+34,14
@@
#include <AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_ParallelRelation.hxx>
-#include <AIS_PerpendicularRelation.hxx>
-#include <AIS_RadiusDimension.hxx>
#include <AIS_Shape.hxx>
#include <AIS_Shape.hxx>
-#include <AIS_FixRelation.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_PointAspect.hxx>
+#include <PrsDim_Dimension.hxx>
+#include <PrsDim_LengthDimension.hxx>
+#include <PrsDim_ParallelRelation.hxx>
+#include <PrsDim_PerpendicularRelation.hxx>
+#include <PrsDim_RadiusDimension.hxx>
+#include <PrsDim_FixRelation.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
@@
-139,9
+140,10
@@
void GeomAPI_AISObject::createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoin
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
- Handle(AIS_LengthDimension) aDimAIS = new AIS_LengthDimension(theStartPoint->impl<gp_Pnt>(),
- theEndPoint->impl<gp_Pnt>(),
- thePlane->impl<gp_Pln>());
+ Handle(PrsDim_LengthDimension) aDimAIS =
+ new PrsDim_LengthDimension(theStartPoint->impl<gp_Pnt>(),
+ theEndPoint->impl<gp_Pnt>(),
+ thePlane->impl<gp_Pln>());
aDimAIS->SetCustomValue(theDistance);
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
aDimAIS->SetCustomValue(theDistance);
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
@@
-158,7
+160,7
@@
void GeomAPI_AISObject::createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoin
setImpl(new Handle(AIS_InteractiveObject)(aDimAIS));
} else {
// update presentation
setImpl(new Handle(AIS_InteractiveObject)(aDimAIS));
} else {
// update presentation
- Handle(
AIS_LengthDimension) aDimAIS = Handle(AIS
_LengthDimension)::DownCast(anAIS);
+ Handle(
PrsDim_LengthDimension) aDimAIS = Handle(PrsDim
_LengthDimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
aDimAIS->SetMeasuredGeometry(theStartPoint->impl<gp_Pnt>(), theEndPoint->impl<gp_Pnt>(),
thePlane->impl<gp_Pln>());
if (!aDimAIS.IsNull()) {
aDimAIS->SetMeasuredGeometry(theStartPoint->impl<gp_Pnt>(), theEndPoint->impl<gp_Pnt>(),
thePlane->impl<gp_Pln>());
@@
-176,7
+178,7
@@
bool GeomAPI_AISObject::isEmptyDistanceGeometry()
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- Handle(
AIS_LengthDimension) aDimAIS = Handle(AIS
_LengthDimension)::DownCast(anAIS);
+ Handle(
PrsDim_LengthDimension) aDimAIS = Handle(PrsDim
_LengthDimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
anEmpty = !aDimAIS->IsValid();
}
if (!aDimAIS.IsNull()) {
anEmpty = !aDimAIS->IsValid();
}
@@
-208,8
+210,8
@@
void GeomAPI_AISObject::createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
- Handle(
AIS_RadiusDimension) aDimAIS = new AIS
_RadiusDimension(theCircle->impl<gp_Circ>(),
- anAnchor->impl<gp_Pnt>());
+ Handle(
PrsDim_RadiusDimension) aDimAIS = new PrsDim
_RadiusDimension(theCircle->impl<gp_Circ>(),
+
anAnchor->impl<gp_Pnt>());
aDimAIS->SetCustomValue(theRadius);
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
aDimAIS->SetCustomValue(theRadius);
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
@@
-225,7
+227,7
@@
void GeomAPI_AISObject::createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
setImpl(new Handle(AIS_InteractiveObject)(aDimAIS));
} else {
// update presentation
setImpl(new Handle(AIS_InteractiveObject)(aDimAIS));
} else {
// update presentation
- Handle(
AIS_RadiusDimension) aDimAIS = Handle(AIS
_RadiusDimension)::DownCast(anAIS);
+ Handle(
PrsDim_RadiusDimension) aDimAIS = Handle(PrsDim
_RadiusDimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
aDimAIS->SetMeasuredGeometry(theCircle->impl<gp_Circ>(), anAnchor->impl<gp_Pnt>());
aDimAIS->SetCustomValue(theRadius);
if (!aDimAIS.IsNull()) {
aDimAIS->SetMeasuredGeometry(theCircle->impl<gp_Circ>(), anAnchor->impl<gp_Pnt>());
aDimAIS->SetCustomValue(theRadius);
@@
-242,14
+244,14
@@
void GeomAPI_AISObject::createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl<gp_Pln>());
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl<gp_Pln>());
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
- Handle(
AIS_ParallelRelation) aParallel = new AIS
_ParallelRelation(
+ Handle(
PrsDim_ParallelRelation) aParallel = new PrsDim
_ParallelRelation(
theLine1->impl<TopoDS_Shape>(), theLine2->impl<TopoDS_Shape>(), aPlane);
if (theFlyoutPoint)
aParallel->SetPosition(theFlyoutPoint->impl<gp_Pnt>());
setImpl(new Handle(AIS_InteractiveObject)(aParallel));
} else {
theLine1->impl<TopoDS_Shape>(), theLine2->impl<TopoDS_Shape>(), aPlane);
if (theFlyoutPoint)
aParallel->SetPosition(theFlyoutPoint->impl<gp_Pnt>());
setImpl(new Handle(AIS_InteractiveObject)(aParallel));
} else {
- Handle(
AIS_ParallelRelation) aParallel = Handle(AIS
_ParallelRelation)::DownCast(anAIS);
+ Handle(
PrsDim_ParallelRelation) aParallel = Handle(PrsDim
_ParallelRelation)::DownCast(anAIS);
if (!aParallel.IsNull()) {
aParallel->SetFirstShape(theLine1->impl<TopoDS_Shape>());
aParallel->SetSecondShape(theLine2->impl<TopoDS_Shape>());
if (!aParallel.IsNull()) {
aParallel->SetFirstShape(theLine1->impl<TopoDS_Shape>());
aParallel->SetSecondShape(theLine2->impl<TopoDS_Shape>());
@@
-268,13
+270,13
@@
void GeomAPI_AISObject::createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLi
Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl<gp_Pln>());
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl<gp_Pln>());
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (anAIS.IsNull()) {
- Handle(
AIS_PerpendicularRelation) aPerpendicular = new AIS
_PerpendicularRelation(
+ Handle(
PrsDim_PerpendicularRelation) aPerpendicular = new PrsDim
_PerpendicularRelation(
theLine1->impl<TopoDS_Shape>(), theLine2->impl<TopoDS_Shape>(), aPlane);
setImpl(new Handle(AIS_InteractiveObject)(aPerpendicular));
} else {
theLine1->impl<TopoDS_Shape>(), theLine2->impl<TopoDS_Shape>(), aPlane);
setImpl(new Handle(AIS_InteractiveObject)(aPerpendicular));
} else {
- Handle(
AIS_PerpendicularRelation) aPerpendicular = Handle(AIS_PerpendicularRelation)::DownCast(
- anAIS);
+ Handle(
PrsDim_PerpendicularRelation) aPerpendicular =
+
Handle(PrsDim_PerpendicularRelation)::DownCast(
anAIS);
if (!aPerpendicular.IsNull()) {
aPerpendicular->SetFirstShape(theLine1->impl<TopoDS_Shape>());
aPerpendicular->SetSecondShape(theLine2->impl<TopoDS_Shape>());
if (!aPerpendicular.IsNull()) {
aPerpendicular->SetFirstShape(theLine1->impl<TopoDS_Shape>());
aPerpendicular->SetSecondShape(theLine2->impl<TopoDS_Shape>());
@@
-291,13
+293,13
@@
void GeomAPI_AISObject::createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl<gp_Pln>());
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl<gp_Pln>());
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
- Handle(
AIS
_FixRelation) aFixPrs;
+ Handle(
PrsDim
_FixRelation) aFixPrs;
if (anAIS.IsNull()) {
if (anAIS.IsNull()) {
- aFixPrs = new
AIS
_FixRelation(aShape, aPlane);
+ aFixPrs = new
PrsDim
_FixRelation(aShape, aPlane);
setImpl(new Handle(AIS_InteractiveObject)(aFixPrs));
} else {
setImpl(new Handle(AIS_InteractiveObject)(aFixPrs));
} else {
- aFixPrs = Handle(
AIS
_FixRelation)::DownCast(anAIS);
+ aFixPrs = Handle(
PrsDim
_FixRelation)::DownCast(anAIS);
if (!aFixPrs.IsNull()) {
aFixPrs->SetFirstShape(aShape);
aFixPrs->SetPlane(aPlane);
if (!aFixPrs.IsNull()) {
aFixPrs->SetFirstShape(aShape);
aFixPrs->SetPlane(aPlane);
@@
-324,7
+326,7
@@
void GeomAPI_AISObject::setColor(const int& theColor)
if (anAIS.IsNull())
return;
Quantity_Color aColor((Quantity_NameOfColor) theColor);
if (anAIS.IsNull())
return;
Quantity_Color aColor((Quantity_NameOfColor) theColor);
- Handle(
AIS_Dimension) aDimAIS = Handle(AIS
_Dimension)::DownCast(anAIS);
+ Handle(
PrsDim_Dimension) aDimAIS = Handle(PrsDim
_Dimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
@@
-370,7
+372,7
@@
bool GeomAPI_AISObject::setColor(int theR, int theG, int theB)
return false;
Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
return false;
Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
- Handle(
AIS_Dimension) aDimAIS = Handle(AIS
_Dimension)::DownCast(anAIS);
+ Handle(
PrsDim_Dimension) aDimAIS = Handle(PrsDim
_Dimension)::DownCast(anAIS);
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
if (!aContext.IsNull())
if (!aDimAIS.IsNull()) {
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
if (!aContext.IsNull())