// Purpose: Update AIS object from a TDataXtd_Constraint.
// Modified Mon 30 10:15:43 1998 by SZY
-
-#include <TPrsStd_ConstraintTools.ixx>
-
-#include <stdio.h>
-#include <UnitsAPI.hxx>
-#include <TCollection_ExtendedString.hxx>
-
-#include <TNaming_Tool.hxx>
-#include <TNaming_Iterator.hxx>
-#include <TNaming_NamedShape.hxx>
-#include <TDF_Label.hxx>
-#include <TDataStd_Real.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDataXtd_Geometry.hxx>
-#include <TDF_Reference.hxx>
-
-
-#include <AIS_OffsetDimension.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_ParallelRelation.hxx>
-#include <AIS_TangentRelation.hxx>
-#include <AIS_IdenticRelation.hxx>
#include <AIS_AngleDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
+#include <AIS_ConcentricRelation.hxx>
#include <AIS_DiameterDimension.hxx>
+#include <AIS_EqualDistanceRelation.hxx>
+#include <AIS_EqualRadiusRelation.hxx>
#include <AIS_FixRelation.hxx>
-#include <AIS_PerpendicularRelation.hxx>
-#include <AIS_ConcentricRelation.hxx>
-#include <AIS_SymmetricRelation.hxx>
-#include <AIS_MidPointRelation.hxx>
+#include <AIS_IdenticRelation.hxx>
#include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
-#include <AIS_EqualRadiusRelation.hxx>
-#include <AIS_EqualDistanceRelation.hxx>
-#include <AIS_MinRadiusDimension.hxx>
+#include <AIS_InteractiveObject.hxx>
+#include <AIS_LengthDimension.hxx>
#include <AIS_MaxRadiusDimension.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <BRep_Tool.hxx>
+#include <AIS_MidPointRelation.hxx>
+#include <AIS_MinRadiusDimension.hxx>
+#include <AIS_OffsetDimension.hxx>
+#include <AIS_ParallelRelation.hxx>
+#include <AIS_PerpendicularRelation.hxx>
+#include <AIS_RadiusDimension.hxx>
+#include <AIS_Relation.hxx>
+#include <AIS_SymmetricRelation.hxx>
+#include <AIS_TangentRelation.hxx>
#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
-
-#include <GeomAbs_SurfaceType.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <GC_MakePlane.hxx>
+#include <Geom_CartesianPoint.hxx>
+#include <Geom_Circle.hxx>
#include <Geom_Geometry.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
-#include <Geom_CartesianPoint.hxx>
-#include <Geom_Circle.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Dir.hxx>
+#include <GeomAbs_SurfaceType.hxx>
#include <gp_Ax1.hxx>
+#include <gp_Cone.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
+#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
-#include <gp_Cylinder.hxx>
-#include <gp_Cone.hxx>
#include <gp_Torus.hxx>
-#include <GC_MakePlane.hxx>
-
-#include <Precision.hxx>
#include <IntAna_QuadQuadGeo.hxx>
-
-#include <Standard_ProgramError.hxx>
+#include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
#include <Standard_ErrorHandler.hxx>
-
+#include <Standard_ProgramError.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDataStd_Real.hxx>
+#include <TDataXtd_Constraint.hxx>
+#include <TDataXtd_Geometry.hxx>
+#include <TDF_Label.hxx>
+#include <TDF_Reference.hxx>
+#include <TNaming_Iterator.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TNaming_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
+#include <TPrsStd_ConstraintTools.hxx>
+#include <UnitsAPI.hxx>
-#define BUC60846
-
+#include <stdio.h>
static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
//=======================================================================
//function : static GetGoodShape for planar constraint
//purpose :
//=======================================================================
-static void GetGoodShape(TopoDS_Shape& shape)
+static void GetGoodShape(TopoDS_Shape& theShape)
{
- switch (shape.ShapeType()) {
+ switch (theShape.ShapeType())
+ {
case TopAbs_EDGE:
case TopAbs_VERTEX: { return; }
default:
{
- TopExp_Explorer EXP(shape,TopAbs_EDGE);
- if (EXP.More()) {
- shape = EXP.Current();
- return;
+ TopExp_Explorer anExp (theShape,TopAbs_EDGE);
+ if (anExp.More())
+ {
+ theShape = anExp.Current();
+ return;
}
- else {
- EXP.Init(shape,TopAbs_VERTEX);
- if (EXP.More()) shape = EXP.Current();
+ else
+ {
+ anExp.Init (theShape, TopAbs_VERTEX);
+ if (anExp.More())
+ {
+ theShape = anExp.Current();
+ }
}
}
}
//=======================================================================
//function : ComputeDistance
-//purpose : Build an AIS_LengtDimension.
+//purpose : Build an AIS_LengthDimension.
//=======================================================================
-void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)& aConst,
- Handle(AIS_InteractiveObject)& anAIS)
+void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)& theConst,
+ Handle(AIS_InteractiveObject)& theAIS)
{
- Standard_Integer nbgeom = aConst->NbGeometries();
- if (nbgeom < 2) {
-#ifdef DEB
- cout << "TPrsStd_ConstraintTools::ComputeDistance: at least 2 geometries are needed" << endl;
+ Standard_Integer aGeomNum = theConst->NbGeometries();
+
+ // Dimension is build on one or two shapes.
+ if (aGeomNum < 1 || aGeomNum > 2)
+ {
+#ifdef OCCT_DEBUG
+ cout << "TPrsStd_ConstraintTools::ComputeDistance: 1 or 2 geometries are needed" << endl;
#endif
- NullifyAIS(anAIS);
+ NullifyAIS(theAIS);
return;
}
- TopoDS_Shape shape1,shape2,shape3 ;
- Handle(Geom_Geometry) ageom3;
- Standard_Boolean is_planar(aConst->IsPlanar()),is_directed(Standard_False);
- AIS_TypeOfDist typedist = AIS_TOD_Unknown;
+
+ TopoDS_Shape aShape1, aShape2;
+ Handle(Geom_Geometry) aGeom3;
+ Standard_Boolean isPlanar (theConst->IsPlanar());
// Get shapes and geometry
- if (is_planar) {
- if (nbgeom == 2)
- GetShapesAndGeom (aConst,shape1,shape2,ageom3);
- else
- GetShapesAndGeom (aConst,shape1,shape2,shape3,ageom3);
+ if (aGeomNum == 1)
+ {
+ GetOneShape (theConst, aShape1);
+
+ if (aShape1.IsNull())
+ {
+ #ifdef OCCT_DEBUG
+ cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
+ #endif
+ NullifyAIS (theAIS);
+ return;
+ }
}
- else
- GetTwoShapes (aConst,shape1,shape2);
+ else //aGeomNum == 2
+ {
+ GetTwoShapes (theConst, aShape1, aShape2);
- if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
- cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
-#endif
- NullifyAIS(anAIS);
- return;
+ if (aShape1.IsNull() || aShape2.IsNull())
+ {
+ #ifdef OCCT_DEBUG
+ cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
+ #endif
+ NullifyAIS (theAIS);
+ return;
+ }
}
- Handle(Geom_Plane) aplane;
- if (is_planar) {
- if (nbgeom != 2) {
- is_directed = !shape3.IsNull();
- if (!is_directed) {
-#ifdef DEB
- cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
-#endif
- NullifyAIS(anAIS);
- return;
- }
+ // Get plane from constraint
+ Handle(Geom_Plane) aPlane;
+ if (isPlanar)
+ {
+ GetGeom (theConst, aGeom3);
+
+ GetGoodShape (aShape1);
+
+ if (aGeomNum == 2)
+ {
+ GetGoodShape (aShape2);
}
- GetGoodShape (shape1);
- GetGoodShape (shape2);
+ aPlane = Handle(Geom_Plane)::DownCast (aGeom3);
+ }
- aplane = Handle(Geom_Plane)::DownCast(ageom3);
- if (aplane.IsNull()) {
-#ifdef DEB
- cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << endl;
-#endif
- NullifyAIS(anAIS);
+ // Get custom value
+ Standard_Real aValue;
+ TCollection_ExtendedString aText;
+ ComputeTextAndValue (theConst, aValue, aText,Standard_False);
+
+ Standard_Boolean isFaces = Standard_False;
+ Standard_Boolean isEdges = Standard_False;
+ Standard_Boolean isEdgeFace = Standard_False;
+ Standard_Boolean isVertices = Standard_False;
+ Standard_Boolean isEdge = Standard_False;
+
+ Standard_Boolean SaveDrw = Standard_False;
+ Handle(Prs3d_Drawer) aDrawer;
+ Handle(AIS_LengthDimension) aDim;
+
+ if (!theAIS.IsNull())
+ {
+ aDim = Handle(AIS_LengthDimension)::DownCast (theAIS);
+ }
+
+ // Check shapes for AIS dimension
+ if (aGeomNum == 1)
+ {
+ if (aShape1.ShapeType () != TopAbs_EDGE)
+ {
+ #ifdef OCCT_DEBUG
+ cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << endl;
+ #endif
+ NullifyAIS (theAIS);
return;
}
-
- if (is_directed) {
- GetGoodShape(shape3);
- const TopoDS_Edge& E = TopoDS::Edge(shape3);
- BRepAdaptor_Curve CURVE(E);
- Handle_Geom_Geometry aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
- gp_Dir Dir = ((Handle(Geom_Line)&) aGeomGeometry)->Lin().Direction();
- gp_Dir xdir(aplane->Pln().Position().XDirection());
- if (Dir.IsParallel(xdir,Precision::Confusion()))
- typedist = AIS_TOD_Horizontal;
- else
- typedist = AIS_TOD_Vertical;
- }
+
+ isEdge = Standard_True;
}
+ else // nbgeom == 2
+ {
+ isFaces = IsFace (aShape1) && IsFace (aShape2);
- Standard_Real val1;
- TCollection_ExtendedString txt;
- ComputeTextAndValue(aConst,val1,txt,Standard_False);
-
- // Arguments de l'AIS
- Standard_Boolean isface = IsFace(shape1) && IsFace(shape2);
- Standard_Boolean isedgeface = (shape1.ShapeType () == TopAbs_FACE &&
- shape2.ShapeType () == TopAbs_EDGE);
- Standard_Boolean is2vertices =(shape1.ShapeType () == TopAbs_VERTEX && //addition 1
- shape2.ShapeType () == TopAbs_VERTEX);
- if (!isface && !is_planar && !is2vertices) {
- // Recherche arguments pouvant convenir
- if (shape1.ShapeType() == shape2.ShapeType()) {
- TopoDS_Vertex v1,v2,v3,v4;
- if (shape1.ShapeType() == TopAbs_EDGE) {
- TopExp::Vertices (TopoDS::Edge(shape1),v1,v2);
- TopExp::Vertices (TopoDS::Edge(shape2),v3,v4);
- }
- else
- if (shape1.ShapeType() == TopAbs_WIRE) {
- TopExp::Vertices (TopoDS::Wire(shape1),v1,v2);
- TopExp::Vertices (TopoDS::Wire(shape2),v3,v4);
- }
- shape1 = v1;
- gp_Pnt P1 = BRep_Tool::Pnt(v1);
- gp_Pnt P2 = BRep_Tool::Pnt(v3), P3 = BRep_Tool::Pnt(v4);
- if (P1.Distance(P2) < P1.Distance(P3)) {
- shape2 = v3;
- gp_Ax2 ax2 (P1, gp_Dir (P2.XYZ() - P1.XYZ()));
- aplane = new Geom_Plane (P1,ax2.XDirection());
- }
- else {
- shape2 = v4;
- gp_Ax2 ax2 (P1, gp_Dir (P3.XYZ() - P1.XYZ()));
- aplane = new Geom_Plane (P1,ax2.XDirection());
+ isEdges = (aShape1.ShapeType() == TopAbs_EDGE) && (aShape2.ShapeType() == TopAbs_EDGE);
+
+ isEdgeFace = ((aShape1.ShapeType() == TopAbs_FACE) && (aShape2.ShapeType() == TopAbs_EDGE))
+ || ((aShape1.ShapeType() == TopAbs_EDGE) && (aShape2.ShapeType() == TopAbs_FACE));
+
+ isVertices = (aShape1.ShapeType() == TopAbs_VERTEX) && (aShape2.ShapeType() == TopAbs_VERTEX);
+
+ if (!isPlanar && !isFaces && !isEdges && !isVertices)
+ {
+ // Search suitable geometry for dimension
+ if (aShape1.ShapeType() == aShape2.ShapeType())
+ {
+ TopoDS_Vertex aV1, aV2, aV3, aV4;
+ if (aShape1.ShapeType() == TopAbs_WIRE)
+ {
+ TopExp::Vertices (TopoDS::Wire(aShape1), aV1, aV2);
+ TopExp::Vertices (TopoDS::Wire(aShape2), aV3, aV4);
+ }
+ aShape1 = aV1;
+ gp_Pnt aP1 = BRep_Tool::Pnt(aV1);
+ gp_Pnt aP2 = BRep_Tool::Pnt(aV3);
+ gp_Pnt aP3 = BRep_Tool::Pnt (aV4);
+ if (aP1.Distance (aP2) < aP1.Distance (aP3))
+ {
+ aShape2 = aV3;
+ gp_Ax2 ax2 (aP1, gp_Dir (aP2.XYZ() - aP1.XYZ()));
+ aPlane = new Geom_Plane (aP1, ax2.XDirection());
+ }
+ else
+ {
+ aShape2 = aV4;
+ gp_Ax2 anAx2 (aP1, gp_Dir (aP3.XYZ() - aP1.XYZ()));
+ aPlane = new Geom_Plane (aP1, anAx2.XDirection());
+ }
}
- }
- else {
- if (!isedgeface) {
- NullifyAIS(anAIS);
- return;
+ else if (!isEdgeFace)
+ {
+ NullifyAIS (theAIS);
+ return;
}
}
}
- // Update de l'AIS
- Handle(AIS_LengthDimension) ais;
- Standard_Boolean SaveDrw = Standard_False;
- Handle(AIS_Drawer) aDrawer;
+ // Check plane
+ Standard_Boolean isCheckPlane = (aDim.IsNull() && !isFaces) || isPlanar;
+ if ((isVertices || isEdges) && !isPlanar)
+ {
+ gp_Pnt aP1, aP2, aP3;
- if (!anAIS.IsNull()) {
- ais = Handle(AIS_LengthDimension)::DownCast(anAIS);
+ if (isVertices)
+ {
+ aP1 = BRep_Tool::Pnt (TopoDS::Vertex (aShape1));
+ aP2 = BRep_Tool::Pnt (TopoDS::Vertex (aShape2));
+ aP3 = gp_Pnt (aP1.Y() - 1.0, aP2.X() + 1.0, 0.0);
+ }
+
+ if (isEdges)
+ {
+ TopoDS_Vertex aV1, aV2, aV3, aV4;
+ TopExp::Vertices (TopoDS::Edge(aShape1), aV1, aV2);
+ TopExp::Vertices (TopoDS::Edge(aShape2), aV3, aV4);
+ aP1 = BRep_Tool::Pnt (aV1);
+ aP2 = BRep_Tool::Pnt (aV2);
+ aP3 = BRep_Tool::Pnt (aV3);
+ }
+
+ GC_MakePlane aPlaneMaker (aP1, aP2, aP3);
+ if (aPlaneMaker.IsDone() && !isPlanar)
+ {
+ aPlane = aPlaneMaker.Value();
+ }
+ }
+
+ if (isCheckPlane && aPlane.IsNull())
+ {
+ #ifdef OCCT_DEBUG
+ cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << endl;
+ #endif
+ NullifyAIS (theAIS);
+ return;
}
- if (ais.IsNull()) {
- if (is2vertices) { //addition 2
- gp_Pnt P1 = BRep_Tool::Pnt( TopoDS::Vertex(shape1) );
- gp_Pnt P2 = BRep_Tool::Pnt( TopoDS::Vertex(shape2) );
- gp_Pnt P3(P1.Y()-1., P2.X()+1., 0.);
- GC_MakePlane mkPlane(P1, P2, P3);
- ais = new AIS_LengthDimension (P1, P2, mkPlane.Value()->Pln());
+ // Update of AIS
+ if (aDim.IsNull())
+ {
+ if (isEdge)
+ {
+ aDim = new AIS_LengthDimension (GetEdge (aShape1), aPlane->Pln());
}
- else if (isface)
+ else if (isFaces)
{
- ais = new AIS_LengthDimension (GetFace(shape1),GetFace(shape2),aplane->Pln());
+ aDim = new AIS_LengthDimension (GetFace (aShape1), GetFace (aShape2));
}
- else if (isedgeface) {
- ais = new AIS_LengthDimension (GetFace(shape1),GetEdge(shape2),aplane->Pln());
+ else
+ {
+ aDim = new AIS_LengthDimension (aShape1, aShape2, aPlane->Pln());
}
- else {
- ais = new AIS_LengthDimension (shape1,shape2,aplane->Pln());
+
+ if (SaveDrw)
+ {
+ aDim->SetAttributes (aDrawer);
}
- if( SaveDrw ) ais->SetAttributes(aDrawer);
}
- else {
- if (isface)
+ else
+ {
+ if (isEdge)
{
- ais->SetMeasuredGeometry (GetFace(shape1), GetFace(shape2));
+ aDim->SetMeasuredGeometry (GetEdge(aShape1), aPlane->Pln());
}
else
{
- ais->SetMeasuredShapes (shape1, shape2);
- }
- if (is2vertices) { //addition 3
- gp_Pnt P1 = BRep_Tool::Pnt( TopoDS::Vertex(shape1) );
- gp_Pnt P2 = BRep_Tool::Pnt( TopoDS::Vertex(shape2) );
- gp_Pnt P3(P1.Y()-1., P2.X()+1., 0.);
- GC_MakePlane mkPlane(P1, P2, P3);
- ais->SetCustomPlane( mkPlane.Value()->Pln() );
+ aDim->SetMeasuredShapes (aShape1, aShape2);
}
- ais->SetCustomValue (val1);
+ aDim->SetCustomValue (aValue);
}
-
- if (is_planar)
+
+ if (!aPlane.IsNull())
{
- ais->SetCustomPlane (aplane->Pln());
+ aDim->SetCustomPlane (aPlane->Pln());
}
- anAIS = ais;
+
+ theAIS = aDim;
}
//=======================================================================
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputePerpendicular: at leat two constraintes are needed" << endl;
#endif
NullifyAIS(anAIS);
if (is_planar) GetShapesAndGeom(aConst,shape1,shape2,ageom3);
else GetTwoShapes(aConst,shape1,shape2);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputePerpendicular : null shape" << endl;
#endif
NullifyAIS(anAIS);
if (is_planar) {
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputePerpendicular: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeParallel: at least 2 constraintes are needed" << endl;
#endif
NullifyAIS(anAIS);
}
if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeParallel: must be a planar constraint" << endl;
#endif
NullifyAIS(anAIS);
GetShapesAndGeom(aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeParallel : null shape" << endl;
#endif
NullifyAIS(anAIS);
}
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeParallel: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 3) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraintes are needed" << endl;
#endif
NullifyAIS(anAIS);
Standard_Boolean is_planar(aConst->IsPlanar());
if (!is_planar) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
#endif
NullifyAIS(anAIS);
GetShapesAndGeom(aConst,shape1,shape2,shape3,ageom3);
if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
#endif
NullifyAIS(anAIS);
GetGoodShape(shape3);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
#endif
NullifyAIS(anAIS);
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 3)
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraints are needed" << endl;
#endif
NullifyAIS(anAIS);
Standard_Boolean is_planar(aConst->IsPlanar());
if ( !is_planar )
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
#endif
NullifyAIS(anAIS);
if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull())
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
#endif
NullifyAIS(anAIS);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull())
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << endl;
#endif
NullifyAIS(anAIS);
return;
}
if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeTangent: must be a planar constraint" << endl;
#endif
NullifyAIS(anAIS);
GetShapesAndGeom(aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeTangent : null shape" << endl;
#endif
NullifyAIS(anAIS);
GetGoodShape(shape2);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeTangent: nul plane" << endl;
#endif
NullifyAIS(anAIS);
GetOneShape( aConst, shape );
if (shape.IsNull() ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeAngleForOneFace : null shape" << endl;
#endif
NullifyAIS(anAIS);
}
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd::Compute angle : Shape is not Compound or is Null" <<endl;
#endif
return (Standard_False);
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
if( nbgeom == 1 ) { ComputeAngleForOneFace( aConst, anAIS ); return; }
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeAngle: at least 2 constraints are needed" << endl;
#endif
NullifyAIS(anAIS);
GetShapesAndGeom (aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeAngle : null shape" << endl;
#endif
NullifyAIS(anAIS);
aFace = TopoDS::Face(shape1);
else
if(!CheckIsShapeCompound(shape1, aFace)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "Compute angle : Geom type = " << shape1.ShapeType()
<< " non traite"<<endl;
#endif
gp_Torus aTore = aSurfaFace.Torus();
anax1aFace1 = aTore.Axis();
} else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"Compute angle"<<aTypeaFace<<" non traite"<<endl;
#endif
NullifyAIS(anAIS);
aFace = TopoDS::Face(shape2);
else
if(!CheckIsShapeCompound(shape2, aFace)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "Compute angle : Geom type = " << shape2.ShapeType()
<< " non traite"<<endl;
#endif
gp_Torus aTore = aSurfaFace.Torus();
anax1aFace2 = aTore.Axis();
} else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "Compute angle " << aTypeaFace << " non traite"<<endl;
#endif
NullifyAIS(anAIS);
Handle(Geom_Line) computedgeom3 = new Geom_Line (aLine);
ageom3 = computedgeom3;
} else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"Compute angle insertection of planes failed"<<endl;
#endif
NullifyAIS(anAIS);
}
} else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"Compute angle faces are //"<<endl;
#endif
NullifyAIS(anAIS);
if (ageom3->IsKind(STANDARD_TYPE(Geom_Plane))) isplan = Standard_True;
else if (ageom3->IsKind(STANDARD_TYPE(Geom_Line))) isplan = Standard_False;
else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeAngle: unknown 3rd arg " << endl;
#endif
NullifyAIS(anAIS);
}
ais->SetMeasuredGeometry (TopoDS::Face (shape1), TopoDS::Face (shape2));
if (isplan)
- ais->SetCustomPlane (((Handle(Geom_Plane)&) ageom3)->Pln());
+ ais->SetCustomPlane (Handle(Geom_Plane)::DownCast (ageom3)->Pln());
else if (!isCurvilinear)
{
gp_Pln aPlane;
- aPlane.SetAxis (((Handle(Geom_Line)&) ageom3)->Position());
+ aPlane.SetAxis (Handle(Geom_Line)::DownCast (ageom3)->Position());
ais->SetCustomPlane (aPlane);
}
}
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
- Standard_ProgramError::Raise ("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
+ throw Standard_ProgramError("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
}
if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeConcentric: must be a planar constraint" << endl;
#endif
NullifyAIS(anAIS);
GetShapesAndGeom(aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeConcentric : null shape" << endl;
#endif
NullifyAIS(anAIS);
//ota : to allow concentric constraint display between vertex and edge
if (shape1.ShapeType() != TopAbs_EDGE && shape2.ShapeType() != TopAbs_EDGE) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeConcentric: concentric between two vertexes : NOT DISPLAYED" << endl;;
#endif
NullifyAIS(anAIS);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeConcentric: nul plane" << endl;;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeRadius: at least one constrainte is needed" << endl;
#endif
NullifyAIS(anAIS);
TopoDS_Shape shape1 ;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeRadius: null shape" << endl;
#endif
NullifyAIS(anAIS);
shape1.ShapeType()==TopAbs_COMPSOLID ||
shape1.ShapeType()==TopAbs_SOLID ||
shape1.ShapeType()==TopAbs_SHELL ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeRadius: not good shape" << endl;
#endif
NullifyAIS(anAIS);
GetGeom(aConst,ageom2);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeRadius: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMinRadius: at least one constrainte is needed" << endl;
#endif
NullifyAIS(anAIS);
TopoDS_Shape shape1 ;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMinradius: null shape" << endl;
#endif
NullifyAIS(anAIS);
shape1.ShapeType()==TopAbs_COMPSOLID ||
shape1.ShapeType()==TopAbs_SOLID ||
shape1.ShapeType()==TopAbs_SHELL ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMinRadius: not good shape" << endl;
#endif
NullifyAIS(anAIS);
GetGeom(aConst,ageom2);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMinRadius: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: at least one constrainte is needed" << endl;
#endif
NullifyAIS(anAIS);
TopoDS_Shape shape1 ;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMaxradius: null shape" << endl;
#endif
NullifyAIS(anAIS);
shape1.ShapeType()==TopAbs_COMPSOLID ||
shape1.ShapeType()==TopAbs_SOLID ||
shape1.ShapeType()==TopAbs_SHELL ) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: not good shape" << endl;
#endif
NullifyAIS(anAIS);
GetGeom(aConst,ageom2);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 4) {
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << endl;;
+#endif
NullifyAIS(anAIS);
return;
}
GetShapesAndGeom(aConst, aShape1, aShape2, aShape3, aShape4, aGeom);
if (aShape1.IsNull()||aShape2.IsNull()||
aShape3.IsNull()||aShape4.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << endl;
#endif
NullifyAIS(anAIS);
if (!CheckShapesPair(aShape1, aShape2) ||
!CheckShapesPair(aShape3, aShape4)){
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<endl;
#endif
NullifyAIS(anAIS);
if (!IsPlanar || aPlane.IsNull()) {
//create the plane
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<< "The constraint plane is not assigned "<< endl;
#endif
NullifyAIS(anAIS);
gp_Dir aDir1 = aCurve1.Line().Direction();
gp_Dir aDir2 = aCurve2.Line().Direction();
if (!(aDir1.IsParallel(aDir2, Precision::Confusion()))) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << " Lines are not parallel"<<endl;
#endif
return Standard_False;
gp_Pnt aCntr1 = aCurve1.Circle().Location(); //get the circle center
gp_Pnt aCntr2 = aCurve2.Circle().Location(); //get the circle center
if (!aCntr1.IsEqual(aCntr2,Precision::Confusion())){
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << " Circles are not concentric"<<endl;
#endif
return Standard_False;
}
}
else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "Incorrect pair of curves "<<endl;
#endif
return Standard_False;
{
gp_Pnt aCntr = aCurve.Circle().Location();
if (!aCntr.IsEqual(aPnt, Precision::Confusion())){
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << " The point doesn't coincide with the circle center"<<endl;
#endif
return Standard_False;
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << endl;;
#endif
NullifyAIS(anAIS);
GetShapesAndGeom(aConst, shape1, shape2, ageom3);
if (shape1.IsNull()||shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << endl;
#endif
NullifyAIS(anAIS);
aDir1.IsParallel(aDir2, Precision::Confusion()))
aplane = aPlane2;
else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << endl;;
#endif
NullifyAIS(anAIS);
GetOneShape(aConst,shape1);
if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << endl;
#endif
NullifyAIS(anAIS);
GetGeom(aConst,ageom2);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << endl;;
#endif
NullifyAIS(anAIS);
return;
}
if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << endl;;
#endif
NullifyAIS(anAIS);
GetOneShape(aConst,shape1);
if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << endl;
#endif
NullifyAIS(anAIS);
GetGeom(aConst,ageom2);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << endl;
#endif
NullifyAIS(anAIS);
Standard_Boolean is_planar (aConst->IsPlanar());
Handle(Geom_Plane) aplane;
if (is_planar) {
- GetGeom (aConst,aplane);
+ Handle(Geom_Geometry) ageom;
+ GetGeom (aConst,ageom);
+ aplane = Handle(Geom_Plane)::DownCast (ageom);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << endl;
#endif
NullifyAIS(anAIS);
}
if (S1.IsNull() || S2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << endl;
#endif
NullifyAIS(anAIS);
Standard_Real val1;
TCollection_ExtendedString txt;
Handle(AIS_LengthDimension) ais;
- //Handle(AIS_Drawer) aDrawer;
+ //Handle(Prs3d_Drawer) aDrawer;
if (nbgeom == 1)
{
}
if (is_planar)
+ {
ais->SetCustomPlane (aplane->Pln());
- anAIS = ais;
+ }
+
+ anAIS = ais;
return;
}
else
BRepAdaptor_Curve CURVE(OE);
if (CURVE.GetType() == GeomAbs_Line) {
// Works only with line !!
-//#ifndef DEB
- Handle_Geom_Geometry aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
- gp_Lin OLin = ((Handle(Geom_Line)&) aGeomGeometry)->Lin();
-//#else
-// gp_Lin OLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
-//#endif
+ Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
+ gp_Lin OLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
TopoDS_Edge NE = TopoDS::Edge(S2);
CURVE.Initialize (NE);
-//#ifndef DEB
aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
- gp_Lin NLin = ((Handle(Geom_Line)&)aGeomGeometry)->Lin();
-//#else
-// gp_Lin NLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
-//#endif
+ gp_Lin NLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
gp_Dir TDir (NLin.Location().XYZ() - OLin.Location().XYZ());
aplane = new Geom_Plane (NLin.Location(),NLin.Direction()^TDir);
}
else
if (CURVE.GetType() == GeomAbs_Circle) {
-//#ifndef DEB
- Handle_Geom_Geometry aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
- gp_Ax1 ax = ((Handle(Geom_Circle)&) aGeomGeometry)->Circ().Axis();
-//#else
-// gp_Ax1 ax = ((Handle(Geom_Circle)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Circ().Axis();
-//#endif
+ Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
+ gp_Ax1 ax = Handle(Geom_Circle)::DownCast (aGeomGeometry)->Circ().Axis();
aplane = new Geom_Plane (ax.Location(),ax.Direction());
is_planar = Standard_True;
}
BRepBuilderAPI_MakeFace MkF (w1,Standard_True);
if (MkF.IsDone()) {
-//#ifndef DEB
- Handle_Geom_Surface aGeomSurface = BRep_Tool::Surface(MkF.Face());
- aplane = (Handle(Geom_Plane)&) aGeomSurface ;
-//#else
-// aplane = ((Handle(Geom_Plane)&) BRep_Tool::Surface(MkF.Face()));
-//#endif
+ Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surface(MkF.Face());
+ aplane = Handle(Geom_Plane)::DownCast (aGeomSurface);
is_planar = Standard_True;
}
}
return;
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2)
- Standard_ProgramError::Raise
- ("TPrsStd_ConstraintTools::ComputePlacement: at leat two constraints are needed");
+ throw Standard_ProgramError("TPrsStd_ConstraintTools::ComputePlacement: at leat two constraints are needed");
TopoDS_Shape shape1,shape2 ;
GetTwoShapes(aConst,shape1,shape2);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << endl;
#endif
NullifyAIS(anAIS);
}
if (!aConst->IsPlanar()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << endl;
#endif
anAIS.Nullify() ;
}
TopoDS_Shape shape1,shape2 ;
- Handle(Geom_Plane) aplane;
- GetShapesAndGeom(aConst,shape1,shape2,aplane);
+ Handle(Geom_Geometry) ageom;
+ GetShapesAndGeom(aConst,shape1,shape2,ageom);
+ Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast (ageom);
if (shape1.IsNull() || shape2.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << endl;
#endif
NullifyAIS(anAIS);
GetGoodShape(shape1);
GetGoodShape(shape2);
if (aplane.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << endl;
#endif
NullifyAIS(anAIS);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << endl;
#endif
NullifyAIS(anAIS);
TopoDS_Shape shape1;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
#endif
NullifyAIS(anAIS);
{
Handle(TNaming_NamedShape) atgeom = aConst->GetPlane();
if (atgeom.IsNull()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<endl;
#endif
return;
if (TDataXtd_Geometry::Plane(label,aplane)) aGeom = new Geom_Plane(aplane);
else if (TDataXtd_Geometry::Line(label,anaxis)) aGeom = new Geom_Line(anaxis);
else if (TDataXtd_Geometry::Point(label,apoint)) aGeom = new Geom_CartesianPoint(apoint);
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << "TPrsStd_ConstraintTools::GetGeom no geom on label " << endl;
}