-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "EntityGUI_3DSketcherDlg.h"
#include "EntityGUI_Widgets.h"
-#include <Basics_OCCTVersion.hxx>
-
#include <GEOMBase.h>
#include <GeometryGUI.h>
#include <Precision.hxx>
class AIS_Text:public AIS_InteractiveObject
{
public:
- // CASCADE RTTI
- DEFINE_STANDARD_RTTI(AIS_Text );
+ DEFINE_STANDARD_RTTIEXT(AIS_Text,AIS_InteractiveObject)
AIS_Text(){};
Graphic3d_VerticalTextAlignment aVJustification;
};
-IMPLEMENT_STANDARD_HANDLE(AIS_Text, AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(AIS_Text, AIS_InteractiveObject)
AIS_Text::AIS_Text( const TCollection_ExtendedString& text, const gp_Pnt& position,
aPresentation->Clear();
- Handle_Prs3d_TextAspect asp = myDrawer->TextAspect();
+ Handle(Prs3d_TextAspect) asp = myDrawer->TextAspect();
asp->SetFont(aFont);
asp->SetColor(aColor);
aSelMgr->GetIndexes(aSelList.First(), aMap);
if (aMap.Extent() == 1) {
int anIndex = aMap(1);
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations();
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
}
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_3DSketcherDlg::createOperation()
{
- return getGeomEngine()->GetICurvesOperations(getStudyId());
+ return getGeomEngine()->GetICurvesOperations();
}
//=================================================================================
// MESSAGE("aCommands.last() = "<< aCommands.last().toStdString());
GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow(getOperation());
//GEOM::GEOM_Object_var anObj = anOper->Make3DSketcher(aCoordsArray);
- GEOM::GEOM_Object_var anObj = anOper->Make3DSketcherCommand(aCommands.join(":").toLatin1().constData());
+ GEOM::GEOM_Object_var anObj = anOper->Make3DSketcherCommand(aCommands.join(":").toUtf8().constData());
if (!anObj->_is_nil()) {
- if (!IsPreview()) anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ if (!IsPreview()) anObj->SetParameters(aParameters.join(":").toUtf8().constData());
objects.push_back(anObj._retn());
}
gp_Vec V = Vec1.Transformed(aTransform.Inverted());
gp_Vec Vec3(V.X(),V.Y(),0.0);
- // Express the coordinates in the refernce coordinate system (OXY)
+ // Express the coordinates in the reference coordinate system (OXY)
Vec3.Transform(aTransform);
if(Abs(Vec1.CrossMagnitude(Vec3)) > Precision::Confusion())
{
{
// Add trihedron to preview
SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
-
+
+ SOCC_Viewer* anOCCViewer = dynamic_cast<SOCC_Viewer*>( vw->getViewManager()->getViewModel() );
+ if( !anOCCViewer )
+ return;
+
+ Handle(AIS_InteractiveContext) anAISContext = anOCCViewer->getAISContext();
+ if( !anAISContext )
+ return;
+
gp_Pnt P(getLastPoint().x,getLastPoint().y,getLastPoint().z);
Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement(P,gp::DZ(),gp::DX());
Handle(AIS_Trihedron) anIO = new AIS_Trihedron(anAxis);
- anIO->SetSelectionMode(selMode);
- SOCC_Prs* aSPrs = dynamic_cast<SOCC_Prs*>
- (((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
+ SOCC_Prs* aSPrs = dynamic_cast<SOCC_Prs*>( anOCCViewer->CreatePrs(0) );
if (aSPrs) {
aSPrs->PrependObject(anIO);
GEOMBase_Helper::displayPreview(aSPrs, true, true);
}
+ anAISContext->Activate(anIO, selMode);
}
//================================================================
aLength * sin(anAngle1 * M_PI / 180. ),
0.0);
- // Express the coordinates in the refernce coordinate system (OXY)
- gp_Trsf aTranform = toReferenceSystem(P0);
- P1.Transform(aTranform);
- P2.Transform(aTranform);
+ // Express the coordinates in the reference coordinate system (OXY)
+ gp_Trsf aTransform = toReferenceSystem(P0);
+ P1.Transform(aTransform);
+ P2.Transform(aTransform);
P1.Translate(Origin, P0);
P2.Translate(Origin, P0);
P0,
P1,
P2);
- if (anAngleIO == NULL)
+ if (anAngleIO.IsNull())
return;
if (store)
//================================================================
// Function : createAISLengthDimension()
// Purpose : Method for creation of a length dimension object
-// Returns an Handle on the AIS_LengthDimension obect
+// Returns an Handle on the AIS_LengthDimension object
//================================================================
Handle(AIS_LengthDimension) EntityGUI_3DSketcherDlg::createAISLengthDimension(double theLength,
gp_Pnt P1,
//================================================================
// Function : createAISAngleDimension()
// Purpose : Method for creation of an angle dimension object
-// Returns an Handle on the AIS_AngleDimension obect
+// Returns an Handle on the AIS_AngleDimension object
//================================================================
Handle(AIS_AngleDimension) EntityGUI_3DSketcherDlg::createAISAngleDimension(double theAngle,
gp_Pnt P0,