1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024120: Move out StdPrs_WFShape implementation to StdPrs_WFShape.cxx

Small correction of test case
This commit is contained in:
kgv
2013-08-29 13:24:51 +04:00
committed by bugmaster
parent b45c727b8d
commit c151c0f1f5
6 changed files with 1056 additions and 695 deletions

View File

@@ -28,5 +28,104 @@
#include <TopoDS_Shape.hxx>
#include <TopTools_HSequenceOfShape.hxx>
typedef Prs3d_WFShape <StdPrs_WFDeflectionRestrictedFace, StdPrs_DeflectionCurve, StdPrs_Vertex> StdPrs_WFDeflectionShape;
#endif
class StdPrs_WFDeflectionShape : public Prs3d_Root
{
public:
//! Add shape to presentation
static inline void Add (const Handle (Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle (Prs3d_Drawer)& theDrawer)
{
Face aFaceAlgo;
Curve aCurveAlgo;
Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
anAlgo.Add (thePrs, theShape, theDrawer);
}
static inline Handle(TopTools_HSequenceOfShape) PickCurve
(const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const TopoDS_Shape& theShape,
const Handle (Prs3d_Drawer)& theDrawer)
{
Face aFaceAlgo;
Curve aCurveAlgo;
Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
return anAlgo.PickCurve (theX, theY, theZ, theDistance, theShape, theDrawer);
}
static inline Handle(TopTools_HSequenceOfShape) PickPatch
(const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer)
{
Face aFaceAlgo;
Curve aCurveAlgo;
Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
return anAlgo.PickPatch (theX, theY, theZ, theDistance, theShape, theDrawer);
}
private:
class Face : public Prs3d_WFShape::Face
{
public:
virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
const Handle(BRepAdaptor_HSurface)& theFace,
const Standard_Boolean theToDrawUIso,
const Standard_Boolean theToDrawVIso,
const Quantity_Length theDeflection,
const Standard_Integer theNBUiso,
const Standard_Integer theNBViso,
const Handle(Prs3d_Drawer)& theDrawer,
Prs3d_NListOfSequenceOfPnt& theCurves) const
{
StdPrs_WFDeflectionRestrictedFace::Add (thePrs, theFace, theToDrawUIso, theToDrawVIso, theDeflection,
theNBUiso, theNBViso, theDrawer, theCurves);
}
virtual Standard_Boolean Match (const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const Handle(BRepAdaptor_HSurface)& theFace,
const Handle(Prs3d_Drawer)& theDrawer) const
{
return StdPrs_WFDeflectionRestrictedFace::Match (theX, theY, theZ, theDistance, theFace, theDrawer);
}
};
class Curve : public Prs3d_WFShape::Curve
{
public:
virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
Adaptor3d_Curve& theCurve,
const Quantity_Length theDeflection,
const Handle(Prs3d_Drawer)& theDrawer,
TColgp_SequenceOfPnt& thePoints,
const Standard_Boolean theToDrawCurve) const
{
StdPrs_DeflectionCurve::Add (thePrs, theCurve, theDeflection, theDrawer, thePoints, theToDrawCurve);
}
virtual Standard_Boolean Match (const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const Adaptor3d_Curve& theCurve,
const Handle(Prs3d_Drawer)& theDrawer) const
{
return StdPrs_DeflectionCurve::Match (theX, theY, theZ, theDistance, theCurve, theDrawer);
}
};
};
#endif // _StdPrs_WFDeflectionShape_H__

View File

@@ -28,5 +28,104 @@
#include <StdPrs_Curve.hxx>
#include <StdPrs_Vertex.hxx>
typedef Prs3d_WFShape <StdPrs_WFRestrictedFace, StdPrs_Curve, StdPrs_Vertex> StdPrs_WFShape;
#endif
class StdPrs_WFShape : public Prs3d_Root
{
public:
//! Add shape to presentation
static inline void Add (const Handle (Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle (Prs3d_Drawer)& theDrawer)
{
Face aFaceAlgo;
Curve aCurveAlgo;
Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
anAlgo.Add (thePrs, theShape, theDrawer);
}
static inline Handle(TopTools_HSequenceOfShape) PickCurve
(const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const TopoDS_Shape& theShape,
const Handle (Prs3d_Drawer)& theDrawer)
{
Face aFaceAlgo;
Curve aCurveAlgo;
Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
return anAlgo.PickCurve (theX, theY, theZ, theDistance, theShape, theDrawer);
}
static inline Handle(TopTools_HSequenceOfShape) PickPatch
(const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer)
{
Face aFaceAlgo;
Curve aCurveAlgo;
Prs3d_WFShape anAlgo (aFaceAlgo, aCurveAlgo);
return anAlgo.PickPatch (theX, theY, theZ, theDistance, theShape, theDrawer);
}
private:
class Face : public Prs3d_WFShape::Face
{
public:
virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
const Handle(BRepAdaptor_HSurface)& theFace,
const Standard_Boolean theToDrawUIso,
const Standard_Boolean theToDrawVIso,
const Quantity_Length theDeflection,
const Standard_Integer theNBUiso,
const Standard_Integer theNBViso,
const Handle(Prs3d_Drawer)& theDrawer,
Prs3d_NListOfSequenceOfPnt& theCurves) const
{
StdPrs_WFRestrictedFace::Add (thePrs, theFace, theToDrawUIso, theToDrawVIso, theDeflection,
theNBUiso, theNBViso, theDrawer, theCurves);
}
virtual Standard_Boolean Match (const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const Handle(BRepAdaptor_HSurface)& theFace,
const Handle(Prs3d_Drawer)& theDrawer) const
{
return StdPrs_WFRestrictedFace::Match (theX, theY, theZ, theDistance, theFace, theDrawer);
}
};
class Curve : public Prs3d_WFShape::Curve
{
public:
virtual void Add (const Handle(Prs3d_Presentation)& thePrs,
Adaptor3d_Curve& theCurve,
const Quantity_Length theDeflection,
const Handle(Prs3d_Drawer)& theDrawer,
TColgp_SequenceOfPnt& thePoints,
const Standard_Boolean theToDrawCurve) const
{
StdPrs_Curve::Add (thePrs, theCurve, theDeflection, theDrawer, thePoints, theToDrawCurve);
}
virtual Standard_Boolean Match (const Quantity_Length theX,
const Quantity_Length theY,
const Quantity_Length theZ,
const Quantity_Length theDistance,
const Adaptor3d_Curve& theCurve,
const Handle(Prs3d_Drawer)& theDrawer) const
{
return StdPrs_Curve::Match (theX, theY, theZ, theDistance, theCurve, theDrawer);
}
};
};
#endif // _StdPrs_WFShape_H__