1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

36 Commits

Author SHA1 Message Date
vglukhik
298ab9d927 Revert "0033551: Visualization - Add new transform persistence mode to force orthographic projection on object."
This reverts commit 0141024df595cdc8db3004927ca48c249776603b.
2025-03-03 12:11:29 +00:00
rodrlyra
6340e56c67 0033551: Visualization - Add new transform persistence mode to force orthographic projection on object.
The new transform persistence mode, with flag `Graphic3d_TMF_OrthoPers`, can be combined (bitwise OR operation) with the other persistence modes (2D, Trihedron or Zoom/Rotate Persistence) to make objects be rendered with orthographic projection when it is on a view with perspective projection.

If the view already uses orthographic projection, there will be no difference.

This feature was implemented to fix ViewCube being distorted when view with perspective projection changes size.
2025-03-03 12:11:27 +00:00
dpasukhi
b2fedee6a1 0033375: Coding - Static Analyzing processing. Performance
Performance update applied:
  - moving to const reference as much as possible
Result of CLANG_TIDY (static analyzing filter: perform*)
2023-05-19 19:33:59 +01:00
mzernova
7aaed2ce3b 0032547: Visualization, Select3D_SensitiveCylinder - implement picking of a hollow cylinder
Select3D_SensitiveCircle now inherits directly from Select3D_SensitiveEntity.
The sensitive circle sector is created using the Select3D_SensitivePoly class directly.

Added appropriate methods for selecting sensitive circles.
Added parameter myIsHollow to Select3D_SensitiveCylinder class.
It allows you to search for intersections with cylinders without covers.

The Draw vcircle command has been extended with UStart and UEnd parameters
to create a sector of a circle.

Added tests: vselect/cone_cylinder/circle_sector
             vselect/cone_cylinder/circle_wire
             vselect/cone_cylinder/filled_circle
             vselect/cone_cylinder/transformed
             vselect/cone_cylinder/hollow_cone_cyl
2022-08-26 17:38:19 +03:00
mkrylova
9dd8af261f 0032281: Visualization - add Select3D_SensitiveCylinder
- implemented Select3D_SensitiveCylinder class performing an analytical intersection with an untriangulated cone/cylinder
- added tests
2021-08-27 19:09:09 +03:00
mkrylova
503374ad84 0032182: Visualization - add Select3D_SensitiveSphere
- created Select3D_SensitiveSphere class
- implemented interfaces for intersection methods
- added tests
2021-06-24 19:52:25 +03:00
osa
51d4a4f9d0 0032390: Visualization, SelectMgr_FrustumBuilder - use camera instead of duplicated methods
Fix incorrect value of axis intersection with segment inside of SelectMgr_AxisIntersector::raySegmentDistance().
Move camera definition to base intersector (it is not possible to set it for axis intersector, is is not applicable).
Add method Graphic3d_Camera::SetIdentityOrientation() to set camera parameters to make current orientation matrix identity one.
Remove all matrices from selection intersectors and frustum builder and use camera instead of them.
Fix missed axis tests in vselect grid.
2021-06-22 11:17:39 +03:00
kgv
6a920e0243 0032419: Coding Rules - revert Overlaps() methods to SelectBasics_SelectingVolumeManager as deprecated aliases
Deprecated Overlaps() methods have been moved from subclass SelectMgr_SelectingVolumeManager
to the base class SelectBasics_SelectingVolumeManager,
so that they are actually accessible within Select3D_SensitiveEntity::Matches() implementations.

Several methods have been marked as pure virtual in the base interface.
Second SelectMgr_BaseIntersector::OverlapsPolygon() has been dropped from virtual interface
as useless (trivially replaceable).
2021-06-04 19:10:46 +03:00
mkrylova
03c9cc86c6 0032337: Visualization - rename Overlaps() method in selection to more self-describable names
- renamed Overlaps and hasOverlap overloaded methods to self-describable names
2021-05-26 20:02:42 +03:00
osa
0461e7fd03 0032338: Visualization - provide straightforward interface for ray-picking 2021-05-22 10:36:39 +03:00
osa
e1eb39d29d 0032365: Visualization - refactoring of viewer selector
Add SelectMgr_BaseIntersector class as base intersector that can have any geometry not only frustum.
Remove cached static array of selecting volumes from selecting volume manager. Keep only one the latest active selection volume.
Change initialization interface of active volume frustum inside of selecting volume manager: Init*SelectingVolume(), set required parameters, BuildSelectingVolume(). Mark existing BuildSelectingVolume() methods as deprecated.
Use SelectMgr_SelectionType instead of SelectBasics_SelectingVolumeManager::SelectionType (the last one is marked as deprecated).
Add interface GetViewRayDirection() to selecting volume manager to get view ray direction (instead of computation it as vector from near to far point).
Add interface IsScalableActiveVolume() to selecting volume manager to check possibility of scaling of current active selecting volume.
2021-05-22 10:36:39 +03:00
sshutina
a516227511 0031354: Visualization - Dump improvement for V3d, Graphic3d, Aspect
- do not dump light in view as it's dumped in the viewer
2020-09-04 18:14:24 +03:00
kgv
7d47ebdbcd 0030617: Coding - using reinterpret_cast instead of static_cast for downcast
Several reinterpret_cast have been replaced by static_cast when applicable.
2020-09-02 18:48:56 +03:00
kgv
72e9e86732 0031650: Visualization - invalid picking of object with local transformation and per-object clipping plane
SelectMgr_SelectingVolumeManager::SetViewClipping() now updates clipping range
using picking ray in world coordinates, as clipping planes are always defined in world space.
2020-07-06 18:31:14 +03:00
mzernova
a24a782174 0031440: Visualization - Impossible to make common behaviour for multi-selection in viewer
A special mode for the selecting by polygon is added to select only completely overlapping objects.

In order to track the sensitives that were included completely by defined polygon, the boundary points of the polygonal frustrum are stored in the variable myBoundaryPoints.

If an sensitive intersects with at least one of the frustrums from myFrustums, then checking whether this object intersects with borders using the isIntersectBoundary method; if not, then the sensitive were included completely by defined polygon.

Because the polygon can be concave, then to check the sensitive were included completely by defined polygon, it is not enough to check of all its points, it is necessary that the edges of the sensitive do not intersect polygonal frustrum. To do this, for polygonal selection, a call to the Overlaps method for a point was replaced by a call to a segment where necessary.

bugs/vis/bug31440: test case added
2020-04-23 10:44:30 +03:00
nds
bc73b00672 0031313: Foundation Classes - Dump improvement for classes
- Provide DumpJson for geometrical, ocaf and visualization classes;
- Change depth parameter of DumpJson (constant is not obligate here)
- Introduce a new macro for transient objects to be called as the first row in DumpJson: OCCT_DUMP_TRANSIENT_CLASS_BEGIN. We need not put the class name in the macro, using get_type_name of Standard_Transient for it.
- change implementation of OCCT_DUMP_CLASS_BEGIN and OCCT_DUMP_TRANSIENT_CLASS_BEGIN. It is not an sentry more and it does not create a new hierarchy level. It appends a new row into the output stream: "className": <className>
- OCCT_DUMP_* does not require semicolon
- class header is included first in source files of TDataStd, TDocStd, TCAFDoc
2020-01-31 17:13:40 +03:00
kgv
d7fa57a7a3 0030906: Visualization, SelectMgr_ViewerSelector - Object clipping planes overrides View clipping plane for next objects
Clipping range has been moved from SelectMgr_RectangularFrustum to SelectMgr_SelectingVolumeManager
and passed to frustum as an argument to Overlap() methods.
This fixes an issue when Clipping is customized per-object within SelectMgr_ViewerSelector::traverseObject()
in case when shallow copy of SelectMgr_SelectingVolumeManager is created
(frustums are copied from global frustum manager by Handle).
2019-08-23 16:56:37 +03:00
kgv
208dc370ac 0030863: Visualization, SelectMgr_ViewerSelector - disabling of View clipping planes is ignored for transformed objects
SelectMgr_ViewerSelector::computeFrustum() - fixed lost clipping planes when creating a new frustum.
2019-08-09 17:36:47 +03:00
kgv
fe525c6f7c 0030777: Visualization - Incorrect selection/highlighting of clipped objects
SelectMgr_ViewerSelector::traverseObject() now handles Object clipping planes in the same way as View clipping planes.
2019-06-20 15:20:51 +03:00
kgv
4a056d205b 0030058: Visualization, Select3D_SensitivePrimitiveArray - the selection is not fast enough
Select3D_SensitiveSet::Matches() has been improved to check if BVH node is fully included by selection volume
and pass this information to overlapsElement()/elementIsInside() interfaces
to avoid expensive partial overlapping checks for individual elements.
Select3D_SensitivePrimitiveArray implements this new interface to improve partial overlapping performance.
Select3D_SensitivePrimitiveArray::Matches() now handles rectangle selection for sub-elements when Elements map is defined.
Added missing const to SelectMgr_BaseFrustum::Overlaps() methods.

AIS_PointCloud has been extended with new selection mode for collecting selected nodes

Draw Harness command vdrawparray has been extended with an option -shape
allowing to create a triangulation from tessellated shape.
2018-08-24 18:03:33 +03:00
mnv
170175554f 0029938: Visualization - SelectMgr_ViewerSelector::PickedPoint() should return point lying on an object
Extended SelectBasics_PickResult structure by myObjPickedPnt field, which contained the value of the 3d point on the selected object.
Changed all Overlaps methods. Parameter theDepth replaced on object of the structure SelectBasics_PickResult. This approach will be able to add new fields to SelectBasics_PickResult structure without big changes in modules which contained Overlaps method.
2018-08-02 18:47:38 +03:00
ski
9775fa6110 0026937: Eliminate NO_CXX_EXCEPTION macro support
Macro NO_CXX_EXCEPTION was removed from code.
Method Raise() was replaced by explicit throw statement.
Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer.
Method Standard_Failure::Caught() is deprecated now.
Eliminated empty constructors.
Updated samples.
Eliminate empty method ChangeValue from NCollection_Map class.
Removed not operable methods from NCollection classes.
2017-02-02 16:35:54 +03:00
kgv
8b1441e374 0027945: Visualization - handle correctly view clipping planes within zoom-persistent objects
OpenGl_Structure::Render() and SelectMgr_ViewerSelector::checkOverlap()
now clip entire zoom/rotate persistence object
by checking anchor point with global clipping planes.

Image dump has been added to the new test case.
2016-10-13 14:01:37 +03:00
kgv
949c9b7f28 0027891: Visualization - FPE due to use of DBL_MAX in SelectMgr_SelectingVolumeManager::DetectedPoint() 2016-09-30 11:17:12 +03:00
kgv
3202bf1e9e 0027816: Visualization - provide an API for overriding clipping planes list
Graphic3d_SequenceOfHClipPlane now inherits Standard_Transient.
PrsMgr_PresentableObject, Graphic3d_Structure, Graphic3d_CStructure,
V3d_View, OpenGl_View now manages the plane list by Handle.
The getters ::GetClipPlanes() has been removed,
setters taking non-handle ::SetClipPlanes() has been marked deprecated.

OpenGl_Structure::Render() and SelectMgr_ViewerSelector::checkOverlap()
now disable global (view) clipping planes for objects
with flags Graphic3d_TMF_TriedronPers and Graphic3d_TMF_2d
or with new flag Graphic3d_SequenceOfHClipPlane::ToOverrideGlobal().

OpenGl_Clipping now implements interface for managing clipping planes
without copying the sequences.
The filtering of duplicates is no more performed by OpenGl_Clipping
- application is responsible to not do this.
OpenGl_Clipping tries avoiding unnecessary allocations for managing
list of active planes.

MFC sample has been updated to use V3d_View::ClipPlanes() method.
2016-09-15 12:09:20 +03:00
apl
099f351396 0027739: Visualization, TKV3d - implement individual acceleration data structure for selection of 2D persistent objects
Low-level selection algorithms has been improved to explicitly support 2D
transformation persistent objects. This patch generally touches:

1) SelectMgr_SelectableObjectSet - the lists of objects has been split onto three
subsets (regular, 3d-persistent, 2d-persistent). Each subset has individual BVH
tree. The algorithms are now have more flexibility to update only those trees
that is really required for actual camera state.

2) SelectMgr_ViewerSelector - explicitly supports Eye space selection operations
on BVH tree for 2d-persistent subset. Change of camera position does not
anymore affect acceleration data structure (BVH tree) of 2d-persistent selectable objects.

3) Other classes from SelectMgr have been fine-tuned to provide appropriate API.

Porting notes:

This patch touches very low-level selection classes. If the low-level features were used
the following modifications may need to be considered for porting:

1) Iteration over objects of SelectMgr_SelectableObjectSet should now
be implemented with corresponding Iterator class.

2) SelectMgr_BaseFrustum::ScaleAndTransform and derived classes return
Handle(SelectMgr_BaseFrustum) instead of NCollection_Handle<> type.

Small correction of test case for issue CR27739
2016-09-15 11:35:10 +03:00
vpa
21a8e27535 0027611: Visualization - provide an interface to access selection frustum center points from SelectBasics level
- getters for rectangular frustum center points were added to SelectBasics_SelectingVolumeManager
2016-06-23 18:14:05 +03:00
aba
91d9637224 0027536: Visualization - incorrect behavior of zoom persisted objects
1) Zoom persistence mode now fixes object in pixel coordinates and  is independent on view size

2) Used gp_GTrsf instead of gp_Trsf SelectMgr_ViewerSelector to store  Graphic3d_Mat4d

3) Zoom persisted objects changed behavior (become bigger) therefore test cases were updated according to new state.

4) Corrected scale for rectangular frustum

Updated test for manipulator
2016-06-09 12:29:09 +03:00
vpa
114b7bf18f 0027180: Visualization - improve selection logic of MeshVS_Mesh
MeshVS_Mesh selection logic in MeshVS_SMF_Mesh mode (entire mesh) has been optimized.
MeshVS_Mesh::ComputeSelection() now creates single sensitive entity
MeshVS_CommonSensitiveEntity (new class) instead of small sensitive entity on each element.
MeshVS_SensitiveQuad (new class) and Select3D_SensitiveTriangle are used instead of Select3D_SensitiveFace for local selection to reduce memory consumption when possible.
2016-03-03 14:17:17 +03:00
vpa
e9312c0fc2 0026973: Visualization - selection of entities hidden by clipping planes is broken
- misprint in distance calculation in SelectMgr_RectangularFrustum::IsClipped is corrected;
- selecting volume manager in clipping check in SelectMgr_ViewerSelector::checkOverlap was replaced ;
- added view-defined clipping planes check to SelectMgr_RectangularFrustum;
- test case for issue #26973.
2015-12-17 18:07:57 +03:00
vpa
3bf9a45f7a 0026195: Visualization - optimize selection algorithms
- initial transformation of triangulation is now applied to selecting frustum;
- switched from NCollection_Vec3 to gp collections to avoid conversions and usage of macros;
- calculation of frustum was refactored to reduce its build time;
- double pixel tolerances for selection were replaced by integer ones;
- switched to splitting along the main axis only in SelectMgr BVH selection primitive sets.
2015-09-10 15:00:04 +03:00
apl
825aa485a3 0026344: Visualization - provide a support of zoom persistent selection
1) New Graphic3d_TransformPers structure for defining parameters and algorithm methods, featuring:
    a) application of transformation to projection and world view matrices;
    b) computation of model-world transformation of persistent object;
    c) computation of transformed bounding box of persistent object.

2) Transform persistence algorithm does not make any changes to model-world transformation of object (deals with projection and world view matrices only), thus making possible to employ local transformation in a usual way.

3) Support of BVH selection for transform persistent objects (pan, rotate, zoom, trihedron persistence only).

4) Support efficient frustum culling for transform persistent objects (pan, rotate, zoom, trihedron persistence only).

5) Support of z-fitting algorithm for world-view space transform persistent objects (rotate, zoom persistence only).

6) Rewrite usage of transform persistence structures and utilities classes:
    a) Replaced Graphic3d_CTransPers, TEL_TRANSFORM_PERSISTENCE by Graphic3d_TransformPers;
    b) Move functions from OpenGl_Utils.hxx to Graphic3d_TransformUtils.hxx;
    c) Extract matrix stack class from OpenGl_Utils.hxx to OpenGl_MatrixStack.hxx;

7) New class Graphic3d_WorldViewProjState to keep track of projection, world view matrices changes for a camera.

8) New test case bugs/vis/bug26344.

9) Renamed method Graphic3d_Camera::ModelViewState of  to ::WorldViewState for consistency.
2015-07-29 13:39:27 +03:00
vpa
2157d6ac63 0026147: Visualization - restore the ability to pick only fully included objects in rectangular selection
2 modes of rectangular selection are available: inclusion-only and overlap-allowing;
The modes can be switched using method AllowOverlapDetection from StdSelect_ViewerSelector3d;
BVH for sensitive entities now builds if there is more than max number of leafs in collection;
Added option -allowoverlap to command vselect;
Interactive rectangular selection in Draw is now available in 2 modes:
- if the user starts selection from upper corners, only fully included objects will be selected;
- if the user starts selection from lower corners, both partially and fully overlapped objects will be selected.
2015-05-08 08:54:08 +03:00
vpa
28ee613b27 0026159: Visualization - revise tolerance implementation for selection
Max tolerance is now applied to all objects and entities by default;
if there is an entity with a lower tolerance, selecting frustum will be recalculated for it.
The ability to set sensitivity for each entity individually is moved to protected section of SelectBasics_SensitiveEntity
SetPixelTolerance from AIS_InteractiveContext now sets custom tolerance that is applied to all sensitives.
Added -unset option to vselprecision command to disable custom tolerances.
Test case for issue #26159
2015-05-08 08:51:48 +03:00
vpa
7ab159522a 0026069: Coding Rules - eliminate new warnings about redundant const qualifier in SelectMgr
SelectMgr_SensitiveEntity is now inherited from Standard_Transient;
Redundant const type qualifiers were removed from selection classes.
2015-04-30 13:26:34 +03:00
vpa
f751596e46 0024623: Visualization - improve selection mechanism
Redesign of selection mechanism:
- implemented 3-level BVH tree for selection;
- selection now calculates in 3D space;
- intersection tests were moved to SelectMgr_BaseFrustum descendants;
- removed .cdl files in Select3D and .cdl related to selection in MeshVS;
- SelectMgr_ViewerSelectors are now shared between local and global contexts;
- transformations of sensitive entities are now stored in SelectMgr_SelectableObject only. Sensitive entities are independent from transformations, it is applied to SelectMgr_SelectingVolumeManager instance only;
- connected and multiple connected interactive objects are now represented by their child objects only for SelectMgr_SelectionManager;
- if interactive object has child objects, they will be stored as separate objects in SelectMgr_SelectionManager now.
- test cases bugs/vis/bug24623_1, bug24623_2, bug24623_3, bug24623_4 to test performance and memory issues.
2015-04-06 17:27:38 +03:00