From b18d3a463f8c666fbbe65f760b055f0634a338ff Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 4 Jun 2014 12:47:17 +0400 Subject: [PATCH] Code correction: names of methods should start from a small letter. --- src/PartSet/PartSet_Listener.cpp | 6 +- src/PartSet/PartSet_Module.cpp | 42 ++++++------ src/PartSet/PartSet_OperationConstraint.cpp | 18 +++--- src/PartSet/PartSet_OperationEditLine.cpp | 6 +- src/PartSet/PartSet_OperationSketch.cpp | 2 +- src/PartSet/PartSet_OperationSketchLine.cpp | 20 +++--- src/PartSet/PartSet_Presentation.cpp | 4 +- src/PartSet/PartSet_TestOCC.cpp | 20 +++--- src/PartSet/PartSet_Tools.cpp | 24 +++---- src/PartSet/PartSet_Tools.h | 14 ++-- src/XGUI/XGUI_ContextMenuMgr.cpp | 2 +- src/XGUI/XGUI_Displayer.cpp | 72 ++++++++++----------- src/XGUI/XGUI_Displayer.h | 34 +++++----- 13 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/PartSet/PartSet_Listener.cpp b/src/PartSet/PartSet_Listener.cpp index fbe248532..e27fb725d 100644 --- a/src/PartSet/PartSet_Listener.cpp +++ b/src/PartSet/PartSet_Listener.cpp @@ -44,14 +44,14 @@ void PartSet_Listener::processEvent(const Events_Message* theMessage) aLast = aFeatures.end(); for (; anIt != aLast; anIt++) { boost::shared_ptr aFeature = *anIt; - if (myModule->workshop()->displayer()->IsVisible(aFeature) || + if (myModule->workshop()->displayer()->isVisible(aFeature) || aType == EVENT_FEATURE_CREATED) { myModule->visualizePreview(aFeature, true, false); //if (aType == EVENT_FEATURE_CREATED) myModule->activateFeature(aFeature, true); } } - myModule->workshop()->displayer()->UpdateViewer(); + myModule->workshop()->displayer()->updateViewer(); } if (aType == EVENT_FEATURE_DELETED) { @@ -63,7 +63,7 @@ void PartSet_Listener::processEvent(const Events_Message* theMessage) for (; anIt != aLast; anIt++) { std::string aGroup = *anIt; if (aGroup.compare("Sketch") == 0) { // Update only Sketch group - myModule->workshop()->displayer()->EraseDeletedFeatures(); + myModule->workshop()->displayer()->eraseDeletedFeatures(); myModule->updateCurrentPreview(aGroup); } } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index cc0c127f5..a7b2f6dd9 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -170,8 +170,8 @@ void PartSet_Module::onMousePressed(QMouseEvent* theEvent) if (aPreviewOp) { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - std::list aSelected = aDisplayer->GetSelected(); - std::list aHighlighted = aDisplayer->GetHighlighted(); + std::list aSelected = aDisplayer->getSelected(); + std::list aHighlighted = aDisplayer->getHighlighted(); aPreviewOp->mousePressed(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted); } @@ -184,8 +184,8 @@ void PartSet_Module::onMouseReleased(QMouseEvent* theEvent) if (aPreviewOp) { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - std::list aSelected = aDisplayer->GetSelected(); - std::list aHighlighted = aDisplayer->GetHighlighted(); + std::list aSelected = aDisplayer->getSelected(); + std::list aHighlighted = aDisplayer->getHighlighted(); aPreviewOp->mouseReleased(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted); } @@ -229,8 +229,8 @@ void PartSet_Module::onLaunchOperation(std::string theName, boost::shared_ptrdisplayer(); // refill the features list with avoiding of the features, obtained only by vertex shape (TODO) - std::list aSelected = aDisplayer->GetSelected(TopAbs_VERTEX); - std::list aHighlighted = aDisplayer->GetHighlighted(TopAbs_VERTEX); + std::list aSelected = aDisplayer->getSelected(TopAbs_VERTEX); + std::list aHighlighted = aDisplayer->getHighlighted(TopAbs_VERTEX); aPreviewOp->init(theFeature, aSelected, aHighlighted); } else { anOperation->setFeature(theFeature); @@ -255,25 +255,25 @@ void PartSet_Module::onStopSelection(const std::list& theFeature activateFeature((*anIt).feature(), false); } } - aDisplayer->StopSelection(theFeatures, isStop, false); + aDisplayer->stopSelection(theFeatures, isStop, false); XGUI_ViewerProxy* aViewer = myWorkshop->viewer(); aViewer->enableSelection(!isStop); - aDisplayer->UpdateViewer(); + aDisplayer->updateViewer(); } void PartSet_Module::onSetSelection(const std::list& theFeatures) { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - aDisplayer->SetSelected(theFeatures, false); - aDisplayer->UpdateViewer(); + aDisplayer->setSelected(theFeatures, false); + aDisplayer->updateViewer(); } void PartSet_Module::onCloseLocalContext() { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - aDisplayer->CloseLocalContexts(); + aDisplayer->closeLocalContexts(); } void PartSet_Module::onFeatureConstructed(boost::shared_ptr theFeature, @@ -297,7 +297,7 @@ void PartSet_Module::onFeatureConstructed(boost::shared_ptr th boost::shared_ptr aFeature = (*anIt).first; visualizePreview(aFeature, false, false); } - aDisplayer->UpdateViewer(); + aDisplayer->updateViewer(); } } @@ -401,19 +401,19 @@ void PartSet_Module::visualizePreview(boost::shared_ptr theFea Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation( theFeature, aPreviewOp->sketch(), aPreview ? aPreview->impl() : TopoDS_Shape(), - aDisplayer->GetAISObject(theFeature)); + aDisplayer->getAISObject(theFeature)); int aSelectionMode = -1; if (theFeature->getKind() == "SketchConstraintLength") { aSelectionMode = AIS_DSM_Text; } - aDisplayer->Redisplay(theFeature, anAIS, aSelectionMode, false); + aDisplayer->redisplay(theFeature, anAIS, aSelectionMode, false); } else - aDisplayer->Erase(theFeature, false); + aDisplayer->erase(theFeature, false); if (isUpdateViewer) - aDisplayer->UpdateViewer(); + aDisplayer->updateViewer(); } void PartSet_Module::activateFeature(boost::shared_ptr theFeature, @@ -423,7 +423,7 @@ void PartSet_Module::activateFeature(boost::shared_ptr theFeat PartSet_OperationSketchBase* aPreviewOp = dynamic_cast(anOperation); if (aPreviewOp) { XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - aDisplayer->ActivateInLocalContext(theFeature, aPreviewOp->getSelectionModes(theFeature), + aDisplayer->activateInLocalContext(theFeature, aPreviewOp->getSelectionModes(theFeature), isUpdateViewer); } } @@ -455,12 +455,12 @@ void PartSet_Module::updateCurrentPreview(const std::string& theCmdId) Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation( aFeature, aPreviewOp->sketch(), aPreview ? aPreview->impl() : TopoDS_Shape(), - aDisplayer->GetAISObject(aFeature)); + aDisplayer->getAISObject(aFeature)); if (!anAIS.IsNull()) - aDisplayer->Redisplay(aFeature, anAIS, -1, false); - aDisplayer->ActivateInLocalContext(aFeature, aModes, false); + aDisplayer->redisplay(aFeature, anAIS, -1, false); + aDisplayer->activateInLocalContext(aFeature, aModes, false); } - aDisplayer->UpdateViewer(); + aDisplayer->updateViewer(); } void PartSet_Module::editFeature(FeaturePtr theFeature) diff --git a/src/PartSet/PartSet_OperationConstraint.cpp b/src/PartSet/PartSet_OperationConstraint.cpp index 6ad9a3108..76c7db50e 100644 --- a/src/PartSet/PartSet_OperationConstraint.cpp +++ b/src/PartSet/PartSet_OperationConstraint.cpp @@ -91,10 +91,10 @@ void PartSet_OperationConstraint::mouseReleased(QMouseEvent* theEvent, Handle(V3 double aX, anY; bool isFoundPoint = false; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); */ if (theSelected.empty()) { - //PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + //PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); //isFoundPoint = true; } else { @@ -112,7 +112,7 @@ void PartSet_OperationConstraint::mouseReleased(QMouseEvent* theEvent, Handle(V3 const TopoDS_Vertex& aVertex = TopoDS::Vertex(aShape); if (!aVertex.IsNull()) { aPoint = BRep_Tool::Pnt(aVertex); - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); isFoundPoint = true; setConstraints(aX, anY); @@ -126,15 +126,15 @@ void PartSet_OperationConstraint::mouseReleased(QMouseEvent* theEvent, Handle(V3 double Y0, Y1, Y2, Y3; getLinePoint(aFeature, LINE_ATTR_START, X2, Y2); getLinePoint(aFeature, LINE_ATTR_END, X3, Y3); - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, X1, Y1); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, X1, Y1); switch (myPointSelectionMode) { case SM_FirstPoint: - PartSet_Tools::ProjectPointOnLine(X2, Y2, X3, Y3, X1, Y1, aX, anY); + PartSet_Tools::projectPointOnLine(X2, Y2, X3, Y3, X1, Y1, aX, anY); break; case SM_SecondPoint: { getLinePoint(feature(), LINE_ATTR_START, X0, Y0); - PartSet_Tools::IntersectLines(X0, Y0, X1, Y1, X2, Y2, X3, Y3, aX, anY); + PartSet_Tools::intersectLines(X0, Y0, X1, Y1, X2, Y2, X3, Y3, aX, anY); } break; default: @@ -174,8 +174,8 @@ void PartSet_OperationConstraint::mouseMoved(QMouseEvent* theEvent, Handle(V3d_V { case SM_FirstPoint: { double aX, anY; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); setLinePoint(feature(), aX, anY, LINE_ATTR_START); setLinePoint(feature(), aX, anY, LINE_ATTR_END); flushUpdated(); @@ -184,7 +184,7 @@ void PartSet_OperationConstraint::mouseMoved(QMouseEvent* theEvent, Handle(V3d_V break; case SM_SecondPoint: { - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); setLinePoint(aPoint, theView, LINE_ATTR_END); flushUpdated(); emit focusActivated(LINE_ATTR_END); diff --git a/src/PartSet/PartSet_OperationEditLine.cpp b/src/PartSet/PartSet_OperationEditLine.cpp index 2edee70af..7b1a92884 100644 --- a/src/PartSet/PartSet_OperationEditLine.cpp +++ b/src/PartSet/PartSet_OperationEditLine.cpp @@ -119,15 +119,15 @@ void PartSet_OperationEditLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_Vie if (!(theEvent->buttons() & Qt::LeftButton)) return; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); blockSelection(true); if (myCurPoint.myIsInitialized) { double aCurX, aCurY; - PartSet_Tools::ConvertTo2D(myCurPoint.myPoint, sketch(), theView, aCurX, aCurY); + PartSet_Tools::convertTo2D(myCurPoint.myPoint, sketch(), theView, aCurX, aCurY); double aX, anY; - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); double aDeltaX = aX - aCurX; double aDeltaY = anY - aCurY; diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index abdf6b3c1..5c78cabc1 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -135,7 +135,7 @@ void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) return; if (myFeatures.size() != 1) { - boost::shared_ptr aFeature = PartSet_Tools::NearestFeature(theEvent->pos(), + boost::shared_ptr aFeature = PartSet_Tools::nearestFeature(theEvent->pos(), theView, feature(), myFeatures); if (aFeature) restartOperation(PartSet_OperationEditLine::Type(), aFeature); diff --git a/src/PartSet/PartSet_OperationSketchLine.cpp b/src/PartSet/PartSet_OperationSketchLine.cpp index 1a1cdbc0e..9a971ac48 100644 --- a/src/PartSet/PartSet_OperationSketchLine.cpp +++ b/src/PartSet/PartSet_OperationSketchLine.cpp @@ -104,9 +104,9 @@ void PartSet_OperationSketchLine::mouseReleased(QMouseEvent* theEvent, Handle(V3 double aX, anY; bool isFoundPoint = false; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); if (theSelected.empty()) { - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); isFoundPoint = true; } else { @@ -118,7 +118,7 @@ void PartSet_OperationSketchLine::mouseReleased(QMouseEvent* theEvent, Handle(V3 const TopoDS_Vertex& aVertex = TopoDS::Vertex(aShape); if (!aVertex.IsNull()) { aPoint = BRep_Tool::Pnt(aVertex); - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); isFoundPoint = true; setConstraints(aX, anY); @@ -132,15 +132,15 @@ void PartSet_OperationSketchLine::mouseReleased(QMouseEvent* theEvent, Handle(V3 double Y0, Y1, Y2, Y3; getLinePoint(aFeature, LINE_ATTR_START, X2, Y2); getLinePoint(aFeature, LINE_ATTR_END, X3, Y3); - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, X1, Y1); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, X1, Y1); switch (myPointSelectionMode) { case SM_FirstPoint: - PartSet_Tools::ProjectPointOnLine(X2, Y2, X3, Y3, X1, Y1, aX, anY); + PartSet_Tools::projectPointOnLine(X2, Y2, X3, Y3, X1, Y1, aX, anY); break; case SM_SecondPoint: { getLinePoint(feature(), LINE_ATTR_START, X0, Y0); - PartSet_Tools::IntersectLines(X0, Y0, X1, Y1, X2, Y2, X3, Y3, aX, anY); + PartSet_Tools::intersectLines(X0, Y0, X1, Y1, X2, Y2, X3, Y3, aX, anY); } break; default: @@ -180,8 +180,8 @@ void PartSet_OperationSketchLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_V { case SM_FirstPoint: { double aX, anY; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); - PartSet_Tools::ConvertTo2D(aPoint, sketch(), theView, aX, anY); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); + PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY); setLinePoint(feature(), aX, anY, LINE_ATTR_START); setLinePoint(feature(), aX, anY, LINE_ATTR_END); flushUpdated(); @@ -190,7 +190,7 @@ void PartSet_OperationSketchLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_V break; case SM_SecondPoint: { - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(theEvent->pos(), theView); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView); setLinePoint(aPoint, theView, LINE_ATTR_END); flushUpdated(); emit focusActivated(LINE_ATTR_END); @@ -411,7 +411,7 @@ void PartSet_OperationSketchLine::setLinePoint(const gp_Pnt& thePoint, const std::string& theAttribute) { double aX, anY; - PartSet_Tools::ConvertTo2D(thePoint, sketch(), theView, aX, anY); + PartSet_Tools::convertTo2D(thePoint, sketch(), theView, aX, anY); boost::shared_ptr aData = feature()->data(); boost::shared_ptr aPoint = boost::dynamic_pointer_cast(aData->attribute(theAttribute)); diff --git a/src/PartSet/PartSet_Presentation.cpp b/src/PartSet/PartSet_Presentation.cpp index fa1b21f5f..7c4de78d0 100644 --- a/src/PartSet/PartSet_Presentation.cpp +++ b/src/PartSet/PartSet_Presentation.cpp @@ -110,8 +110,8 @@ Handle(AIS_InteractiveObject) PartSet_Presentation::createSketchConstraintLength boost::dynamic_pointer_cast(aData->attribute(LINE_ATTR_END)); gp_Pnt aPoint1, aPoint2; - PartSet_Tools::ConvertTo3D(aPointStart->x(), aPointStart->y(), theSketch, aPoint1); - PartSet_Tools::ConvertTo3D(aPointEnd->x(), aPointEnd->y(), theSketch, aPoint2); + PartSet_Tools::convertTo3D(aPointStart->x(), aPointStart->y(), theSketch, aPoint1); + PartSet_Tools::convertTo3D(aPointEnd->x(), aPointEnd->y(), theSketch, aPoint2); //Build dimension here gp_Pnt aP1 = aPoint1; diff --git a/src/PartSet/PartSet_TestOCC.cpp b/src/PartSet/PartSet_TestOCC.cpp index 59523f1cc..d56025223 100644 --- a/src/PartSet/PartSet_TestOCC.cpp +++ b/src/PartSet/PartSet_TestOCC.cpp @@ -37,7 +37,7 @@ void PartSet_TestOCC::testSelection(XGUI_Workshop* theWorkshop) theWorkshop->viewer()->activeView()); PartSet_TestOCC::changeTestLine(theWorkshop); } - Handle(AIS_InteractiveObject) anIO = theWorkshop->displayer()->GetAISObject(myTestFeature); + Handle(AIS_InteractiveObject) anIO = theWorkshop->displayer()->getAISObject(myTestFeature); if (!anIO.IsNull()) { theWorkshop->viewer()->AISContext()->MoveTo(0, 0, theWorkshop->viewer()->activeView()); theWorkshop->viewer()->AISContext()->Select(0, 0, 2500, 2500, theWorkshop->viewer()->activeView()); @@ -152,12 +152,12 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) aFeature, aSketch, aPreview ? aPreview->impl() : TopoDS_Shape(), NULL); if (!anAIS.IsNull()) - aDisplayer->Redisplay(aFeature, anAIS, -1, false); + aDisplayer->redisplay(aFeature, anAIS, -1, false); std::list aModes; aModes.push_back(TopAbs_VERTEX); aModes.push_back(TopAbs_EDGE); - aDisplayer->ActivateInLocalContext(aFeature, aModes, true); + aDisplayer->activateInLocalContext(aFeature, aModes, true); // change the line /*double aDelta = -200; @@ -171,7 +171,7 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) aFeature, aSketch, aPreview ? aPreview->impl() : TopoDS_Shape(), NULL); if (!anAIS.IsNull()) - aDisplayer->Redisplay(aFeature, anAIS, -1, true); + aDisplayer->redisplay(aFeature, anAIS, -1, true); int aVal = 90; for (int j = 0; j < 10000000; j++) @@ -181,12 +181,12 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) //aModes.clear(); //aModes.push_back(TopAbs_VERTEX); //aModes.push_back(TopAbs_EDGE); - //aDisplayer->ActivateInLocalContext(aFeature, aModes, true); + //aDisplayer->activateInLocalContext(aFeature, aModes, true); myTestFeature = aFeature; std::list aPrs; aPrs.push_back(XGUI_ViewerPrs(myTestFeature, TopoDS_Shape(), NULL)); - aDisplayer->SetSelected(aPrs, true); + aDisplayer->setSelected(aPrs, true); } } @@ -210,18 +210,18 @@ void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop) aPreview ? aPreview->impl() : TopoDS_Shape(), aPrevAIS); if (!anAIS.IsNull()) - theWorkshop->displayer()->Redisplay(aFeature, anAIS, -1, true); + theWorkshop->displayer()->redisplay(aFeature, anAIS, -1, true); //std::list aModes; //aModes.clear(); //aModes.push_back(TopAbs_VERTEX); //aModes.push_back(TopAbs_EDGE); - //aDisplayer->ActivateInLocalContext(aFeature, aModes, true); + //aDisplayer->activateInLocalContext(aFeature, aModes, true); /*std::list aPrs; aPrs.push_back(XGUI_ViewerPrs(myTestFeature, TopoDS_Shape())); - theWorkshop->displayer()->SetSelected(aPrs, true);*/ + theWorkshop->displayer()->setSelected(aPrs, true);*/ - theWorkshop->displayer()->UpdateViewer(); + theWorkshop->displayer()->updateViewer(); } void PartSet_TestOCC::moveMouse(Handle(AIS_InteractiveContext) theContext, Handle(V3d_View) theView) diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 596c86756..b526342b6 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -32,7 +32,7 @@ const double PRECISION_TOLERANCE = 0.000001; -gp_Pnt PartSet_Tools::ConvertClickToPoint(QPoint thePoint, Handle(V3d_View) theView) +gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theView) { if (theView.IsNull()) return gp_Pnt(); @@ -57,7 +57,7 @@ gp_Pnt PartSet_Tools::ConvertClickToPoint(QPoint thePoint, Handle(V3d_View) theV return ResultPoint; } -void PartSet_Tools::ConvertTo2D(const gp_Pnt& thePoint, boost::shared_ptr theSketch, +void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr theSketch, Handle(V3d_View) theView, double& theX, double& theY) { if (!theSketch) @@ -103,7 +103,7 @@ void PartSet_Tools::ConvertTo2D(const gp_Pnt& thePoint, boost::shared_ptrx() + aVec.Y() * anY->y() + aVec.Z() * anY->z(); } -void PartSet_Tools::ConvertTo3D(const double theX, const double theY, +void PartSet_Tools::convertTo3D(const double theX, const double theY, boost::shared_ptr theSketch, gp_Pnt& thePoint) { @@ -126,7 +126,7 @@ void PartSet_Tools::ConvertTo3D(const double theX, const double theY, thePoint = gp_Pnt(aPoint->x(), aPoint->y(), aPoint->z()); } -void PartSet_Tools::IntersectLines(double theX0, double theY0, double theX1, double theY1, +void PartSet_Tools::intersectLines(double theX0, double theY0, double theX1, double theY1, double theX2, double theY2, double theX3, double theY3, double& theX, double& theY) { @@ -146,11 +146,11 @@ void PartSet_Tools::IntersectLines(double theX0, double theY0, double theX1, dou //It is not possible to use Precision::Confusion(), because it is e-0.8, but V is sometimes e-6 Standard_Real aPrec = PRECISION_TOLERANCE; if (fabs(theX - theX0) < aPrec && fabs(theY - theY0) < aPrec) { - ProjectPointOnLine(theX2, theY2, theX3, theY3, theX1, theY1, theX, theY); + projectPointOnLine(theX2, theY2, theX3, theY3, theX1, theY1, theX, theY); } } -void PartSet_Tools::ProjectPointOnLine(double theX1, double theY1, double theX2, double theY2, +void PartSet_Tools::projectPointOnLine(double theX1, double theY1, double theX2, double theY2, double thePointX, double thePointY, double& theX, double& theY) { theX = theY = 0; @@ -167,14 +167,14 @@ void PartSet_Tools::ProjectPointOnLine(double theX1, double theY1, double theX2, } } -boost::shared_ptr PartSet_Tools::NearestFeature(QPoint thePoint, +boost::shared_ptr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theView, boost::shared_ptr theSketch, const std::list& theFeatures) { double aX, anY; - gp_Pnt aPoint = PartSet_Tools::ConvertClickToPoint(thePoint, theView); - PartSet_Tools::ConvertTo2D(aPoint, theSketch, theView, aX, anY); + gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(thePoint, theView); + PartSet_Tools::convertTo2D(aPoint, theSketch, theView, aX, anY); boost::shared_ptr aFeature; std::list::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end(); @@ -186,7 +186,7 @@ boost::shared_ptr PartSet_Tools::NearestFeature(QPoint thePoin aPrs = *anIt; if (!aPrs.feature()) continue; - double aDelta = DistanceToPoint(aPrs.feature(), aX, anY); + double aDelta = distanceToPoint(aPrs.feature(), aX, anY); if (aMinDelta < 0 || aMinDelta > aDelta) { aMinDelta = aDelta; aDeltaFeature = aPrs.feature(); @@ -195,7 +195,7 @@ boost::shared_ptr PartSet_Tools::NearestFeature(QPoint thePoin return aDeltaFeature; } -double PartSet_Tools::DistanceToPoint(boost::shared_ptr theFeature, +double PartSet_Tools::distanceToPoint(boost::shared_ptr theFeature, double theX, double theY) { double aDelta = 0; @@ -210,7 +210,7 @@ double PartSet_Tools::DistanceToPoint(boost::shared_ptr theFea boost::dynamic_pointer_cast(aData->attribute(LINE_ATTR_END)); double aX, anY; - PartSet_Tools::ProjectPointOnLine(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y(), theX, theY, aX, anY); + PartSet_Tools::projectPointOnLine(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y(), theX, theY, aX, anY); aDelta = gp_Pnt(theX, theY, 0).Distance(gp_Pnt(aX, anY, 0)); diff --git a/src/PartSet/PartSet_Tools.h b/src/PartSet/PartSet_Tools.h index 116b58e82..b0778b5e1 100644 --- a/src/PartSet/PartSet_Tools.h +++ b/src/PartSet/PartSet_Tools.h @@ -29,14 +29,14 @@ public: /// Converts the 2D screen point to the 3D point on the view according to the point of view /// \param thePoint a screen point /// \param theView a 3D view - static gp_Pnt ConvertClickToPoint(QPoint thePoint, Handle_V3d_View theView); + static gp_Pnt convertClickToPoint(QPoint thePoint, Handle_V3d_View theView); /// \brief Converts the 3D point to the projected coodinates on the sketch plane. /// \param thePoint the 3D point in the viewer /// \param theSketch the sketch feature /// \param theX the X coordinate /// \param theY the Y coordinate - static void ConvertTo2D(const gp_Pnt& thePoint, boost::shared_ptr theSketch, + static void convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr theSketch, Handle(V3d_View) theView, double& theX, double& theY); /// \brief Converts the 2D projected coodinates on the sketch plane to the 3D point. @@ -44,7 +44,7 @@ public: /// \param theY the Y coordinate /// \param theSketch the sketch feature /// \param thePoint the 3D point in the viewer - static void ConvertTo3D(const double theX, const double theY, + static void convertTo3D(const double theX, const double theY, boost::shared_ptr theSketch, gp_Pnt& thePoint); @@ -60,7 +60,7 @@ public: /// \param theY3 the vertical coordinate of 3 point /// \param theX the output horizontal coordinate of the intersection point /// \param theY the outpup vertical coordinate of the intersection point - static void IntersectLines(double theX0, double theY0, double theX1, double theY1, + static void intersectLines(double theX0, double theY0, double theX1, double theY1, double theX2, double theY2, double theX3, double theY3, double& theX, double& theY); @@ -71,7 +71,7 @@ public: /// \param theY1 the vertical coordinate of the first line point /// \param theX2 the horizontal coordinate of the second line point /// \param theY2 the vertical coordinate of the second line point - static void ProjectPointOnLine(double theX1, double theY1, double theX2, double theY2, + static void projectPointOnLine(double theX1, double theY1, double theX2, double theY2, double thePointX, double thePointY, double& theX, double& theY); /// Returns a feature that is under the mouse point @@ -79,7 +79,7 @@ public: /// \param theView a 3D view /// \param theSketch the sketch feature /// \param theFeatures the list of selected presentations - static boost::shared_ptr NearestFeature(QPoint thePoint, Handle_V3d_View theView, + static boost::shared_ptr nearestFeature(QPoint thePoint, Handle_V3d_View theView, boost::shared_ptr theSketch, const std::list& theFeatures); private: @@ -87,7 +87,7 @@ private: /// \param theFeature feature object /// \param theX the horizontal coordinate of the point /// \param theX the vertical coordinate of the point - static double DistanceToPoint(boost::shared_ptr theFeature, + static double distanceToPoint(boost::shared_ptr theFeature, double theX, double theY); }; diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 0abbb09ff..32c961026 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -107,7 +107,7 @@ QMenu* XGUI_ContextMenuMgr::objectBrowserMenu() const aMenu->addAction(action("EDIT_CMD")); XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - if (aDisplayer->IsVisible(aFeature)) + if (aDisplayer->isVisible(aFeature)) aMenu->addAction(action("HIDE_CMD")); else aMenu->addAction(action("SHOW_CMD")); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 3a2661e19..2321f4874 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -32,15 +32,15 @@ XGUI_Displayer::~XGUI_Displayer() { } -bool XGUI_Displayer::IsVisible(boost::shared_ptr theFeature) +bool XGUI_Displayer::isVisible(boost::shared_ptr theFeature) { return myFeature2AISObjectMap.find(theFeature) != myFeature2AISObjectMap.end(); } -void XGUI_Displayer::Display(boost::shared_ptr theFeature, - const bool isUpdateViewer) -{ -} +//void XGUI_Displayer::Display(boost::shared_ptr theFeature, +// const bool isUpdateViewer) +//{ +//} /*void XGUI_Displayer::Display(boost::shared_ptr theFeature, const TopoDS_Shape& theShape, const bool isUpdateViewer) @@ -52,11 +52,11 @@ void XGUI_Displayer::Display(boost::shared_ptr theFeature, aContext->Display(anAIS, Standard_False); if (isUpdateViewer) - UpdateViewer(); + updateViewer(); }*/ -std::list XGUI_Displayer::GetSelected(const int theShapeTypeToSkip) +std::list XGUI_Displayer::getSelected(const int theShapeTypeToSkip) { std::set > aPrsFeatures; std::list aPresentations; @@ -69,7 +69,7 @@ std::list XGUI_Displayer::GetSelected(const int theShapeTypeToSk if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip) continue; - boost::shared_ptr aFeature = GetFeature(anIO); + boost::shared_ptr aFeature = getFeature(anIO); if (aPrsFeatures.find(aFeature) != aPrsFeatures.end()) continue; Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner(); @@ -79,7 +79,7 @@ std::list XGUI_Displayer::GetSelected(const int theShapeTypeToSk return aPresentations; } -std::list XGUI_Displayer::GetHighlighted(const int theShapeTypeToSkip) +std::list XGUI_Displayer::getHighlighted(const int theShapeTypeToSkip) { std::set > aPrsFeatures; std::list aPresentations; @@ -91,7 +91,7 @@ std::list XGUI_Displayer::GetHighlighted(const int theShapeTypeT if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip) continue; - boost::shared_ptr aFeature = GetFeature(anIO); + boost::shared_ptr aFeature = getFeature(anIO); if (aPrsFeatures.find(aFeature) != aPrsFeatures.end()) continue; aPresentations.push_back(XGUI_ViewerPrs(aFeature, aShape, NULL)); @@ -101,7 +101,7 @@ std::list XGUI_Displayer::GetHighlighted(const int theShapeTypeT return aPresentations; } -void XGUI_Displayer::Erase(boost::shared_ptr theFeature, +void XGUI_Displayer::erase(boost::shared_ptr theFeature, const bool isUpdateViewer) { if (myFeature2AISObjectMap.find(theFeature) == myFeature2AISObjectMap.end()) @@ -117,10 +117,10 @@ void XGUI_Displayer::Erase(boost::shared_ptr theFeature, myFeature2AISObjectMap.erase(theFeature); if (isUpdateViewer) - UpdateViewer(); + updateViewer(); } -bool XGUI_Displayer::Redisplay(boost::shared_ptr theFeature, +bool XGUI_Displayer::redisplay(boost::shared_ptr theFeature, Handle(AIS_InteractiveObject) theAIS, const int theSelectionMode, const bool isUpdateViewer) @@ -136,7 +136,7 @@ bool XGUI_Displayer::Redisplay(boost::shared_ptr theFeature, //aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL); } // display or redisplay presentation - if (IsVisible(theFeature) && !myFeature2AISObjectMap[theFeature].IsNull()) { + if (isVisible(theFeature) && !myFeature2AISObjectMap[theFeature].IsNull()) { aContext->RecomputeSelectionOnly(theAIS); } else { @@ -152,12 +152,12 @@ bool XGUI_Displayer::Redisplay(boost::shared_ptr theFeature, isCreated = true; } if (isUpdateViewer) - UpdateViewer(); + updateViewer(); return isCreated; } -void XGUI_Displayer::ActivateInLocalContext(boost::shared_ptr theFeature, +void XGUI_Displayer::activateInLocalContext(boost::shared_ptr theFeature, const std::list& theModes, const bool isUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -168,7 +168,7 @@ void XGUI_Displayer::ActivateInLocalContext(boost::shared_ptr } // display or redisplay presentation Handle(AIS_Shape) anAIS; - if (IsVisible(theFeature)) + if (isVisible(theFeature)) anAIS = Handle(AIS_Shape)::DownCast(myFeature2AISObjectMap[theFeature]); // Activate selection of objects from prs @@ -184,10 +184,10 @@ void XGUI_Displayer::ActivateInLocalContext(boost::shared_ptr } if (isUpdateViewer) - UpdateViewer(); + updateViewer(); } -void XGUI_Displayer::StopSelection(const std::list& theFeatures, const bool isStop, +void XGUI_Displayer::stopSelection(const std::list& theFeatures, const bool isStop, const bool isUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -197,7 +197,7 @@ void XGUI_Displayer::StopSelection(const std::list& theFeatures, boost::shared_ptr aFeature; for (; anIt != aLast; anIt++) { aFeature = (*anIt).feature(); - if (IsVisible(aFeature)) + if (isVisible(aFeature)) anAIS = Handle(AIS_Shape)::DownCast(myFeature2AISObjectMap[aFeature]); if (anAIS.IsNull()) continue; @@ -214,10 +214,10 @@ void XGUI_Displayer::StopSelection(const std::list& theFeatures, } } if (isUpdateViewer) - UpdateViewer(); + updateViewer(); } -void XGUI_Displayer::SetSelected(const std::list& theFeatures, const bool isUpdateViewer) +void XGUI_Displayer::setSelected(const std::list& theFeatures, const bool isUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -234,7 +234,7 @@ void XGUI_Displayer::SetSelected(const std::list& theFeatures, c for (; anIt != aLast; anIt++) { aFeature = (*anIt).feature(); - if (IsVisible(aFeature)) + if (isVisible(aFeature)) anAIS = Handle(AIS_Shape)::DownCast(myFeature2AISObjectMap[aFeature]); if (anAIS.IsNull()) continue; @@ -242,10 +242,10 @@ void XGUI_Displayer::SetSelected(const std::list& theFeatures, c } if (isUpdateViewer) - UpdateViewer(); + updateViewer(); } -void XGUI_Displayer::EraseAll(const bool isUpdateViewer) +/*void XGUI_Displayer::EraseAll(const bool isUpdateViewer) { Handle(AIS_InteractiveContext) ic = AISContext(); @@ -262,10 +262,10 @@ void XGUI_Displayer::EraseAll(const bool isUpdateViewer) } myFeature2AISObjectMap.clear(); if (isUpdateViewer) - UpdateViewer(); -} + updateViewer(); +}*/ -void XGUI_Displayer::EraseDeletedFeatures(const bool isUpdateViewer) +void XGUI_Displayer::eraseDeletedFeatures(const bool isUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -290,15 +290,15 @@ void XGUI_Displayer::EraseDeletedFeatures(const bool isUpdateViewer) } if (isUpdateViewer) - UpdateViewer(); + updateViewer(); } -void XGUI_Displayer::CloseLocalContexts(const bool isUpdateViewer) +void XGUI_Displayer::closeLocalContexts(const bool isUpdateViewer) { - CloseAllContexts(true); + closeAllContexts(true); } -Handle(AIS_InteractiveObject) XGUI_Displayer::GetAISObject( +Handle(AIS_InteractiveObject) XGUI_Displayer::getAISObject( boost::shared_ptr theFeature) const { Handle(AIS_InteractiveObject) anIO; @@ -307,7 +307,7 @@ Handle(AIS_InteractiveObject) XGUI_Displayer::GetAISObject( return anIO; } -boost::shared_ptr XGUI_Displayer::GetFeature(Handle(AIS_InteractiveObject) theIO) const +boost::shared_ptr XGUI_Displayer::getFeature(Handle(AIS_InteractiveObject) theIO) const { boost::shared_ptr aFeature; FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(), @@ -321,17 +321,17 @@ boost::shared_ptr XGUI_Displayer::GetFeature(Handle(AIS_Intera return aFeature; } -void XGUI_Displayer::CloseAllContexts(const bool isUpdateViewer) +void XGUI_Displayer::closeAllContexts(const bool isUpdateViewer) { Handle(AIS_InteractiveContext) ic = AISContext(); if (!ic.IsNull()) { ic->CloseAllContexts(false); if (isUpdateViewer) - UpdateViewer(); + updateViewer(); } } -void XGUI_Displayer::UpdateViewer() +void XGUI_Displayer::updateViewer() { Handle(AIS_InteractiveContext) ic = AISContext(); if (!ic.IsNull()) diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index f9ff755ca..d0d4789d7 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -44,12 +44,12 @@ public: /// Returns the feature visibility state. /// \param theFeature a feature instance - bool IsVisible(boost::shared_ptr theFeature); + bool isVisible(boost::shared_ptr theFeature); /// Display the feature. Obtain the visualized object from the feature. /// \param theFeature a feature instance /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void Display(boost::shared_ptr theFeature, const bool isUpdateViewer = true); + //void Display(boost::shared_ptr theFeature, const bool isUpdateViewer = true); /// Display the feature and a shape. This shape would be associated to the given feature /// \param theFeature a feature instance @@ -61,80 +61,80 @@ public: /// Returns a list of viewer selected presentations /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build /// \return list of presentations - std::list GetSelected(const int theShapeTypeToSkip = -1); + std::list getSelected(const int theShapeTypeToSkip = -1); /// Returns a list of viewer highlited presentations /// \param theShapeTypeToSkip the shapes with this type will be skipped during the result list build /// \return list of presentations - std::list GetHighlighted(const int theShapeTypeToSkip = -1); + std::list getHighlighted(const int theShapeTypeToSkip = -1); /// Display the shape and activate selection of sub-shapes /// \param theFeature a feature instance /// \param theAIS an AIS object /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly /// \returns true if the presentation is created - bool Redisplay(boost::shared_ptr theFeature, + bool redisplay(boost::shared_ptr theFeature, Handle(AIS_InteractiveObject) theAIS, const int theSelectionMode, const bool isUpdateViewer = true); /// Redisplay the shape and activate selection of sub-shapes /// \param theFeature a feature instance /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - //void Redisplay(Handle(AIS_InteractiveObject) theAIS, const bool isUpdateViewer = true); + //void redisplay(Handle(AIS_InteractiveObject) theAIS, const bool isUpdateViewer = true); /// Display the shape and activate selection of sub-shapes /// \param theFeature a feature instance /// \param theShape a shape /// \param theMode a list of local selection modes /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void ActivateInLocalContext(boost::shared_ptr theFeature, + void activateInLocalContext(boost::shared_ptr theFeature, const std::list& theModes, const bool isUpdateViewer = true); /// Stop the current selection and color the given features to the selection color /// \param theFeatures a list of features to be disabled /// \param theToStop the boolean state whether it it stopped or non stopped /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void StopSelection(const std::list& theFeatures, const bool isStop, + void stopSelection(const std::list& theFeatures, const bool isStop, const bool isUpdateViewer); /// Set the features are selected /// \param theFeatures a list of features to be selected /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void SetSelected(const std::list& theFeatures, const bool isUpdateViewer); + void setSelected(const std::list& theFeatures, const bool isUpdateViewer); /// Erase the feature and a shape. /// \param theFeature a feature instance /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void Erase(boost::shared_ptr theFeature, const bool isUpdateViewer = true); + void erase(boost::shared_ptr theFeature, const bool isUpdateViewer = true); /// Erase all presentations /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void EraseAll(const bool isUpdateViewer = true); + //void EraseAll(const bool isUpdateViewer = true); /// Erase AIS interactive objects, which has an empty feature in the internal map /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void EraseDeletedFeatures(const bool isUpdateViewer = true); + void eraseDeletedFeatures(const bool isUpdateViewer = true); /// Deactivates selection of sub-shapes /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly - void CloseLocalContexts(const bool isUpdateViewer = true); + void closeLocalContexts(const bool isUpdateViewer = true); /// Updates the viewer - void UpdateViewer(); + void updateViewer(); /// Searches the interactive object by feature /// \param theFeature the feature or NULL if it not visualized /// \return theIO an interactive object - Handle(AIS_InteractiveObject) GetAISObject(boost::shared_ptr theFeature) const; + Handle(AIS_InteractiveObject) getAISObject(boost::shared_ptr theFeature) const; protected: /// Searches the feature by interactive object /// \param theIO an interactive object /// \return feature the feature or NULL if it not visualized - boost::shared_ptr GetFeature(Handle(AIS_InteractiveObject) theIO) const; + boost::shared_ptr getFeature(Handle(AIS_InteractiveObject) theIO) const; /// Deactivate local selection /// \param isUpdateViewer the state wether the viewer should be updated immediatelly - void CloseAllContexts(const bool isUpdateViewer); + void closeAllContexts(const bool isUpdateViewer); /// Returns currently installed AIS_InteractiveContext Handle(AIS_InteractiveContext) AISContext() const; -- 2.39.2