aLast = aFeatures.end();
for (; anIt != aLast; anIt++) {
boost::shared_ptr<ModelAPI_Feature> 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)
{
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);
}
}
if (aPreviewOp)
{
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected();
- std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted();
+ std::list<XGUI_ViewerPrs> aSelected = aDisplayer->getSelected();
+ std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->getHighlighted();
aPreviewOp->mousePressed(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted);
}
if (aPreviewOp)
{
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected();
- std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted();
+ std::list<XGUI_ViewerPrs> aSelected = aDisplayer->getSelected();
+ std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->getHighlighted();
aPreviewOp->mouseReleased(theEvent, myWorkshop->viewer()->activeView(), aSelected, aHighlighted);
}
{
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
// refill the features list with avoiding of the features, obtained only by vertex shape (TODO)
- std::list<XGUI_ViewerPrs> aSelected = aDisplayer->GetSelected(TopAbs_VERTEX);
- std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->GetHighlighted(TopAbs_VERTEX);
+ std::list<XGUI_ViewerPrs> aSelected = aDisplayer->getSelected(TopAbs_VERTEX);
+ std::list<XGUI_ViewerPrs> aHighlighted = aDisplayer->getHighlighted(TopAbs_VERTEX);
aPreviewOp->init(theFeature, aSelected, aHighlighted);
} else {
anOperation->setFeature(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<XGUI_ViewerPrs>& 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<ModelAPI_Feature> theFeature,
boost::shared_ptr<ModelAPI_Feature> aFeature = (*anIt).first;
visualizePreview(aFeature, false, false);
}
- aDisplayer->UpdateViewer();
+ aDisplayer->updateViewer();
}
}
Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation(
theFeature, aPreviewOp->sketch(),
aPreview ? aPreview->impl<TopoDS_Shape>() : 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<ModelAPI_Feature> theFeature,
PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
if (aPreviewOp) {
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- aDisplayer->ActivateInLocalContext(theFeature, aPreviewOp->getSelectionModes(theFeature),
+ aDisplayer->activateInLocalContext(theFeature, aPreviewOp->getSelectionModes(theFeature),
isUpdateViewer);
}
}
Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation(
aFeature, aPreviewOp->sketch(),
aPreview ? aPreview->impl<TopoDS_Shape>() : 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)
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 {
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);
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:
{
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();
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);
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;
return;
if (myFeatures.size() != 1) {
- boost::shared_ptr<ModelAPI_Feature> aFeature = PartSet_Tools::NearestFeature(theEvent->pos(),
+ boost::shared_ptr<ModelAPI_Feature> aFeature = PartSet_Tools::nearestFeature(theEvent->pos(),
theView, feature(), myFeatures);
if (aFeature)
restartOperation(PartSet_OperationEditLine::Type(), aFeature);
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 {
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);
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:
{
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();
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);
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<ModelAPI_Data> aData = feature()->data();
boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(theAttribute));
boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(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;
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());
aFeature, aSketch,
aPreview ? aPreview->impl<TopoDS_Shape>() : TopoDS_Shape(), NULL);
if (!anAIS.IsNull())
- aDisplayer->Redisplay(aFeature, anAIS, -1, false);
+ aDisplayer->redisplay(aFeature, anAIS, -1, false);
std::list<int> 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;
aFeature, aSketch,
aPreview ? aPreview->impl<TopoDS_Shape>() : 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++)
//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<XGUI_ViewerPrs> aPrs;
aPrs.push_back(XGUI_ViewerPrs(myTestFeature, TopoDS_Shape(), NULL));
- aDisplayer->SetSelected(aPrs, true);
+ aDisplayer->setSelected(aPrs, true);
}
}
aPreview ? aPreview->impl<TopoDS_Shape>() : TopoDS_Shape(),
aPrevAIS);
if (!anAIS.IsNull())
- theWorkshop->displayer()->Redisplay(aFeature, anAIS, -1, true);
+ theWorkshop->displayer()->redisplay(aFeature, anAIS, -1, true);
//std::list<int> 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<XGUI_ViewerPrs> 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)
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();
return ResultPoint;
}
-void PartSet_Tools::ConvertTo2D(const gp_Pnt& thePoint, boost::shared_ptr<ModelAPI_Feature> theSketch,
+void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr<ModelAPI_Feature> theSketch,
Handle(V3d_View) theView, double& theX, double& theY)
{
if (!theSketch)
theY = aVec.X() * anY->x() + 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<ModelAPI_Feature> theSketch,
gp_Pnt& thePoint)
{
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)
{
//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;
}
}
-boost::shared_ptr<ModelAPI_Feature> PartSet_Tools::NearestFeature(QPoint thePoint,
+boost::shared_ptr<ModelAPI_Feature> PartSet_Tools::nearestFeature(QPoint thePoint,
Handle_V3d_View theView,
boost::shared_ptr<ModelAPI_Feature> theSketch,
const std::list<XGUI_ViewerPrs>& 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<ModelAPI_Feature> aFeature;
std::list<XGUI_ViewerPrs>::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
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();
return aDeltaFeature;
}
-double PartSet_Tools::DistanceToPoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+double PartSet_Tools::distanceToPoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
double theX, double theY)
{
double aDelta = 0;
boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(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));
/// 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<ModelAPI_Feature> theSketch,
+ static void convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr<ModelAPI_Feature> theSketch,
Handle(V3d_View) theView, double& theX, double& theY);
/// \brief Converts the 2D projected coodinates on the sketch plane to the 3D point.
/// \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<ModelAPI_Feature> theSketch,
gp_Pnt& thePoint);
/// \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);
/// \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
/// \param theView a 3D view
/// \param theSketch the sketch feature
/// \param theFeatures the list of selected presentations
- static boost::shared_ptr<ModelAPI_Feature> NearestFeature(QPoint thePoint, Handle_V3d_View theView,
+ static boost::shared_ptr<ModelAPI_Feature> nearestFeature(QPoint thePoint, Handle_V3d_View theView,
boost::shared_ptr<ModelAPI_Feature> theSketch,
const std::list<XGUI_ViewerPrs>& theFeatures);
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<ModelAPI_Feature> theFeature,
+ static double distanceToPoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
double theX, double theY);
};
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"));
{
}
-bool XGUI_Displayer::IsVisible(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool XGUI_Displayer::isVisible(boost::shared_ptr<ModelAPI_Feature> theFeature)
{
return myFeature2AISObjectMap.find(theFeature) != myFeature2AISObjectMap.end();
}
-void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
- const bool isUpdateViewer)
-{
-}
+//void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
+// const bool isUpdateViewer)
+//{
+//}
/*void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
const TopoDS_Shape& theShape, const bool isUpdateViewer)
aContext->Display(anAIS, Standard_False);
if (isUpdateViewer)
- UpdateViewer();
+ updateViewer();
}*/
-std::list<XGUI_ViewerPrs> XGUI_Displayer::GetSelected(const int theShapeTypeToSkip)
+std::list<XGUI_ViewerPrs> XGUI_Displayer::getSelected(const int theShapeTypeToSkip)
{
std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
std::list<XGUI_ViewerPrs> aPresentations;
if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
continue;
- boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(anIO);
+ boost::shared_ptr<ModelAPI_Feature> aFeature = getFeature(anIO);
if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
continue;
Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
return aPresentations;
}
-std::list<XGUI_ViewerPrs> XGUI_Displayer::GetHighlighted(const int theShapeTypeToSkip)
+std::list<XGUI_ViewerPrs> XGUI_Displayer::getHighlighted(const int theShapeTypeToSkip)
{
std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
std::list<XGUI_ViewerPrs> aPresentations;
if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
continue;
- boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(anIO);
+ boost::shared_ptr<ModelAPI_Feature> aFeature = getFeature(anIO);
if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
continue;
aPresentations.push_back(XGUI_ViewerPrs(aFeature, aShape, NULL));
return aPresentations;
}
-void XGUI_Displayer::Erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void XGUI_Displayer::erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
const bool isUpdateViewer)
{
if (myFeature2AISObjectMap.find(theFeature) == myFeature2AISObjectMap.end())
myFeature2AISObjectMap.erase(theFeature);
if (isUpdateViewer)
- UpdateViewer();
+ updateViewer();
}
-bool XGUI_Displayer::Redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
+bool XGUI_Displayer::redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
Handle(AIS_InteractiveObject) theAIS,
const int theSelectionMode,
const bool isUpdateViewer)
//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 {
isCreated = true;
}
if (isUpdateViewer)
- UpdateViewer();
+ updateViewer();
return isCreated;
}
-void XGUI_Displayer::ActivateInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void XGUI_Displayer::activateInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
const std::list<int>& theModes, const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
}
// 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
}
if (isUpdateViewer)
- UpdateViewer();
+ updateViewer();
}
-void XGUI_Displayer::StopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isStop,
+void XGUI_Displayer::stopSelection(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isStop,
const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
boost::shared_ptr<ModelAPI_Feature> 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;
}
}
if (isUpdateViewer)
- UpdateViewer();
+ updateViewer();
}
-void XGUI_Displayer::SetSelected(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isUpdateViewer)
+void XGUI_Displayer::setSelected(const std::list<XGUI_ViewerPrs>& theFeatures, const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
for (; anIt != aLast; anIt++) {
aFeature = (*anIt).feature();
- if (IsVisible(aFeature))
+ if (isVisible(aFeature))
anAIS = Handle(AIS_Shape)::DownCast(myFeature2AISObjectMap[aFeature]);
if (anAIS.IsNull())
continue;
}
if (isUpdateViewer)
- UpdateViewer();
+ updateViewer();
}
-void XGUI_Displayer::EraseAll(const bool isUpdateViewer)
+/*void XGUI_Displayer::EraseAll(const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) ic = AISContext();
}
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();
}
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<ModelAPI_Feature> theFeature) const
{
Handle(AIS_InteractiveObject) anIO;
return anIO;
}
-boost::shared_ptr<ModelAPI_Feature> XGUI_Displayer::GetFeature(Handle(AIS_InteractiveObject) theIO) const
+boost::shared_ptr<ModelAPI_Feature> XGUI_Displayer::getFeature(Handle(AIS_InteractiveObject) theIO) const
{
boost::shared_ptr<ModelAPI_Feature> aFeature;
FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(),
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())
/// Returns the feature visibility state.
/// \param theFeature a feature instance
- bool IsVisible(boost::shared_ptr<ModelAPI_Feature> theFeature);
+ bool isVisible(boost::shared_ptr<ModelAPI_Feature> 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<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
+ //void Display(boost::shared_ptr<ModelAPI_Feature> 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
/// 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<XGUI_ViewerPrs> GetSelected(const int theShapeTypeToSkip = -1);
+ std::list<XGUI_ViewerPrs> 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<XGUI_ViewerPrs> GetHighlighted(const int theShapeTypeToSkip = -1);
+ std::list<XGUI_ViewerPrs> 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<ModelAPI_Feature> theFeature,
+ bool redisplay(boost::shared_ptr<ModelAPI_Feature> 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<ModelAPI_Feature> theFeature,
+ void activateInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
const std::list<int>& 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<XGUI_ViewerPrs>& theFeatures, const bool isStop,
+ void stopSelection(const std::list<XGUI_ViewerPrs>& 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<XGUI_ViewerPrs>& theFeatures, const bool isUpdateViewer);
+ void setSelected(const std::list<XGUI_ViewerPrs>& 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<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
+ void erase(boost::shared_ptr<ModelAPI_Feature> 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<ModelAPI_Feature> theFeature) const;
+ Handle(AIS_InteractiveObject) getAISObject(boost::shared_ptr<ModelAPI_Feature> 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<ModelAPI_Feature> GetFeature(Handle(AIS_InteractiveObject) theIO) const;
+ boost::shared_ptr<ModelAPI_Feature> 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;