Skip to content

Add wrapper for SelectMgr_FrustumBuiler,SelectMgr_ToleranceMap,Select… #1387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

tpaviot
Copy link
Owner

@tpaviot tpaviot commented Nov 15, 2024

Fix #1380

Summary by Sourcery

Add wrappers for several SelectMgr classes, including SelectMgr_FrustumBuilder, SelectMgr_ToleranceMap, SelectMgr_ViewerSelector, and SelectMgr_SensitiveEntitySet, to enhance functionality related to selection management and tolerance handling in the application.

New Features:

  • Introduce a wrapper for the SelectMgr_FrustumBuilder class, providing methods for camera manipulation, viewport settings, and point projection on view planes.
  • Add a wrapper for the SelectMgr_ToleranceMap class, allowing management of tolerance values with methods to add, decrement, and set custom tolerances.
  • Implement a wrapper for the SelectMgr_ViewerSelector class, enabling management of selectable objects and selection mechanisms, including methods for adding, removing, and querying selectable objects.
  • Create a wrapper for the SelectMgr_SensitiveEntitySet class, facilitating the management of sensitive entities with methods for appending entities, retrieving bounding boxes, and managing entity persistence.

Enhancements:

  • Enhance the SelectMgr_SelectableObject class with a new method BndBoxOfSelected to return the bounding box of selected entities.
  • Add new methods to the SelectMgr_SelectingVolumeManager class, including ActiveVolume, to manage selecting volumes more effectively.

…Mgr_ViewerSelector,SelectMgr_SensitiveEntitySet see #1380
Copy link

sourcery-ai bot commented Nov 15, 2024

Reviewer's Guide by Sourcery

This pull request adds wrapper implementations for several previously unwrapped SelectMgr classes: SelectMgr_FrustumBuilder, SelectMgr_ToleranceMap, SelectMgr_ViewerSelector, and SelectMgr_SensitiveEntitySet. The implementation includes class definitions, methods, and their corresponding Python bindings.

Class diagram for SelectMgr_FrustumBuilder

Loading
classDiagram
    class SelectMgr_FrustumBuilder {
        +SelectMgr_FrustumBuilder()
        +Graphic3d_Camera Camera()
        +void InvalidateViewport()
        +gp_Pnt ProjectPntOnViewPlane(float theX, float theY, float theZ)
        +void SetCamera(Graphic3d_Camera theCamera)
        +void SetViewport(float theX, float theY, float theWidth, float theHeight)
        +void SetWindowSize(int theWidth, int theHeight)
        +float SignedPlanePntDist(SelectMgr_Vec3 theEq, SelectMgr_Vec3 thePnt)
        +void WindowSize(int &OutValue, int &OutValue)
    }

Class diagram for SelectMgr_ToleranceMap

Loading
classDiagram
    class SelectMgr_ToleranceMap {
        +SelectMgr_ToleranceMap()
        +void Add(int theTolerance)
        +int CustomTolerance()
        +void Decrement(int theTolerance)
        +bool IsCustomTolSet()
        +void ResetDefaults()
        +void SetCustomTolerance(int theTolerance)
        +int Tolerance()
    }

Class diagram for SelectMgr_ViewerSelector

Loading
classDiagram
    class SelectMgr_ViewerSelector {
        +SelectMgr_ViewerSelector()
        +void AddSelectableObject(SelectMgr_SelectableObject theObject)
        +void AddSelectionToObject(SelectMgr_SelectableObject theObject, SelectMgr_Selection theSelection)
        +void AllowOverlapDetection(bool theIsToAllow)
        +void Clear()
        +void ClearPicked()
        +void ClearSensitive(V3d_View theView)
        +bool Contains(SelectMgr_SelectableObject theObject)
        +int CustomPixelTolerance()
        +float DepthTolerance()
        +SelectMgr_TypeOfDepthTolerance DepthToleranceType()
        +void DisplaySensitive(V3d_View theView)
        +void DisplaySensitive(SelectMgr_Selection theSel, gp_Trsf theTrsf, V3d_View theView, bool theToClearOthers)
        +std::string DumpJson(int depth)
        +Select3D_BVHBuilder3d EntitySetBuilder()
        +SelectMgr_SelectingVolumeManager GetManager()
        +bool IsActive(SelectMgr_SelectableObject theSelectableObject, int theMode)
        +bool IsInside(SelectMgr_SelectableObject theSelectableObject, int theMode)
        +bool Modes(SelectMgr_SelectableObject theSelectableObject, TColStd_ListOfInteger theModeList, SelectMgr_StateOfSelection theWantedState)
        +void MoveSelectableObject(SelectMgr_SelectableObject theObject)
        +int NbPicked()
        +SelectMgr_EntityOwner OnePicked()
        +void Pick(int theXPix, int theYPix, V3d_View theView)
        +void Pick(int theXPMin, int theYPMin, int theXPMax, int theYPMax, V3d_View theView)
        +void Pick(TColgp_Array1OfPnt2d thePolyline, V3d_View theView)
        +void Pick(gp_Ax1 theAxis, V3d_View theView)
        +SelectMgr_EntityOwner Picked(int theRank)
        +SelectMgr_SortCriterion PickedData(int theRank)
        +Select3D_SensitiveEntity PickedEntity(int theRank)
        +gp_Pnt PickedPoint(int theRank)
        +int PixelTolerance()
        +void QueueBVHBuild(Select3D_SensitiveEntity theEntity)
        +void RebuildObjectsTree(bool theIsForce)
        +void RebuildSensitivesTree(SelectMgr_SelectableObject theObject, bool theIsForce)
        +bool RemovePicked(SelectMgr_SelectableObject theObject)
        +void RemoveSelectableObject(SelectMgr_SelectableObject theObject)
        +void RemoveSelectionOfObject(SelectMgr_SelectableObject theObject, SelectMgr_Selection theSelection)
        +void ResetSelectionActivationStatus()
        +SelectMgr_SelectableObjectSet SelectableObjects()
        +float Sensitivity()
        +void SetDepthTolerance(SelectMgr_TypeOfDepthTolerance theType, float theTolerance)
        +void SetEntitySetBuilder(Select3D_BVHBuilder3d theBuilder)
        +void SetPickClosest(bool theToPreferClosest)
        +void SetPixelTolerance(int theTolerance)
        +void SetToPrebuildBVH(bool theToPrebuild, int theThreadsNum)
        +void SortResult()
        +SelectMgr_StateOfSelection Status(SelectMgr_Selection theSelection)
        +TCollection_AsciiString Status(SelectMgr_SelectableObject theSelectableObject)
        +bool ToPickClosest()
        +bool ToPrebuildBVH()
        +void WaitForBVHBuild()
    }

Class diagram for SelectMgr_SensitiveEntitySet

Loading
classDiagram
    class SelectMgr_SensitiveEntitySet {
        +SelectMgr_SensitiveEntitySet(Select3D_BVHBuilder3d theBuilder)
        +void Append(SelectMgr_SensitiveEntity theEntity)
        +void Append(SelectMgr_Selection theSelection)
        +Select3D_BndBox3d Box(int theIndex)
        +float Center(int theIndex, int theAxis)
        +SelectMgr_SensitiveEntity GetSensitiveById(int theIndex)
        +bool HasEntityWithPersistence()
        +SelectMgr_MapOfOwners Owners()
        +void Remove(SelectMgr_Selection theSelection)
        +SelectMgr_IndexedMapOfHSensitive Sensitives()
        +int Size()
        +void Swap(int theIndex1, int theIndex2)
    }

File-Level Changes

Change Details Files
Added wrapper implementation for SelectMgr_FrustumBuilder class
  • Added constructor and basic camera management methods
  • Added viewport and window size handling methods
  • Added point projection and plane distance calculation methods
src/SWIG_files/wrapper/SelectMgr.i
src/SWIG_files/wrapper/SelectMgr.pyi
Added wrapper implementation for SelectMgr_ToleranceMap class
  • Added tolerance management methods
  • Added custom tolerance handling functionality
  • Implemented tolerance value tracking methods
src/SWIG_files/wrapper/SelectMgr.i
src/SWIG_files/wrapper/SelectMgr.pyi
Added wrapper implementation for SelectMgr_ViewerSelector class
  • Added selection management methods
  • Added object and entity handling functionality
  • Implemented picking and selection state management
  • Added BVH (Bounding Volume Hierarchy) building methods
src/SWIG_files/wrapper/SelectMgr.i
src/SWIG_files/wrapper/SelectMgr.pyi
Added wrapper implementation for SelectMgr_SensitiveEntitySet class
  • Added entity management methods
  • Implemented BVH-related functionality
  • Added methods for handling sensitive entities and their owners
src/SWIG_files/wrapper/SelectMgr.i
src/SWIG_files/wrapper/SelectMgr.pyi

Assessment against linked issues

Issue Objective Addressed Explanation
#1380 Enable retrieving point on 3D object's surface under mouse cursor by wrapping SelectMgr_ViewerSelector

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tpaviot - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@tpaviot tpaviot merged commit 171ab4e into master Nov 15, 2024
1 of 15 checks passed
@tpaviot tpaviot deleted the review/selectmgr-fixes branch November 15, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCC.Core.Exception.ClassNotWrappedError: SelectMgr_ViewerSelector not wrapped
1 participant