@REM -------------------------
@REM -------------------------
-@REM Create launch path
-rem @SET PATH=%LIBXML2_ROOT_DIR%\bin;%PATH%
-rem @SET PATH=%PDIR%\tbb\bin;%PATH%
-rem @SET PATH=%PDIR%\freeimage-3.15.4\bin;%PATH%
-rem @SET PATH=%PDIR%\ftgl-2.1.3\bin;%PATH%
-rem @SET PATH=%PDIR%\freetype-2.4.11\bin;%PATH%
-rem @SET PATH=%PDIR%\gl2ps-1.3.8\bin;%PATH%
-rem @SET PATH=%PDIR%\qwt-5.2.1\lib;%PATH%
-rem @SET PATH=%SOLVESPACE_ROOT_DIR%\lib;%PATH%
+@SET PYTHONHOME=%PYTHON_ROOT_DIR%
+@SET PYTHON_INCLUDE=%PYTHONHOME%\include
@REM -------------------------
+
@REM -------------------------
-@SET PYTHONHOME=%PYTHON_ROOT_DIR%
-@SET PYTHON_INCLUDE=%PYTHONHOME%\include
+@REM Some OCCT headers include FREETYPE headers
+@SET FREETYPE_DIR=%PDIR%\freetype-2.4.11
@REM -------------------------
@SET PATH=%GEOM_ROOT_DIR%\lib\salome;%PATH%
{
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
- if (aDrawer->HasPointAspect()) {
+ Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
+ if (aDrawer->HasOwnPointAspect()) {
Handle(Prs3d_PointAspect) aPA = aDrawer->PointAspect();
aPA->SetTypeOfMarker((Aspect_TypeOfMarker)theType);
aPA->SetScale(theScale);
bool isChanged = false;
Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
+ Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
Handle(Prs3d_LineAspect) aLineAspect;
Aspect_TypeOfLine aType = (Aspect_TypeOfLine)theStyle;
- if (aDrawer->HasLineAspect()) {
+ if (aDrawer->HasOwnLineAspect()) {
aLineAspect = aDrawer->LineAspect();
}
- if (aDrawer->HasWireAspect()) {
+ if (aDrawer->HasOwnWireAspect()) {
aLineAspect = aDrawer->WireAspect();
}
Quantity_Color aCurrentColor;
#include <GeomAPI_PlanarEdges.h>
#include <BRep_Builder.hxx>
-#include <AIS_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <TopoDS_Builder.hxx>
${PROJECT_SOURCE_DIR}/src/GeomDataAPI
${PROJECT_SOURCE_DIR}/src/SketchPlugin
${CAS_INCLUDE_DIRS}
+ $ENV{FREETYPE_DIR}/include
)
TARGET_LINK_LIBRARIES(SketcherPrs ${PROJECT_LIBRARIES})
#include <SketchPlugin_Constraint.h>
-#include <AIS_Drawer.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
#include <Prs3d_PointAspect.hxx>
#include <SketchPlugin_Constraint.h>
-#include <AIS_Drawer.hxx>
#include <gp_Pnt2d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include "SketcherPrs_SensitivePoint.h"
-#include <Select3D_Projector.hxx>
#include <Bnd_Box2d.hxx>
#include <CSLib_Class2d.hxx>
#include <ElCLib.hxx>
#include <TopLoc_Location.hxx>
-#include <SelectBasics_ListOfBox2d.hxx>
IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
int theId)
:Select3D_SensitiveEntity(anOwner), myId(theId), myPntArray(thePntArray)
{
- SetSensitivityFactor(4.);
+ SetSensitivityFactor(12.);
}
-void SketcherPrs_SensitivePoint::Project (const Handle(Select3D_Projector)& aProj)
+Standard_Boolean SketcherPrs_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr,
+ SelectBasics_PickResult& thePickResult)
{
- gp_Pnt2d aPoint2d;
- gp_Pnt aPnt = Point();
- if(!HasLocation())
- aProj->Project(aPnt, aPoint2d);
- else
- {
- gp_Pnt aP(aPnt.X(), aPnt.Y(), aPnt.Z());
- aProj->Project(aP.Transformed(Location().Transformation()), aPoint2d);
- }
- myprojpt = aPoint2d;
-}
-
-void SketcherPrs_SensitivePoint::Areas(SelectBasics_ListOfBox2d& boxes)
-{
- Bnd_Box2d abox;
- abox.Set(myprojpt);
- boxes.Append(abox);
-}
-
-Standard_Boolean SketcherPrs_SensitivePoint::Matches(const SelectBasics_PickArgs& thePickArgs,
- Standard_Real& theMatchDMin,
- Standard_Real& theMatchDepth)
-{
- // check coordinate matching
- Standard_Real aDist = gp_Pnt2d (thePickArgs.X(), thePickArgs.Y()).Distance (myprojpt);
- if (aDist > thePickArgs.Tolerance() * SensitivityFactor())
- {
- return Standard_False;
- }
-
- Standard_Real aDepth = ComputeDepth (thePickArgs.PickLine());
- if (thePickArgs.IsClipped (aDepth))
+ Standard_Real aDepth = RealLast();
+ Standard_Real aDistToCOG = RealLast();
+ gp_Pnt aPnt = myPntArray->Vertice(myId);
+ if (!theMgr.Overlaps (aPnt, aDepth))
{
+ thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
return Standard_False;
}
- theMatchDMin = aDist;
- theMatchDepth = aDepth;
+ aDistToCOG = aDepth;
+ thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
return Standard_True;
}
-Standard_Boolean SketcherPrs_SensitivePoint::Matches(const Standard_Real XMin,
- const Standard_Real YMin,
- const Standard_Real XMax,
- const Standard_Real YMax,
- const Standard_Real aTol)
-{
- Bnd_Box2d B;
- B.Update(Min(XMin,XMax),Min(YMin,YMax),Max(XMin,XMax),Max(YMin,YMax));
- B.Enlarge(aTol);
- return !B.IsOut(myprojpt);
-}
-
-Standard_Boolean SketcherPrs_SensitivePoint::Matches(const TColgp_Array1OfPnt2d& aPoly,
- const Bnd_Box2d& aBox,
- const Standard_Real aTol)
-{
- Standard_Real Umin,Vmin,Umax,Vmax;
- aBox.Get(Umin,Vmin,Umax,Vmax);
- CSLib_Class2d aClassifier2d(aPoly,aTol,aTol,Umin,Vmin,Umax,Vmax);
-
- Standard_Integer RES = aClassifier2d.SiDans(myprojpt);
- if(RES==1) return Standard_True;
-
- return Standard_False;
-}
-
gp_Pnt SketcherPrs_SensitivePoint::Point() const
{
return myPntArray->Vertice(myId);
}
-Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected(const TopLoc_Location& aLoc)
+Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected()
{
- Handle(SketcherPrs_SensitivePoint) NiouEnt = new SketcherPrs_SensitivePoint(myOwnerId,myPntArray,myId);
- if(HasLocation()) NiouEnt->SetLocation(Location());
- NiouEnt->UpdateLocation(aLoc);
- return NiouEnt;
+ Handle(SketcherPrs_SensitivePoint) aNewEntity = new SketcherPrs_SensitivePoint (myOwnerId, myPntArray, myId);
+ return aNewEntity;
}
-void SketcherPrs_SensitivePoint::Dump(Standard_OStream& S,const Standard_Boolean /*FullDump*/) const
+gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const
{
- gp_Pnt aPnt = Point();
- S<<"\tSensitivePoint 3D :";
- if(HasLocation())
- S<<"\t\tExisting Location"<<endl;
+ return Point();
+}
- S<<"\t\t P3d [ "<<aPnt.X()<<" , "<<aPnt.Y()<<" , "<<aPnt.Z()<<" ]"<<endl;
- S<<"\t\t P2d [ "<<myprojpt.x<<" , "<<myprojpt.y<<" ]"<<endl;
+Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox()
+{
+ gp_Pnt aPnt = myPntArray->Vertice(myId);
+ return Select3D_BndBox3d (SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()),
+ SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()));
}
-Standard_Real SketcherPrs_SensitivePoint::ComputeDepth(const gp_Lin& EyeLine) const
+Standard_Integer SketcherPrs_SensitivePoint::NbSubElements()
{
- return ElCLib::Parameter(EyeLine, Point());
+ return 1;
}
#include <Select3D_SensitiveEntity.hxx>
#include <Graphic3d_ArrayOfPoints.hxx>
-#include <Select3D_Pnt2d.hxx>
#include <Standard_DefineHandle.hxx>
Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId,
const Handle(Graphic3d_ArrayOfPoints)& thePntArray, int theId);
- //! Converts the stored 3D point into a 2D point according
- //! to <aProjector> ; this method is called by the selection Manager.
- Standard_EXPORT void Project (const Handle(Select3D_Projector)& aProjector) ;
-
- //! stores in <aresult> the 2D sensitive box which represents
- //! the point area in the selection process.
- Standard_EXPORT void Areas (SelectBasics_ListOfBox2d& aresult) ;
-
+ Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+
//! Update location of the point
//! \param aLocation a new location
- Standard_EXPORT Handle(Select3D_SensitiveEntity) GetConnected (const TopLoc_Location& aLocation) ;
-
- //! Checks whether the sensitive entity matches the picking
- //! detection area (close to the picking line).
- //! For details please refer to base class declaration.
- Standard_EXPORT Standard_Boolean Matches (const SelectBasics_PickArgs& thePickArgs, Standard_Real& theMatchDMin, Standard_Real& theMatchDepth) ;
-
- /// Returns true if the current point is matches with given rectangle
- /// \param XMin an X min coordinate
- /// \param YMin an Y min coordinate
- /// \param XMax an X max coordinate
- /// \param YMax an Y max coordinate
- /// \param aTol a tolerance
- Standard_EXPORT Standard_Boolean Matches (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real aTol) ;
-
- Standard_EXPORT virtual Standard_Boolean Matches (const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol) ;
-
- Standard_EXPORT Standard_Real ComputeDepth (const gp_Lin& EyeLine) const;
-
+ Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
+
+ //! Checks whether the point overlaps current selecting volume
+ Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
+ SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
+
//! Returns the point used at the time of construction.
- Standard_EXPORT gp_Pnt Point() const;
+ Standard_EXPORT gp_Pnt Point() const;
+
+ //! Returns center of point. If location transformation
+ //! is set, it will be applied
+ Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
- Standard_EXPORT virtual void Dump (Standard_OStream& S, const Standard_Boolean FullDump = Standard_True) const;
+ //! Returns bounding box of the point. If location
+ //! transformation is set, it will be applied
+ Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
+
DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
private:
int myId;
Handle(Graphic3d_ArrayOfPoints) myPntArray;
- Select3D_Pnt2d myprojpt;
};
#include <Graphic3d_BndBox4f.hxx>
#include <SelectMgr_Selection.hxx>
-#include <SelectMgr_SelectionManager.hxx>
#include <Select3D_SensitivePoint.hxx>
#include <TopLoc_Location.hxx>
#include <AIS_InteractiveContext.hxx>
#include <OpenGl_PointSprite.hxx>
#include <OpenGl_VertexBuffer.hxx>
#include <OpenGl_ShaderManager.hxx>
-#include <OpenGl_VertexBufferCompat.hxx>
-#include <OpenGl_GraphicDriver.hxx>
#ifdef WIN32
# define FSEP "\\"
#include <Graphic3d_AspectMarker3d.hxx>
#include <Image_AlienPixMap.hxx>
#include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveEntitySequence.hxx>
+#include <Select3D_EntitySequence.hxx>
#include <Standard_DefineHandle.hxx>
#include <map>
mutable Handle(OpenGl_VertexBuffer) myVboAttribs;
- Select3D_SensitiveEntitySequence mySPoints;
+ Select3D_EntitySequence mySPoints;
};
#endif
\ No newline at end of file
const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity
//#define DEBUG_DISPLAY
-//#define DEBUG_ACTIVATE
+#define DEBUG_ACTIVATE
//#define DEBUG_FEATURE_REDISPLAY
//#define DEBUG_SELECTION_FILTERS
//#define DEBUG_USE_CLEAR_OUTDATED_SELECTION
if (!anAISIO.IsNull()) {
appendResultObject(theObject, theAIS);
- bool aCanBeShaded = ::canBeShaded(anAISIO);
// In order to avoid extra closing/opening context
SelectMgr_IndexedMapOfOwner aSelectedOwners;
- if (aCanBeShaded) {
- myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
- closeLocalContexts(false);
- }
aContext->Display(anAISIO, false);
aContext->SetDisplayMode(anAISIO, isShading? Shading : Wireframe, false);
if (isShading)
if (isCustomized)
aContext->Redisplay(anAISIO, false);
- if (aCanBeShaded) {
- openLocalContext();
- activateObjects(myActiveSelectionModes);
- myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
- }
- else
- activate(anAISIO, myActiveSelectionModes);
+ activate(anAISIO, myActiveSelectionModes);
}
if (isUpdateViewer)
updateViewer();
return;
Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
- bool aCanBeShaded = ::canBeShaded(aAISIO);
- // In order to avoid extra closing/opening context
SelectMgr_IndexedMapOfOwner aSelectedOwners;
- if (aCanBeShaded) {
- myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
- closeLocalContexts(false);
- }
aContext->SetDisplayMode(aAISIO, theMode, false);
// Redisplay in order to update new mode because it could be not computed before
aContext->Redisplay(aAISIO, false);
- if (aCanBeShaded) {
- openLocalContext();
- activateObjects(myActiveSelectionModes);
- myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
- }
if (toUpdate)
updateViewer();
}
#include <AIS_InteractiveContext.hxx>
-#include <SelectMgr_Selection.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-
-#include <SelectBasics_SensitiveEntity.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <StdSelect_BRepOwner.hxx>
Handle(SelectMgr_Selection) aSelection = theObject->Selection(aMode);
for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
- Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive();
+ Handle(SelectMgr_SensitiveEntity) anEntity = aSelection->Sensitive();
if (anEntity.IsNull())
continue;
Handle(SelectMgr_EntityOwner) anOwner =
- Handle(SelectMgr_EntityOwner)::DownCast(anEntity->OwnerId());
+ Handle(SelectMgr_EntityOwner)::DownCast(anEntity->BaseSensitive()->OwnerId());
if (!anOwner.IsNull())
theOwners.Add(anOwner);
}