#include <Geom2d_Curve.hxx>
#include <BRepLib_CheckCurveOnSurface.hxx>
#include <BRep_Tool.hxx>
+#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomLib_IsPlanarSurface.hxx>
#include <GeomLib_Tool.hxx>
+ #include <GeomAPI_ExtremaCurveSurface.hxx>
#include <gp_Pln.hxx>
#include <GProp_GProps.hxx>
#include <IntAna_IntConicQuad.hxx>
return aResultShape;
}
- }
+
+//==================================================================================================
+std::shared_ptr<GeomAPI_Dir> GeomAlgoAPI_ShapeTools::buildDirFromAxisAndShape(
+ const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+ const std::shared_ptr<GeomAPI_Ax1> theAxis)
+{
+ gp_Pnt aCentreOfMassPoint =
+ GeomAlgoAPI_ShapeTools::centreOfMass(theBaseShape)->impl<gp_Pnt>();
+ Handle(Geom_Line) aLine = new Geom_Line(theAxis->impl<gp_Ax1>());
+ GeomAPI_ProjectPointOnCurve aPrjTool(aCentreOfMassPoint, aLine);
+ gp_Pnt aPoint = aPrjTool.NearestPoint();
+
+ std::shared_ptr<GeomAPI_Dir> aDir(new GeomAPI_Dir(aCentreOfMassPoint.X()-aPoint.X(),
+ aCentreOfMassPoint.Y()-aPoint.Y(),
+ aCentreOfMassPoint.Z()-aPoint.Z()));
+ return aDir;
++}
/// Returns true if the event is processed.
virtual bool processEnter();
+ /// Reject the current editor dialog if it is shown and returns true.
+ virtual bool processEscape();
+
private:
/// Show editor
+ /// \param theSpinMinValue a minimal value of popup menu spin box
+ /// \param theSpinMaxValue a maximum value of popup menu spin box
/// \param theOutValue a result value
/// \param theOutText a result text
/// \return true if the editor value is accepted
/// \param fromRoot - root document flag
QStringList listOfShowNotEmptyFolders(bool fromRoot = true) const;
+ VisibilityState getVisibilityState(const QModelIndex& theIndex) const;
+
+ void addShownFolder(DocumentPtr theDoc, QString theFolder)
+ {
+ if (!myShownFolders.contains(theDoc)) {
+ myShownFolders[theDoc] = QStringList();
+ }
+ myShownFolders[theDoc].append(theFolder);
+ }
+
+ void removeShownFolder(DocumentPtr theDoc, QString theFolder)
+ {
+ if (myShownFolders.contains(theDoc)) {
+ myShownFolders[theDoc].removeAll(theFolder);
+ if (myShownFolders[theDoc].isEmpty())
+ myShownFolders.remove(theDoc);
+ }
+ }
+
+ bool hasShownFolder(DocumentPtr theDoc, QString theFolder) const
+ {
+ if (myShownFolders.contains(theDoc))
+ return myShownFolders[theDoc].contains(theFolder);
+ return false;
+ }
+
Config_DataModelReader* myXMLReader;
+ XGUI_Workshop* myWorkshop;
+ QMap<DocumentPtr, QStringList> myShownFolders;
//bool myIsEventsProcessingBlocked;
};