// Purpose: Update AIS object from a TDataXtd_Constraint.
// Modified Mon 30 10:15:43 1998 by SZY
+#include <TPrsStd_ConstraintTools.hxx>
-#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_DiameterDimension.hxx>
-#include <AIS_FixRelation.hxx>
-#include <AIS_PerpendicularRelation.hxx>
-#include <AIS_ConcentricRelation.hxx>
-#include <AIS_SymmetricRelation.hxx>
-#include <AIS_MidPointRelation.hxx>
#include <AIS_InteractiveContext.hxx>
-#include <AIS_Drawer.hxx>
-#include <AIS_EqualRadiusRelation.hxx>
-#include <AIS_EqualDistanceRelation.hxx>
-#include <AIS_MinRadiusDimension.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_InteractiveObject.hxx>
+#include <PrsDim_AngleDimension.hxx>
+#include <PrsDim_ConcentricRelation.hxx>
+#include <PrsDim_DiameterDimension.hxx>
+#include <PrsDim_EqualDistanceRelation.hxx>
+#include <PrsDim_EqualRadiusRelation.hxx>
+#include <PrsDim_FixRelation.hxx>
+#include <PrsDim_IdenticRelation.hxx>
+#include <PrsDim_LengthDimension.hxx>
+#include <PrsDim_MaxRadiusDimension.hxx>
+#include <PrsDim_MidPointRelation.hxx>
+#include <PrsDim_MinRadiusDimension.hxx>
+#include <PrsDim_OffsetDimension.hxx>
+#include <PrsDim_ParallelRelation.hxx>
+#include <PrsDim_PerpendicularRelation.hxx>
+#include <PrsDim_RadiusDimension.hxx>
+#include <PrsDim_Relation.hxx>
+#include <PrsDim_SymmetricRelation.hxx>
+#include <PrsDim_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 <UnitsAPI.hxx>
+#include <stdio.h>
static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
//=======================================================================
Standard_Real val;
TCollection_ExtendedString txt;
TPrsStd_ConstraintTools:: ComputeTextAndValue(aConst,val,txt,aConst->GetType() == TDataXtd_ANGLE);
- Handle(AIS_Relation) rel = Handle(AIS_Relation)::DownCast(anAIS);
+ Handle(PrsDim_Relation) rel = Handle(PrsDim_Relation)::DownCast(anAIS);
if (!rel.IsNull()) rel->SetText(txt);
}
if (aGeomNum < 1 || aGeomNum > 2)
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDistance: 1 or 2 geometries are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDistance: 1 or 2 geometries are needed" << std::endl;
#endif
NullifyAIS(theAIS);
return;
if (aShape1.IsNull())
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << std::endl;
#endif
NullifyAIS (theAIS);
return;
if (aShape1.IsNull() || aShape2.IsNull())
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << std::endl;
#endif
NullifyAIS (theAIS);
return;
Standard_Boolean isEdge = Standard_False;
Standard_Boolean SaveDrw = Standard_False;
- Handle(AIS_Drawer) aDrawer;
- Handle(AIS_LengthDimension) aDim;
+ Handle(Prs3d_Drawer) aDrawer;
+ Handle(PrsDim_LengthDimension) aDim;
if (!theAIS.IsNull())
{
- aDim = Handle(AIS_LengthDimension)::DownCast (theAIS);
+ aDim = Handle(PrsDim_LengthDimension)::DownCast (theAIS);
}
// Check shapes for AIS dimension
if (aShape1.ShapeType () != TopAbs_EDGE)
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << std::endl;
#endif
NullifyAIS (theAIS);
return;
if (isCheckPlane && aPlane.IsNull())
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << std::endl;
#endif
NullifyAIS (theAIS);
return;
{
if (isEdge)
{
- aDim = new AIS_LengthDimension (GetEdge (aShape1), aPlane->Pln());
+ aDim = new PrsDim_LengthDimension (GetEdge (aShape1), aPlane->Pln());
}
else if (isFaces)
{
- aDim = new AIS_LengthDimension (GetFace (aShape1), GetFace (aShape2));
+ aDim = new PrsDim_LengthDimension (GetFace (aShape1), GetFace (aShape2));
}
else
{
- aDim = new AIS_LengthDimension (aShape1, aShape2, aPlane->Pln());
+ aDim = new PrsDim_LengthDimension (aShape1, aShape2, aPlane->Pln());
}
if (SaveDrw)
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputePerpendicular: at leat two constraintes are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputePerpendicular: at leat two constraintes are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
else GetTwoShapes(aConst,shape1,shape2);
if (shape1.IsNull() || shape2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputePerpendicular : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputePerpendicular : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetGoodShape(shape1);
GetGoodShape(shape2);
// Update de l'AIS
- Handle(AIS_PerpendicularRelation) ais;
- if (anAIS.IsNull()) ais = new AIS_PerpendicularRelation(shape1,shape2);
+ Handle(PrsDim_PerpendicularRelation) ais;
+ if (anAIS.IsNull()) ais = new PrsDim_PerpendicularRelation(shape1,shape2);
else {
- ais = Handle(AIS_PerpendicularRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_PerpendicularRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_PerpendicularRelation(shape1,shape2);
+ ais = new PrsDim_PerpendicularRelation(shape1,shape2);
}
else {
ais->SetFirstShape(shape1);
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputePerpendicular: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputePerpendicular: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeParallel: at least 2 constraintes are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeParallel: at least 2 constraintes are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (!aConst->IsPlanar()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeParallel: must be a planar constraint" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeParallel: must be a planar constraint" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetShapesAndGeom(aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeParallel : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeParallel : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeParallel: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeParallel: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
// Update de l'AIS
GetGoodShape(shape1);
GetGoodShape(shape2);
- Handle(AIS_ParallelRelation) ais;
- if (anAIS.IsNull()) ais = new AIS_ParallelRelation(shape1,shape2,aplane);
+ Handle(PrsDim_ParallelRelation) ais;
+ if (anAIS.IsNull()) ais = new PrsDim_ParallelRelation(shape1,shape2,aplane);
else {
- ais = Handle(AIS_ParallelRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_ParallelRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_ParallelRelation(shape1,shape2,aplane);
+ ais = new PrsDim_ParallelRelation(shape1,shape2,aplane);
}
else {
ais->SetFirstShape(shape1);
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 3) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraintes are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraintes are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Boolean is_planar(aConst->IsPlanar());
if (!is_planar) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
// Update de l'AIS
- Handle(AIS_SymmetricRelation) ais;
- if (anAIS.IsNull()) ais = new AIS_SymmetricRelation(shape3,shape1,shape2,aplane);
+ Handle(PrsDim_SymmetricRelation) ais;
+ if (anAIS.IsNull()) ais = new PrsDim_SymmetricRelation(shape3,shape1,shape2,aplane);
else {
- ais = Handle(AIS_SymmetricRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_SymmetricRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_SymmetricRelation(shape3,shape1,shape2,aplane);
+ ais = new PrsDim_SymmetricRelation(shape3,shape1,shape2,aplane);
}
else {
ais->SetFirstShape(shape1);
if (nbgeom < 3)
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraints are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraints are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if ( !is_planar )
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull())
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (aplane.IsNull())
{
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
// Update de l'AIS
- Handle(AIS_MidPointRelation) ais;
- if ( anAIS.IsNull() ) ais = new AIS_MidPointRelation(shape3,shape1,shape2,aplane);
+ Handle(PrsDim_MidPointRelation) ais;
+ if ( anAIS.IsNull() ) ais = new PrsDim_MidPointRelation(shape3,shape1,shape2,aplane);
else
{
- ais = Handle(AIS_MidPointRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_MidPointRelation)::DownCast(anAIS);
if (ais.IsNull())
{
- ais = new AIS_MidPointRelation(shape3,shape1,shape2,aplane);
+ ais = new PrsDim_MidPointRelation(shape3,shape1,shape2,aplane);
}
else
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
if (!aConst->IsPlanar()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeTangent: must be a planar constraint" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeTangent: must be a planar constraint" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetShapesAndGeom(aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeTangent : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeTangent : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeTangent: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeTangent: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
// Update de l'AIS
- Handle(AIS_TangentRelation) ais;
+ Handle(PrsDim_TangentRelation) ais;
if (anAIS.IsNull())
{
- ais = new AIS_TangentRelation(shape1,shape2,aplane);
+ ais = new PrsDim_TangentRelation(shape1,shape2,aplane);
ais->SetArrowSize(10000000); // jfa 9/10/2000
}
else
{
- ais = Handle(AIS_TangentRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_TangentRelation)::DownCast(anAIS);
if (ais.IsNull())
{
- ais = new AIS_TangentRelation(shape1,shape2,aplane);
+ ais = new PrsDim_TangentRelation(shape1,shape2,aplane);
ais->SetArrowSize(10000000); // jfa 9/10/2000
}
else
GetOneShape( aConst, shape );
if (shape.IsNull() ) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeAngleForOneFace : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeAngleForOneFace : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
TCollection_ExtendedString txt;
TPrsStd_ConstraintTools::ComputeTextAndValue (aConst,val1,txt,Standard_True);
- Handle(AIS_AngleDimension) ais;
+ Handle(PrsDim_AngleDimension) ais;
TopoDS_Face face;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_AngleDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_AngleDimension)::DownCast(anAIS);
if(ais.IsNull()) {
face = TopoDS::Face( shape );
- ais = new AIS_AngleDimension (face);
+ ais = new PrsDim_AngleDimension (face);
}
else {
ais->SetMeasuredGeometry(TopoDS::Face( shape ));
}
else {
face = TopoDS::Face (shape);
- ais = new AIS_AngleDimension (face);
+ ais = new PrsDim_AngleDimension (face);
}
anAIS = ais;
}
}
#ifdef OCCT_DEBUG
- cout << "TPrsStd::Compute angle : Shape is not Compound or is Null" <<endl;
+ std::cout << "TPrsStd::Compute angle : Shape is not Compound or is Null" <<std::endl;
#endif
return (Standard_False);
}
if (nbgeom < 2) {
if( nbgeom == 1 ) { ComputeAngleForOneFace( aConst, anAIS ); return; }
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeAngle: at least 2 constraints are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeAngle: at least 2 constraints are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetShapesAndGeom (aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeAngle : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeAngle : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
else
if(!CheckIsShapeCompound(shape1, aFace)) {
#ifdef OCCT_DEBUG
- cout << "Compute angle : Geom type = " << shape1.ShapeType()
- << " non traite"<<endl;
+ std::cout << "Compute angle : Geom type = " << shape1.ShapeType()
+ << " non traite"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
anax1aFace1 = aTore.Axis();
} else {
#ifdef OCCT_DEBUG
- cout<<"Compute angle"<<aTypeaFace<<" non traite"<<endl;
+ std::cout<<"Compute angle"<<aTypeaFace<<" non traite"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
else
if(!CheckIsShapeCompound(shape2, aFace)) {
#ifdef OCCT_DEBUG
- cout << "Compute angle : Geom type = " << shape2.ShapeType()
- << " non traite"<<endl;
+ std::cout << "Compute angle : Geom type = " << shape2.ShapeType()
+ << " non traite"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
anax1aFace2 = aTore.Axis();
} else {
#ifdef OCCT_DEBUG
- cout << "Compute angle " << aTypeaFace << " non traite"<<endl;
+ std::cout << "Compute angle " << aTypeaFace << " non traite"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
ageom3 = computedgeom3;
} else {
#ifdef OCCT_DEBUG
- cout<<"Compute angle insertection of planes failed"<<endl;
+ std::cout<<"Compute angle insertection of planes failed"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
} else {
#ifdef OCCT_DEBUG
- cout<<"Compute angle faces are //"<<endl;
+ std::cout<<"Compute angle faces are //"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
else if (ageom3->IsKind(STANDARD_TYPE(Geom_Line))) isplan = Standard_False;
else {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeAngle: unknown 3rd arg " << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeAngle: unknown 3rd arg " << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Boolean toCreate (Standard_True);
Standard_Boolean isface(shape1.ShapeType()==TopAbs_FACE);
- Handle(AIS_AngleDimension) ais;
+ Handle(PrsDim_AngleDimension) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_AngleDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_AngleDimension)::DownCast(anAIS);
if( ais.IsNull() ) {
toCreate = Standard_True;
}
FindExternalShape(aConst,ExtShape);
GetGoodShape(shape1);
GetGoodShape(shape2);
- ais = new AIS_AngleDimension (TopoDS::Edge(shape1),
+ ais = new PrsDim_AngleDimension (TopoDS::Edge(shape1),
TopoDS::Edge(shape2));
}
}
else {
if (isCurvilinear) {
- ais = new AIS_AngleDimension (TopoDS::Face(shape1),
+ ais = new PrsDim_AngleDimension (TopoDS::Face(shape1),
TopoDS::Face(shape2));
}
else if (isface) {
- ais = new AIS_AngleDimension (TopoDS::Face(shape1),
+ ais = new PrsDim_AngleDimension (TopoDS::Face(shape1),
TopoDS::Face(shape2));
}
}
}
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 OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeConcentric: must be a planar constraint" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeConcentric: must be a planar constraint" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetShapesAndGeom(aConst,shape1,shape2,ageom3);
if (shape1.IsNull() || shape2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeConcentric : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeConcentric : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
//ota : to allow concentric constraint display between vertex and edge
if (shape1.ShapeType() != TopAbs_EDGE && shape2.ShapeType() != TopAbs_EDGE) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeConcentric: concentric between two vertexes : NOT DISPLAYED" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeConcentric: concentric between two vertexes : NOT DISPLAYED" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeConcentric: nul plane" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeConcentric: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
// Update de l'AIS
- Handle(AIS_ConcentricRelation) ais;
+ Handle(PrsDim_ConcentricRelation) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_ConcentricRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_ConcentricRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_ConcentricRelation (shape1,shape2,aplane);
+ ais = new PrsDim_ConcentricRelation (shape1,shape2,aplane);
}
else {
ais->SetFirstShape(shape1);
}
}
else {
- ais = new AIS_ConcentricRelation (shape1,shape2,aplane);
+ ais = new PrsDim_ConcentricRelation (shape1,shape2,aplane);
}
anAIS = ais;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeRadius: at least one constrainte is needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeRadius: at least one constrainte is needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeRadius: null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeRadius: null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
shape1.ShapeType()==TopAbs_SOLID ||
shape1.ShapeType()==TopAbs_SHELL ) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeRadius: not good shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeRadius: not good shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Boolean isplanar(aConst->IsPlanar());
if (isplanar) GetGoodShape(shape1);
- Handle(AIS_RadiusDimension) ais;
+ Handle(PrsDim_RadiusDimension) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_RadiusDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_RadiusDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_RadiusDimension (shape1);
+ ais = new PrsDim_RadiusDimension (shape1);
}
else {
ais->SetMeasuredGeometry(shape1);
}
}
- else ais = new AIS_RadiusDimension (shape1);
+ else ais = new PrsDim_RadiusDimension (shape1);
if (isplanar) {
Handle(Geom_Geometry) ageom2;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeRadius: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeRadius: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMinRadius: at least one constrainte is needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMinRadius: at least one constrainte is needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMinradius: null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMinradius: null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
shape1.ShapeType()==TopAbs_SOLID ||
shape1.ShapeType()==TopAbs_SHELL ) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMinRadius: not good shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMinRadius: not good shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Boolean isplanar(aConst->IsPlanar());
if (isplanar) GetGoodShape(shape1);
- Handle(AIS_MinRadiusDimension) ais;
+ Handle(PrsDim_MinRadiusDimension) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_MinRadiusDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_MinRadiusDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_MinRadiusDimension (shape1,val1,txt);
+ ais = new PrsDim_MinRadiusDimension (shape1,val1,txt);
}
else {
ais->SetValue(val1);
ais->SetText(txt);
}
}
- else ais = new AIS_MinRadiusDimension (shape1,val1,txt);
+ else ais = new PrsDim_MinRadiusDimension (shape1,val1,txt);
if (isplanar) {
Handle(Geom_Geometry) ageom2;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMinRadius: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMinRadius: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: at least one constrainte is needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: at least one constrainte is needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMaxradius: null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMaxradius: null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
shape1.ShapeType()==TopAbs_SOLID ||
shape1.ShapeType()==TopAbs_SHELL ) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: not good shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: not good shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Boolean isplanar(aConst->IsPlanar());
if (isplanar) GetGoodShape(shape1);
- Handle(AIS_MaxRadiusDimension) ais;
+ Handle(PrsDim_MaxRadiusDimension) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_MaxRadiusDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_MaxRadiusDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_MaxRadiusDimension (shape1,val1,txt);
+ ais = new PrsDim_MaxRadiusDimension (shape1,val1,txt);
}
else {
ais->SetValue(val1);
ais->SetText(txt);
}
}
- else ais = new AIS_MaxRadiusDimension (shape1,val1,txt);
+ else ais = new PrsDim_MaxRadiusDimension (shape1,val1,txt);
if (isplanar) {
Handle(Geom_Geometry) ageom2;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 4) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (aShape1.IsNull()||aShape2.IsNull()||
aShape3.IsNull()||aShape4.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (!CheckShapesPair(aShape1, aShape2) ||
!CheckShapesPair(aShape3, aShape4)){
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<std::endl;
#endif
NullifyAIS(anAIS);
return;
if (!IsPlanar || aPlane.IsNull()) {
//create the plane
#ifdef OCCT_DEBUG
- cout<< "The constraint plane is not assigned "<< endl;
+ std::cout<< "The constraint plane is not assigned "<< std::endl;
#endif
NullifyAIS(anAIS);
return;
}
//Update AIS
- Handle(AIS_EqualDistanceRelation) ais;
+ Handle(PrsDim_EqualDistanceRelation) ais;
if (!anAIS.IsNull()) {
{
- ais = Handle(AIS_EqualDistanceRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_EqualDistanceRelation)::DownCast(anAIS);
if (ais.IsNull())
- ais = new AIS_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane);
+ ais = new PrsDim_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane);
else {
ais->SetFirstShape(aShape1);
}
}
}
- else ais = new AIS_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane);
+ else ais = new PrsDim_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane);
anAIS = ais;
gp_Dir aDir2 = aCurve2.Line().Direction();
if (!(aDir1.IsParallel(aDir2, Precision::Confusion()))) {
#ifdef OCCT_DEBUG
- cout << " Lines are not parallel"<<endl;
+ std::cout << " Lines are not parallel"<<std::endl;
#endif
return Standard_False;
}
gp_Pnt aCntr2 = aCurve2.Circle().Location(); //get the circle center
if (!aCntr1.IsEqual(aCntr2,Precision::Confusion())){
#ifdef OCCT_DEBUG
- cout << " Circles are not concentric"<<endl;
+ std::cout << " Circles are not concentric"<<std::endl;
#endif
return Standard_False;
}
}
else {
#ifdef OCCT_DEBUG
- cout << "Incorrect pair of curves "<<endl;
+ std::cout << "Incorrect pair of curves "<<std::endl;
#endif
return Standard_False;
}
gp_Pnt aCntr = aCurve.Circle().Location();
if (!aCntr.IsEqual(aPnt, Precision::Confusion())){
#ifdef OCCT_DEBUG
- cout << " The point doesn't coincide with the circle center"<<endl;
+ std::cout << " The point doesn't coincide with the circle center"<<std::endl;
#endif
return Standard_False;
}
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetShapesAndGeom(aConst, shape1, shape2, ageom3);
if (shape1.IsNull()||shape2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
aplane = aPlane2;
else {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
}
- Handle(AIS_EqualRadiusRelation) ais;
+ Handle(PrsDim_EqualRadiusRelation) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_EqualRadiusRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_EqualRadiusRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_EqualRadiusRelation(edge1, edge2, aplane);
+ ais = new PrsDim_EqualRadiusRelation(edge1, edge2, aplane);
}
else {
ais->SetFirstShape(shape1);
}
}
else {
- ais = new AIS_EqualRadiusRelation(edge1, edge2, aplane);
+ ais = new PrsDim_EqualRadiusRelation(edge1, edge2, aplane);
}
anAIS = ais;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetOneShape(aConst,shape1);
if (shape1.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
// Update de l'AIS
Standard_Boolean IsPlanar(aConst->IsPlanar());
if (IsPlanar) GetGoodShape(shape1);
- Handle(AIS_DiameterDimension) ais;
+ Handle(PrsDim_DiameterDimension) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_DiameterDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_DiameterDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_DiameterDimension (shape1);
+ ais = new PrsDim_DiameterDimension (shape1);
}
else {
ais->SetMeasuredGeometry(shape1);
}
}
- else ais = new AIS_DiameterDimension (shape1);
+ else ais = new PrsDim_DiameterDimension (shape1);
if (IsPlanar) {
Handle(Geom_Geometry) ageom2;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
if (!aConst->IsPlanar()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << endl;;
+ std::cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetOneShape(aConst,shape1);
if (shape1.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
// Update de l'AIS
- Handle(AIS_FixRelation) ais;
+ Handle(PrsDim_FixRelation) ais;
if (!anAIS.IsNull()) {
- ais = Handle(AIS_FixRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_FixRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_FixRelation (shape1,aplane);
+ ais = new PrsDim_FixRelation (shape1,aplane);
}
else {
ais->SetFirstShape(shape1);
ais->SetPlane(aplane);
}
}
- else ais = new AIS_FixRelation (shape1,aplane);
+ else ais = new PrsDim_FixRelation (shape1,aplane);
anAIS = ais;
}
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 OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (S1.IsNull() || S2.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
Standard_Real val1;
TCollection_ExtendedString txt;
- Handle(AIS_LengthDimension) ais;
- //Handle(AIS_Drawer) aDrawer;
+ Handle(PrsDim_LengthDimension) ais;
+ //Handle(Prs3d_Drawer) aDrawer;
if (nbgeom == 1)
{
ComputeTextAndValue (aConst,val1,txt,Standard_False);
if (!anAIS.IsNull())
{
- ais = Handle(AIS_LengthDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_LengthDimension)::DownCast(anAIS);
}
if (S1.ShapeType() == TopAbs_FACE && S2.ShapeType() == TopAbs_FACE)
{
if (ais.IsNull())
{
- ais = new AIS_LengthDimension (TopoDS::Face(S1),TopoDS::Face(S2));
+ ais = new PrsDim_LengthDimension (TopoDS::Face(S1),TopoDS::Face(S2));
}
else
{
}
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 OCCT_DEBUG
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
+ gp_Lin OLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
TopoDS_Edge NE = TopoDS::Edge(S2);
CURVE.Initialize (NE);
-//#ifndef OCCT_DEBUG
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);
if (ais.IsNull()) {
- ais = new AIS_LengthDimension (S1,S2,aplane->Pln());
+ ais = new PrsDim_LengthDimension (S1,S2,aplane->Pln());
}
else {
ais->SetMeasuredShapes (S1, S2);
}
else
if (CURVE.GetType() == GeomAbs_Circle) {
-//#ifndef OCCT_DEBUG
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
+ 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 OCCT_DEBUG
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
+ aplane = Handle(Geom_Plane)::DownCast (aGeomSurface);
is_planar = Standard_True;
}
}
}
}
S2 = nearest;
- ais = Handle(AIS_LengthDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_LengthDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_LengthDimension (S1,S2,aplane->Pln());
+ ais = new PrsDim_LengthDimension (S1,S2,aplane->Pln());
}
else {
ais->SetMeasuredShapes (S1, S2);
}
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << std::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 OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
ComputeTextAndValue(aConst,val1,txt,Standard_False);
}
// Update de l'AIS
- Handle(AIS_OffsetDimension) ais;
+ Handle(PrsDim_OffsetDimension) ais;
if (anAIS.IsNull()) {
- ais = new AIS_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt);
+ ais = new PrsDim_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt);
ais->SetArrowSize(val1/20.);
} else {
- ais = Handle(AIS_OffsetDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_OffsetDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt);
+ ais = new PrsDim_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt);
ais->SetArrowSize(val1/20.);
} else {
ais->SetFirstShape(GetFace(shape1));
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
if (!aConst->IsPlanar()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << std::endl;
#endif
anAIS.Nullify() ;
return;
}
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 OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetGoodShape(shape2);
if (aplane.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << std::endl;
#endif
NullifyAIS(anAIS);
return;
}
// Update de l'AIS
- Handle(AIS_IdenticRelation) ais;
- if (anAIS.IsNull()) ais = new AIS_IdenticRelation(shape1,shape2,aplane);
+ Handle(PrsDim_IdenticRelation) ais;
+ if (anAIS.IsNull()) ais = new PrsDim_IdenticRelation(shape1,shape2,aplane);
else {
- ais = Handle(AIS_IdenticRelation)::DownCast(anAIS);
+ ais = Handle(PrsDim_IdenticRelation)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_IdenticRelation(shape1,shape2,aplane);
+ ais = new PrsDim_IdenticRelation(shape1,shape2,aplane);
}
else {
ais->SetFirstShape(shape1);
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 1) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << std::endl;
#endif
NullifyAIS(anAIS);
return;
GetOneShape (aConst,shape1);
if (shape1.IsNull()) {
#ifdef OCCT_DEBUG
- cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
+ std::cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << std::endl;
#endif
NullifyAIS(anAIS);
return;
ComputeTextAndValue(aConst,val1,txt,Standard_False);
// Update de l'AIS
- Handle(AIS_RadiusDimension) ais;
+ Handle(PrsDim_RadiusDimension) ais;
{
try {
OCC_CATCH_SIGNALS
if (anAIS.IsNull()) ais =
- new AIS_RadiusDimension(shape1);
+ new PrsDim_RadiusDimension(shape1);
else {
- ais = Handle(AIS_RadiusDimension)::DownCast(anAIS);
+ ais = Handle(PrsDim_RadiusDimension)::DownCast(anAIS);
if (ais.IsNull()) {
- ais = new AIS_RadiusDimension(shape1);
+ ais = new PrsDim_RadiusDimension(shape1);
}
else {
ais->SetMeasuredGeometry(shape1);
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const&) {
ais.Nullify();
}
}
Handle(TNaming_NamedShape) atgeom = aConst->GetPlane();
if (atgeom.IsNull()) {
#ifdef OCCT_DEBUG
- cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<endl;
+ std::cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<std::endl;
#endif
return;
}
else if (TDataXtd_Geometry::Point(label,apoint)) aGeom = new Geom_CartesianPoint(apoint);
#ifdef OCCT_DEBUG
else {
- cout << "TPrsStd_ConstraintTools::GetGeom no geom on label " << endl;
+ std::cout << "TPrsStd_ConstraintTools::GetGeom no geom on label " << std::endl;
}
#endif
}