1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

492 Commits

Author SHA1 Message Date
kgv
1a96d253a5 0032222: Visualization, V3d_Viewer - use Graphic3d_TOSM_FRAGMENT by default instead of Graphic3d_TOSM_VERTEX 2021-03-25 19:14:27 +03:00
kgv
b8db9379fe 0032203: Draw Harness, ViewerTest - drop dependency from OpenGL
Added TKOpenGlTest and TKD3DHostTest Draw Harness plugins.
TKOpenGlTest is automatically loaded by ViewerTest::ViewerInit().

Commands vgldebug, vvbo, vcaps and vuserdraw have been moved to TKOpenGlTest.
New command vglshaders lists GLSL programs defined by OpenGl_GraphicDriver,
previously implemented by "vshaderprog -list".

Added new command vdriver for graphic driver selection.
Removed erroneous code from command vstereo.
2021-03-17 19:56:54 +03:00
kgv
61a05a3658 0032198: Visualization, TKOpenGl - per-vertex lighting ignores back/front material colors
Graphic3d_ShaderManager::stdComputeLighting() now multiplies vertex color by material color.
2021-03-17 19:53:13 +03:00
kgv
19ed08fda6 0031794: Visualization - Highlighting of AIS_Shape works incorrectly when AddChild() used
PrsMgr_PresentationManager::Display(), PrsMgr_PresentationManager::Color(),
and SelectMgr_SelectionManager::Activate() now skip children in Erased state.
2021-03-05 17:49:17 +03:00
mkrylova
e3d4b87912 0031779: Visualization, AIS_ViewController - controller should handle selection schemes
Added AIS_ViewController::MouseSelectionSchemes() property defining map of selection schemes for mouse+modifier combinations.
IsXOR flag has been replaced by AIS_SelectionScheme in interfaces.

Rubber-band selection with Shift key pressed now applies XOR selection scheme in in Draw Harness.
Command vselect has been extended to specify selection scheme by name.
2021-03-04 19:43:13 +03:00
kgv
42ddd0028c 0032184: Visualization - remove ambiguous AIS_GlobalStatus constructor
Auxiliary AIS_GlobalStatus constructor has been removed.
AIS_InteractiveContext::setObjectStatus() no more adds
an invalid -1 mode to AIS_GlobalStatus.

Never updated property AIS_GlobalStatus::GetLayerIndex() has been removed;
AIS_InteractiveContext::SetTransformPersistence() has been corrected to use
ZLayer defined within object itself.
2021-03-04 19:39:20 +03:00
kgv
33425a46b8 0032143: Visualization - add option excluding transparent object from sorting
Added option Graphic3d_AlphaMode_MaskBlend combining Mask (no sorting)
and Blend (enable blending with background) behavior.
2021-03-04 19:38:16 +03:00
kgv
ba590cbf15 0032180: Visualization - StdSelect_BRepOwner::SetLocation() does not update selected sub-shape
StdSelect_BRepOwner::SetLocation() now propagates location to sub-shape presentation instead of invalidating it.
2021-02-27 15:36:19 +03:00
kgv
53219061ca 0032165: Visualization - remove obsolete method AIS_InteractiveContext::PurgeViewer() 2021-02-26 10:56:32 +03:00
kgv
79d49683d6 0032155: Tests - remove broken command OCC280
Command OCC280 and a couple of useless tests have been removed.
Test case bug349 has been updated to reproduce scenario using standard commands.
2021-02-25 18:55:30 +03:00
kgv
4464c6b591 0032149: Draw Harness, ViewerTest - remove obsolete command vfeedback 2021-02-25 18:55:27 +03:00
luz paz
7b5e532f83 0031939: Coding - correction of spelling errors in comments [part 7]
Fix various typos

Fixed via codespell v2.1.dev
2021-01-20 21:27:44 +03:00
kgv
ba562b2b7a 0031999: Tests - request Core Profile on macOS for Ray-Tracing tests 2020-12-23 19:45:32 +03:00
kgv
4268c64672 0031965: Visualization - AIS_InteractiveContext::HilightWithColor() ignores passed highlight style
AIS_InteractiveContext::highlightGlobal() now passed through Style argument to highlightOwners().
Added OCC31965 command for testing AIS_InteractiveContext::Hilight() behavior.
2020-12-03 18:46:25 +03:00
kgv
0aeb898418 0031729: Visualization, Prs3d_DatumAspect - provide per axis text aspects
Prs3d_DatumAspect::TextAspect() now takes Prs3d_DatumParts argument
and defined separately for Prs3d_DatumParts_XAxis/Prs3d_DatumParts_YAxis/Prs3d_DatumParts_ZAxis.
The method without arguments has been marked as deprecated.

V3d_Trihedron now stores per-label text attributes.
Added method V3d_View::Trihedron() returning V3d_Trihedron object for more straightforward definition.
V3d_Trihedron::SetWireframe() - added missing invalidation.

AIS_Trihedron::setOwnDatumAspect() implementation has been moved to Prs3d_DatumAspect::CopyAspectsFrom()
and now used by Prs3d_Drawer::SetOwnDatumAspects().
OpenGl_Text::render() - added NULL-check.

AIS_Trihedron::computePresentation() now takes into account Prs3d_Datum*Arrow shading/line aspects.

Command vtrihedron has been extended by "-textColor XAxis|YAxis|ZAxis Color" syntax.
Command vviewcube has been extended by "-xAxisTextColor|-yAxisTextColor|-zAxisTextColor" arguments.
2020-11-21 12:19:45 +03:00
mkrylova
0e57793fc6 0031688: Visualization - Wrong ISO lines for a face created from BSpline
Added a check to see if the ISO line intersects the bounding contour.
2020-09-27 12:00:08 +03:00
sshutina
897aeb207f 0031221: Visualization - selection filter in context
- Added the new filter SelectMgr_AndOrFilter which allows to define the context filter. By default OR selection filter is used
 - Added the enumeration SelectMgr_FilterType provides filter types
 - To define behavior SelectMgr_AndOrFilter use  SetFilterType in AIS_InteractiveContext
 - Added the test
 - SelectMgr_OrFilter don't store the disabled objects, it's stored in SelectMgr_AndOrFilter
2020-09-12 20:42:24 +03:00
kgv
d99f0355e3 0031731: Draw Harness - colorize errors and exception messages
Draw_Interpretor, CommandCmd() - catched exceptions and messages put into Tcl string result
before throwing a Tcl exception (return 1) are now print in intense red (using Message::SendFail()).
Duplication of exception message in std::cout and Tcl output has been removed.

Draw Harness plugins have been updated to use either Message::SendFail() or theDI instead of std::cout/std::cerr
for printing colored error message before throwing a Tcl exception.
2020-08-25 09:44:15 +03:00
kgv
76fada6839 0031702: Visualization, TKOpenGl - hatching interior is ignored in second View within the Viewer
Current state variables have been moved out from OpenGl_LineAttributes to OpenGl_Context.
2020-08-14 12:46:34 +03:00
kgv
dbc8becff4 0031673: Draw Harness, ViewerTest - command vlocation applies transformation in opposite order
gp_Trsf::SetRotationPart() - added method replacing rotation matrix without reseting other components,
similar to existing SetTraslationPart() and SetScaleFactor().

Transformation multiplication order has been fixed
for vlocation arguments -rotate, -translate, -mirror and -scale.
Added -prerotate, -pretranslate, -premirror and -prescale options following previous behavior.

vlocation -setRotation now uses new method gp_Trsf::SetRotationPart()
for consistency with methods -setLocation and -setScale.
2020-07-23 16:08:17 +03:00
kgv
6d1d35e4b8 0031652: Visualization - crash on highlighting HLR Computed presentation displayed with Shaded display mode
PrsMgr_PresentationManager::displayImmediate() now uses proper ZLayer for a shadow presentation
of computed presentation (fixes dynamic highlighting on mouse move).
Graphic3d_CView::SetComputedMode() - added invalidation of bounding box on turning OFF compute mode.
AIS_ViewController::contextLazyMoveTo() now ignores MoveTo() while rotating
view with temporary disabled compute mode (leading to undefined results and crashes).

Graphic3d_Structure::Graphic3d_Structure() - do not copy Graphic3d_TOS_COMPUTED visual
from linked structure, as Graphic3d_CView::SetComputedMode() does not compute such structures.
2020-07-08 15:53:31 +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
3e9c1d1e5a 0029993: Visualization - AIS_TextLabel computes selection primitive only for attachment point
The text label is selected as a rectangle (adds a sensitive object - Select3D_SensitiveFace).
The bounding box has been resized to fit the sensitive rectangle.
Transform persistent has been added to AIS_TextLabel to correctly position the sensitive rectangle.
The findConnectedObject function has also been changed to correctly set transform persistence.
2020-07-06 18:31:13 +03:00
mzernova
2ff1d580f1 0031412: Visualization - entity behind is returned as topmost at the edges
SelectMgr_RectangularFrustum now handles degenerated triangle as a segment or a point.
Triangle orthogonal to view direction is now handled as a segment.
myViewRayDir field is now defined as normalized vector to avoid confusing math.

For the case when the segment and myViewRayDir are almost parallel,
the segmentSegmentDistance function may set the depth to zero, although this will not
be the correct value, therefore it is better to pass a segment that will not
be parallel to myViewRayDir as an argument to the function.

vpoint command has been extended by arguments -2d and -nosel
for displaying picking mouse position as on-screen point in pixels.
Fixed double-binding-map error in case of displaying point with already used name.

bugs/vis/bug31412: test case added.
2020-06-25 19:09:04 +03:00
mzernova
9a31c01064 0030922: Visualization - OpenGl_Text wrong local transformation if text has not own attach point
bugs/vis/bug30922: test case added
2020-06-16 14:29:41 +03:00
kgv
23fe70ec52 0031189: Draw Harness, ViewerTest - send messages to Message::DefaultMessenger()
Added short-cuts methods in Message_Messenger for sending message with specified gravity,
and stream buffer class for using stream-like interface for that.
Similar short-cuts to DefaultMessenger() are added in Message package.

ViewerTest has been updated to send messages to Message::DefaultMessenger()
instead of direct output to std::cout/std::cerr.

Off-topic: spelling error (duplicate "and") is corrected in two places

Added test bugs fclasses bug31189
2020-04-30 19:42:44 +03:00
nds
ab9e277f15 0031193: Visualization - OpenGl_Flipping wrong text position if local transformation set
Before the patch, if the values of the isReversedX/Y/Z variables were set to false, then the WorldView matrix did not change and local transformation was not applied, which caused errors.
In order to correctly set the local transformation in case the text does not have its own attach point, the local transformation is set in OpenGl_Text, and the ModelWorld matrix is changed in OpenGl_Flipper, instead of the WorldView matrix. In this case, local transformation will always be applied.

bugs/vis/bug31193: test case added
2020-04-29 16:36:23 +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
abv
14b741b0ef 0031454: Visualization - perceptually uniform color scale
Support of CIE Lab and Lch color spaces is introduced in Quantity_Color:
- Enumeration Quantity_TypeOfColor is extended by new values representing CIE Lab and Lch color spaces (with D65 2 deg illuminant).
- Conversion of RGB color to and from these color spaces is implemented in Quantity_Color class (within existing API).
- Color difference calculation using CIE Delta E 200 formula is implemented in method DeltaE2000().

New methods MakeUniformColors() and SetUniformColors() are added in class AIS_ColorScale, generating and setting color scale based on colors of the same lightness in CIE Lch color model.

DRAW commands vcolorconvert and vcolordiff are added to perform conversions and compute difference, respectively.
A new option -uniform is added in DRAW command vcolorscale, to set uniform color scale.

Added test grid v3d colors (color conversions and difference), test bugs vis bug31454 (uniform color scale)
2020-03-26 19:53:27 +03:00
kgv
67441d0ca3 0031424: Visualization - stop using Prs3d_Drawer::HLRAngle() parameter
Prs3d_Drawer, AIS_Shape, AIS_InteractiveContext - removed properties HLRDeviationCoefficient() and HLRAngle().
Prs3d_Drawer::HLRAngle() is kept as alias to Prs3d_Drawer::DeviationAngle() with deprecated flag.
Prs3d_Drawer::DeviationAngle() default value is changed from 12 to 20 degrees
to match Prs3d_Drawer::HLRAngle() which has been previously used in majority of cases.
Removed unused property HLRBRep_PolyAlgo::Angle().
2020-03-16 16:56:30 +03:00
kgv
29263c947e 0031425: Visualization - free Edge has selection sensitivity inconsistent to presentation
BRepTools::Triangulation() has been extended with a new parameter for checking Poly_Polygon3D presense within free Edges.
StdPrs_WFShape::Add() now performs auto-triangulation in the same way as StdPrs_ShadedShape::Add().
StdSelect_BRepSelectionTool::GetEdgeSensitive() now creates Select3D_SensitiveSegment instead of Select3D_SensitiveCurve for tessellated segment.
Select3D_SensitiveSegment default sensitivity factor has been changed to 3 pixels to match Select3D_SensitiveCurve.

Test case bug23625_1, added workaround for out-of-range crash in HLRBRep_PolyAlgo on re-triangulated shape.
2020-03-12 19:29:23 +03:00
kgv
d850414af1 0031315: Visualization - marker texture is lost after multi-textured object
OpenGl_Context::BindTextures() now iterates over pair of texture sets
considering inconsistent texture unit ranges.
2020-02-19 19:31:58 +03:00
kgv
a2803f37e7 0031341: Visualization - Graphic3d_Layer::UpdateCulling() ignores Presentation range
Graphic3d_Layer::UpdateCulling() now takes into account BVH_Tree::EndPrimitive().
'vstatprofiler structs' now properly prints number of structures in case of no culling.
2020-02-11 18:42:13 +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
ba00aab7a0 0029528: Visualization, TKOpenGl - allow defining sRGB textures
OpenGL rendering is now done into sRGB framebuffer.
OpenGl_ShaderManager::prepareStdProgramFboBlit() has been extended
by programs resolving MSAA texture and applying gamma correction as fallbacks.

Quantity_Color definition has been modified to store RGB components
in linear color space within Quantity_TOC_RGB type.
Standard colors defined by Quantity_NameOfColor enumeration has been updated accordingly.
New Quantity_TOC_sRGB type has been introduced to handle RGB components in non-linear sRGB color space.

OpenGl_TextureFormat class definition has been moved to dedicated files.
New method OpenGl_TextureFormat::FindFormat() replaces OpenGl_Texture::GetDataFormat().
New method OpenGl_TextureFormat::FindSizedFormat() replaces OpenGl_FrameBuffer::getColorDataFormat()
and OpenGl_FrameBuffer::getDepthDataFormat().

Graphic3d_TextureRoot::IsColorMap() - introduced new property defining
if RGB(A)8 image formats should be loaded as sRGB(A) textures or as data RGB(A) textures.
OpenGl_Texture initialization methods have been extended with new theIsColorMap argument.

vreadpixel - added argument -sRGB printing color in sRGB color space.

Test cases have been updated to new sRGB rendered results.
2019-10-22 15:15:52 +03:00
kgv
aaf8d6a98d 0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.

Quantity_NameOfColor - grayscale enumeration values have been re-ordered to fix discontinuity.
Duplicating colors has been merged within enumeration:
  CHARTREUSE=CHARTREUSE1, GOLD=GOLD1, GREEN=GREEN1, ORANGE=ORANGE1,
  ORANGERED=ORANGERED1, RED=RED1, TOMATO=TOMATO1, YELLOW=YELLOW1.
Added aliases to several other common colors:
  BLUE=BLUE1, CYAN=CYAN1, LIGHTCYAN=LIGHTCYAN1, MAGENTA=MAGENTA1.

Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
Removed unused class Quantity_ColorDefinitionError.

New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
Image_PixMap::PixelColor() and Image_PixMap::SetPixelColor() methods have been extended
with an optional argument for performing linearization/delinearization of 8-bit sRGB pixel formats.

Draw Harness command AISColor has been corrected to take color name instead of enumeration index.
2019-10-22 15:15:51 +03:00
drazmyslovich
8c186dad9b 0025044: BRepMesh tweaks - treatments for degenerated and tiny faces
BRepMesh_ModelHealer - recognize a small face with 1 wire and 2 small edges as a face for refinement.
BRepMesh_DefaultRangeSplinner - reduce tolerance on tiny faces to improve the meshing results.

Added new test cases: bugs mesh bug25044_*.
Existing test cases updated to reflect improvements.
2019-09-25 17:46:57 +03:00
ifv
e774a5534c 0030907: Visualization Algorithms - failure on attempt to compute iso-lines for an offset face made by a face of linear extrusion
The visualization code drawing iso-lines has been protected against getting iso-lines of infinite offset surface. In such case the surface is trimmed by UV bounds of the face.
Test case added
2019-09-24 13:18:28 +03:00
nds
0904aa6395 0030949: Foundation Classes - Dump improvement for OCCT classes
1. new file Standard_Dump to prepare and parse Dump in JSON format for OCCT objects
2. some presentations cover the proposed dump functionality.
3. 'bounding', 'vaspects' has '-dumpJson' field to see the DumpJson result
4. Bnd_Box constructor with min/max points is implemented to use Dump of this class in Dump BVH_Box
5. Limitation (some classes of Graphic3d, Prs3d has not full filling for DumpJson)
2019-09-20 19:39:28 +03:00
mzernova
fdae2107d9 0030946: Visualization - Image_AlienPixMap ignores 1-bit pixelformat when using FreeImage
Convert 1-bit image to 8-bit one during its loading because only greyscale images are supported by visualization
2019-09-14 11:45:35 +03:00
kgv
14c7f553a9 0030942: Draw Harness, ViewerTest - command vdefaults should abort script on unknown argument 2019-09-06 18:26:42 +03:00
kgv
61f73653ba 0030915: Visualization - AIS_ColorScale::FindColor() returns Wrong color for maximal value
Map the very upper value (theValue==theMax) to the largest color interval.
2019-08-26 15:16:14 +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
nds
8996b4490a 0030695: Visualization - selection by box should use clipping planes set for viewer - moving check on touching the clipping plane in selection only. 2019-08-07 19:54:06 +03:00
kgv
607e5e62e7 0029837: Visualization, Graphic3d_Camera - Fit All operation works incorrectly on flat object
Graphic3d_Camera has been revised to store camera Direction from Eye explicitly
and Distance to Center instead of auxiliary Center point.

This allows setting camera Distance to 0 (for flat objects) without side effects
like broken FitAll, wobbling on rotating.
2019-07-30 19:34:49 +03:00
ika
6b9b7e3c92 0030630: Visualization - wrong visualization of shape with mirrored transformation
Solids with mirror location are displayed, according to their normals.

vaspects -setBackFaceColor, added command to set backface color.
2019-07-18 11:09:08 +03:00
asl
0d56f7433b 0030824: Visualization, PrsMgr_PresentableObject - A new flag to disable automatic selection of children
A new flag myToPropagateVisualState is introduced for PrsMgr_PresentableObject: by default it is true, it means that the visual state (display/erase/color) should be propagated to all children. If false, the visual state is not propagated.
The flag can be set via the method ToPropagateVisualState() or via Draw command: "vparent <parent> -ignoreVisu"
2019-07-04 19:36:30 +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
49582f9dbf 0030507: Visualization - introduce AIS_ViewController
ViewerTest_EventManager now inherits AIS_ViewController.
Platform-dependent user input handling within ViewerTest has been revised
to process events in common way through AIS_ViewController.
The mouse navigation has been changed, so that left mouse clicked
without modifers now rotates View.
The rubber-band selection can be activated via Alt+LeftMouseButton.
Selection is now done on mouse unclick and keyboard short-cuts take effect on unclick.

Aspect_Window::SetTitle() - added new method configuring Window title.
Introduced new types Aspect_Touch, Aspect_VKey, Aspect_ScrollDelta
for processing window events in platform-independent way.
2019-06-13 18:50:12 +03:00
kgv
edc4ba21c4 0030756: Visualization, TKOpenGl - capping plane does not work for ZLayer with non-zero origin
OpenGl_CappingPlaneResource::updateTransform() now takes into account ZLayer origin.

Fixed VT_ProcessKeyPress() passing arbitrary input to Draw::Atoi() leading
to messages in console like "unclosed braces".
2019-05-30 18:42:32 +03:00