mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0024339: Vectors not displayed correctly in MFC samples [6.7.0 Beta]: ISession_Direction classes were rewritten without using of DsgPrs_LengthPresentation class.
Corrections to support old results in geometry samples: added ISession_Direction::SetLineAspect(); ISession_Direction class in Modeling sample was corrected.
This commit is contained in:
@@ -36,13 +36,19 @@ void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& /*a
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer /*aMode*/)
|
||||
{
|
||||
Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();
|
||||
anArrowAspect->SetLength(myStartPnt.Distance(myEndPnt));
|
||||
myDrawer->SetArrowAspect(anArrowAspect);
|
||||
// Set style for arrow
|
||||
Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();
|
||||
|
||||
DsgPrs_LengthPresentation::Add(aPresentation,myDrawer,
|
||||
myStartPnt,myEndPnt,
|
||||
DsgPrs_AS_LASTAR);
|
||||
// Draw Line
|
||||
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments (2);
|
||||
aPrims->AddVertex (myStartPnt);
|
||||
aPrims->AddVertex (myEndPnt);
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect());
|
||||
Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (aPrims);
|
||||
// Draw arrow
|
||||
Prs3d_Arrow::Draw (aPresentation,
|
||||
myEndPnt,
|
||||
gp_Dir (gp_Vec(myStartPnt, myEndPnt)),
|
||||
anArrowAspect->Angle(),
|
||||
anArrowAspect->Length());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -17,23 +17,27 @@
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
|
||||
DEFINE_STANDARD_HANDLE(ISession_Direction,AIS_InteractiveObject)
|
||||
class ISession_Direction : public AIS_InteractiveObject
|
||||
class ISession_Direction : public AIS_InteractiveObject
|
||||
{
|
||||
public:
|
||||
ISession_Direction();
|
||||
ISession_Direction();
|
||||
ISession_Direction(const gp_Pnt& aPnt,const gp_Pnt& aPnt2);
|
||||
ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec);
|
||||
|
||||
DEFINE_STANDARD_RTTI(ISession_Direction)
|
||||
DEFINE_STANDARD_RTTI(ISession_Direction)
|
||||
|
||||
private:
|
||||
|
||||
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer aMode);
|
||||
void ComputeSelection(const class Handle_SelectMgr_Selection &,const int){};
|
||||
gp_Pnt myStartPnt;
|
||||
gp_Pnt myEndPnt;
|
||||
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer aMode);
|
||||
|
||||
void ComputeSelection (const class Handle_SelectMgr_Selection &,const int){};
|
||||
|
||||
private:
|
||||
|
||||
gp_Pnt myStartPnt;
|
||||
gp_Pnt myEndPnt;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_ISession_Direction_H__767C0DB3_A3B0_11D1_8DA3_0800369C8A03__INCLUDED_)
|
||||
|
@@ -57,6 +57,8 @@
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <BRepBuilderAPI_GTransform.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
#include <BRepPrimAPI_MakeCone.hxx>
|
||||
@@ -125,6 +127,9 @@
|
||||
#include <Plate_PinpointConstraint.hxx>
|
||||
#include <Plate_D1.hxx>
|
||||
#include <Plate_GtoCConstraint.hxx>
|
||||
#include <Prs3d_Arrow.hxx>
|
||||
#include <Prs3d_LineAspect.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <GeomPlate_Surface.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <GCE2d_MakeSegment.hxx>
|
||||
|
Reference in New Issue
Block a user