#include <QList>
+#include <gp_Pnt.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+
//#define DEBUG_EMPTY_SHAPE
// multi-rotation/translation operation
: ViewerData_AISShape(TopoDS_Shape()), myWorkshop(theWorkshop), myUseAISWidth(false)
{
myShapeColor = Quantity_Color(1, 1, 1, Quantity_TOC_RGB);
+
+ // first presentation for having correct Compute until presentation with shapes are set
+ gp_Pnt aPnt(0.0, 0.0, 0.0);
+ BRepBuilderAPI_MakeVertex aMaker(aPnt);
+ TopoDS_Vertex aVertex = aMaker.Vertex();
+ myShapeToPrsMap.Bind(aVertex, NULL);
}
bool PartSet_OperationPrs::hasShapes()
}
void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
- const Handle(Prs3d_Presentation)& thePresentation,
- const Standard_Integer theMode)
+ const Handle(Prs3d_Presentation)& thePresentation,
+ const Standard_Integer theMode)
{
thePresentation->Clear();
SketcherPrs_Angle::SketcherPrs_Angle(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: AIS_AngleDimension(gp_Pnt(0,0,0), gp_Pnt(1,0,0), gp_Pnt(0,1,0)), myConstraint(theConstraint),
- mySketcherPlane(thePlane)
+ mySketcherPlane(thePlane),
+ myFirstPoint(gp_Pnt(0,0,0)), myCenterPoint(gp_Pnt(1,0,0)), mySecondPoint(gp_Pnt(0,1,0)),
+ myAngle(90), myValue("90"), myFlyOutPoint(0, 0.5, 0)
{
myAspect = new Prs3d_DimensionAspect();
myAspect->MakeArrows3d(false);
SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : AIS_InteractiveObject(), myConstraint(theConstraint), mySketcherPlane(thePlane)
+: AIS_InteractiveObject(), myConstraint(theConstraint), mySketcherPlane(thePlane),
+ myPoint(gp_Pnt(0.0, 0.0, 0.0))
{
-
-}
+}
bool SketcherPrs_Coincident::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
bool isHorisontal)
: SketcherPrs_SymbolPrs(theConstraint, thePlane), myIsHorisontal(isHorisontal)
{
- myPntArray = new Graphic3d_ArrayOfPoints(1);
- myPntArray->AddVertex(0., 0., 0.);
-}
+}
bool SketcherPrs_HVDirection::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>&/* thePlane*/)
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: AIS_LengthDimension(MyDefStart, MyDefEnd, MyDefPln),
myConstraint(theConstraint),
- mySketcherPlane(thePlane)
+ mySketcherPlane(thePlane),
+ myFirstPoint(MyDefStart),
+ mySecondPoint(MyDefEnd),
+ myPlane(MyDefPln),
+ myHasParameters(false),
+ myValue(""),
+ myDistance(1)
{
SetDimensionAspect(SketcherPrs_Tools::createDimensionAspect());
SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight());
SketcherPrs_DimensionStyleListener* myStyleListener;
/// container of values obtained from the constraint, which are necessary to fill the presentation
- double myDistance; ///< the flyout distance
gp_Pnt myFirstPoint; ///< the dimension first point for measured geometry
gp_Pnt mySecondPoint; ///< the dimension first point for measured geometry
gp_Pln myPlane; ///< the plane(plane of the sketch) for measured geometry
bool myHasParameters; ///< true if the atrribute value has used parameters
std::string myValue; ///< dimension value
+ double myDistance; ///< the flyout distance
};
#endif
\ No newline at end of file
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: SketcherPrs_SymbolPrs(theConstraint, thePlane)
{
- myPntArray = new Graphic3d_ArrayOfPoints(2);
- myPntArray->AddVertex(0., 0., 0.);
-}
+}
bool SketcherPrs_Middle::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>&/* thePlane*/)
SketcherPrs_Radius::SketcherPrs_Radius(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
-: AIS_RadiusDimension(MyDefCirc), myConstraint(theConstraint), mySketcherPlane(thePlane)
+: AIS_RadiusDimension(MyDefCirc), myConstraint(theConstraint), mySketcherPlane(thePlane),
+ myCircle(MyDefCirc),
+ myAnchorPoint(gp_Pnt(0, 0, 2)),
+ myHasParameters(false),
+ myValue(""),
+ myRadius(1)
{
SetDimensionAspect(SketcherPrs_Tools::createDimensionAspect());
SetSelToleranceForText2d(SketcherPrs_Tools::getDefaultTextHeight());
SketcherPrs_DimensionStyleListener* myStyleListener;
/// container of values obtained from the constraint, which are necessary to fill the presentation
- double myRadius; ///< the radius custom value
gp_Circ myCircle; ///< the radius circle
gp_Pnt myAnchorPoint; ///< an ancor for the radius value visualization
-
bool myHasParameters; ///< true if the atrribute value has used parameters
std::string myValue; ///< dimension value
+ double myRadius; ///< the radius custom value
};
#endif
\ No newline at end of file
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: SketcherPrs_SymbolPrs(theConstraint, thePlane)
{
- // Set default points array
- myPntArray = new Graphic3d_ArrayOfPoints(1);
- myPntArray->AddVertex(0., 0., 0.);
-}
+}
bool SketcherPrs_Rigid::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
const std::shared_ptr<GeomAPI_Ax3>& thePlane)
: AIS_InteractiveObject(), myConstraint(theConstraint), myPlane(thePlane), myIsConflicting(false)
{
SetAutoHilight(Standard_False);
+ myPntArray = new Graphic3d_ArrayOfPoints(1);
+ myPntArray->AddVertex(0., 0., 0.);
}
SketcherPrs_SymbolPrs::~SketcherPrs_SymbolPrs()