1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

..

87 Commits

Author SHA1 Message Date
abv
3870430b9c Test for 0023979: Performance problem of STEP export for large files 2019-09-04 18:28:49 +03:00
jgv
a22151d83c 0030927: Modeling Algorithms - UnifySameDom looses the Closed flag for wires
Add setting the Closed flag for a new wire
2019-08-30 18:07:53 +03:00
vro
990d032c90 0030926: Data Exchange - Change of the number of GDT points of a View may lead to a crash 2019-08-29 19:09:49 +03:00
kgv
b383a61fbd 0030923: Visualization, AIS_ViewCube - avoid mixing non-zoomable text and trihedron-persistence
Box sides labels are now drawn with zoomable flag.
2019-08-29 19:08:55 +03:00
anv
07f2064617 0030919: ACIS Import - Improving translation of string attributes into XDE
- Added possibility to get (or create if absent) a properties attribute via ShapeTool;
- Added Draw command to print properties attached to a Label.
2019-08-29 19:07:12 +03:00
emv
fb64d0f4a2 0030914: Modeling Algorithms - Improve performance of UnifySameDom algorithm for specific case with many edges
Use cached containers to find the necessary shapes.
2019-08-29 19:06:12 +03:00
emv
115d350e09 0030913: Invalid result of Fusing slices
Refactoring of the Line-Line intersection method strengthening the parallel and coincidence criteria to allow almost parallel lines have an intersection point.
2019-08-29 19:04:39 +03:00
emv
3dd193aa6d 0030903: Bug in IntCurvesFace_ShapeIntersector
When classifying the intersection point check the ON status in 3D - compare the 3D distances with 3D tolerance.
2019-08-29 19:03:48 +03:00
kgv
87018b452a 0030924: Coding - incorrect header in file OSD_ThreadPool.hxx
Fixed license statements within files BRepGProp_MeshProps.cxx, BRepGProp_MeshProps.hxx,
OSD_ThreadPool.cxx and OSD_ThreadPool.hxx.

Removed non-ASCII char from BRepMesh_ModelHealer.hxx.
2019-08-29 19:02:45 +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
nds
8ed0708507 0030857: Visualization - using one implementation of Text in graphic group
Graphic3d_Group::Text(...) are obsolete, AddText() should be used instead of these methods.
Graphic3d_Text is a new class for parameters necessary to fill OpenGl_Text. All parameters of Graphic3d_Group::Text() are moved into this class.

OpenGl_TextParam is removed, these fields were moved into Graphic3d_Text.
OpenGl_Text constructors/Init with OpenGl_TextParam parameter were removed. Constructor with Graphic3d_Text should be used instead of it.
Using OpenGl_Text Init() with OpenGl_TextParam should be now replaced on two cases. The first case is setting values into Graphic3d_Text and the second case is calling Reset() after. As example, look at modification in OpenGl_FrameStatsPrs.
2019-08-23 16:58:25 +03:00
iko
077a220c51 0030807: Visualization, TKOpenGl - supporting cubemaps
A cubemap texture initialization has been implemented.
Setting environment cubemap as interactive background is posssible now.
2019-08-23 16:56:40 +03:00
emv
c5cee3222f 0030905: Modeling Algorithms - Faulty shapes in UnifySameDomain
Make face FORWARD before adding wire in it.
2019-08-23 16:56:39 +03:00
anv
e837b3a26c 0029662: Modeling Data - Allow replacement of Compounds via BRepTools_ReShape
- Fixed condition to allow proceeding of nested compounds;
- Added new key to "reshape" draw command to state a level of type until which requests are taken into account;
- Test case added.
2019-08-23 16:56:39 +03:00
drazmyslovich
846245d4b2 0030874: Modeling Algorithms - GCPnts_TangentialDeflection inserts the points between nearby points
Check the points distance before inserting a new point in between.
2019-08-23 16:56:38 +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
0be11733a7 0030901: Visualization - OSD_MemInfo moving memory computation out of the constructor 2019-08-16 17:34:37 +03:00
kgv
c64135f723 0030900: Configuration - fix compilation using macOS SDK before 10.12
ViewerTest - added compatibility defines.
2019-08-16 12:16:47 +03:00
kgv
5e2477a7bd 0030899: Data Exchange, RWObj_Reader - reading multiline file with more than one line separator leads to memory corruption
Fix misprint in condition.
2019-08-16 12:16:43 +03:00
msv
8e7dc6f465 0030897: Modeling Algorithms - Crash in UnifySameDomain [Regression]
The regression caused by the patch for 0030534 has been eliminated. For that the method InsertWiresIntoFaces() has been corrected: the face to which a wire is added is first oriented as forward.
2019-08-16 12:16:40 +03:00
kgv
2546fd477f 0026978: VIS - Interactive selection is insensitive to swept shell
IVtkOCC_SelectableObject::BoundingBox(), AIS_Shape::BoundingBox() now don't use
BRepBndLib::AddClose() on arbitrary shapes.
2019-08-16 12:16:40 +03:00
kgv
7fab82af5f 0008239: Foundation Classes - directive "using namespace std" doesn't allow to build application with OCC and other 3rd party libraries
Standard_Stream.hxx no more adds "using std::" entities.
2019-08-16 12:16:39 +03:00
tiv
0423218095 0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
"endl" manipulator for Message_Messenger is renamed to "Message_EndLine".

The following entities from std namespace are now used
with std:: explicitly specified (from Standard_Stream.hxx):
std::istream,std::ostream,std::ofstream,std::ifstream,std::fstream,
std::filebuf,std::streambuf,std::streampos,std::ios,std::cout,std::cerr,
std::cin,std::endl,std::ends,std::flush,std::setw,std::setprecision,
std::hex,std::dec.
2019-08-16 12:16:38 +03:00
jgv
3977d18aca 0030286: Cover polygonal HLR algorithm by regression tests
New folder "hlr" with subfolders "exact_hlr" and "poly_hlr" has been created.
Draw command "vcomputehlr" has been corrected.
QA command "OCC27341" has been deleted as "vcomputehlr" does its job.
2019-08-16 12:16:36 +03:00
kgv
9975d32acf 0030888: Data Exchange, RWGltf_CafReader - fix misprint in condition while iterating binary glTF 2.0 chunks 2019-08-13 17:36:58 +03:00
drazmyslovich
a6b55fba08 0030872: In case of failure, retry to acquire the driver for the format 2019-08-09 17:37:29 +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
caa309aaf4 0030854: Visualization, AIS_ViewCube - pack triangulations into common array(s)
Presentation computation has been modified to merge triangulations per box part type.
Prs3d_Drawer::FaceBoundaryDraw() flag is now handled for drawing box sides edges.

Graphic3d_ArrayOfPrimitives has been extended by auxiliary methods:
- ::AddSegmentEdges(), ::AddTriangleEdges(), ::AddQuadEdges() raising exception on wrong primitive type.
- ::AddQuadTriangleEdges() splitting quad into indexed triangulation;
- ::AddTriangleStripEdges() splitting triangle strip into indexed triangulation;
- ::AddTriangleFanEdges() splitting triangle fan into indexed triangulation;
- ::AddPolylineEdges() splitting polyline into indexed segments.
2019-08-09 17:36:47 +03:00
emv
6f5db50804 0030869: Modeling Data - BRepAdaptor_CompCurve incorrectly evaluates the boundary points
Problem is solved by #0029430. Integrating test case only.
2019-08-09 17:36:46 +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
nds
87bda9d805 0030425: Visualization - possibility to redefine AIS_Selection 2019-08-06 17:27:37 +03:00
abv
ba83248011 0030865: Samples - sample for 3D version of new OCC logo
Added new Tcl sample "logo2019.tcl" and relevant test demo/samples/logo2019
2019-08-06 17:23:55 +03:00
msv
b1bb21e714 0030864: Global variable Version defined in TopTools_ShapeSet.cxx is superseded by same name variable from executable
The variable Version defined in TopTools_ShapeSet.cxx has been declared as static to limit its scope.
2019-08-06 17:19:43 +03:00
ika
da7e894868 0030856: Data Exchange - Wrong colors after STEP file import
Fix processing of colors, attached to assemblies in STEP file.
2019-08-06 17:14:42 +03:00
jgv
389b9d5ca3 0030534: Regression in the tool UnifySameDomain - the shape looses faces
1. Add method TransformPCurves to ShapeUpgrade_UnifySameDomain - to rotate and translate existing pcurves instead of projecting.
2. Modify method ShapeUpgrade_UnifySameDomain::IntUnifyFaces - now it does not apply ShapeFix to new wires and new faces.
3. In the method UnifyEdges: add merging degenerated edges.
2019-08-02 15:48:00 +03:00
mpv
c2100640f6 0030835: Possible performance improvements in methods TDF_Label::FindAttribute
Make attribute iterator work with pointers to attributes, so, creation of handle on each iteration is avoided.
2019-08-02 15:42:54 +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
kgv
e36ee9677a 0026154: Visualization - v3d viewer grid disappears due to automatic z-fit
V3d_RectangularGrid, V3d_CircularGrid, fixed initialization of presentation bounding box (lost Z offset).
2019-07-30 19:33:20 +03:00
kgv
f6b4e578cd 0030855: Coding - New warnings within Standard_ReadLineBuffer after integration fix for 0030830
Added missing cast.
2019-07-28 12:24:53 +03:00
kgv
59515ca600 0030744: Visualization, TKOpenGl - stipple line does not work on OpenGL ES 2.0
OpenGl_ShaderManager now provides fallback stipple lines GLSL code for obsolete OpenGL ES 2.0 devices.
OpenGl_Caps has been extended by flags disallowing OpenGL extensions usage
and restricting upper OpenGL version to be used by OCCT for testing purposes.
2019-07-27 12:05:35 +03:00
osa
fa1710b567 0030830: Point Cloud Rendering - use temporary buffer to read lines from .pts and .ptx files
Add Standard_ReadLineBuffer - auxiliary tool for buffered reading of lines from input stream.
2019-07-27 12:04:26 +03:00
kgv
9460f8c0b9 0030853: Visualization, AIS_ViewController - fix 1 pixel Y shift while zooming
Fixed error in math converting Y-down mouse coordinates into Y-up within AIS_ViewController::handleZoom().
Added flags ToStickToRayOnZoom()/ToStickToRayOnRotation() enabled by default,
which will project picked point onto ray at mouse cursor to preserve focus on zoom out.
2019-07-27 12:04:25 +03:00
kgv
a3a3ff3d33 0030850: Visualization, OpenGl_Text - text within trihedron persistence jitters when camera is far from origin
OpenGl_Text now discards (redundant) translation part from camera orientation matrix.
Text anchor point alignment to integer coordinates is now not performed for 3D-oriented text.
2019-07-19 12:23:02 +03:00
aba
2108d9a25b 0028954: Visualization - implement interactive object for camera manipulations
Added new class AIS_ViewCube implementing interactive cube
displaying orientation of the main axes of the model space in the viewer.
Each side, edge, or corner of the cube corresponds to particular orientation of the camera,
and the class provides methods to move the camera to corresponding position (with animation if needed).

AIS_InteractiveContext::LastActiveView(), added new property returning the last View processed by MoveTo() event.
AIS_InteractiveContext::BoundingBoxOfSelection(), added method returning bounding box of selected objects.
SelectMgr_EntityOwner::HandleMouseClick(), added new callback for handling
mouse clicks by owner itself without automatic highlighting and clearing previous selection.
Called by AIS_InteractiveContext::Select() method.

AIS_ViewController::ViewAnimation() has been extened with camera animation propery,
which can be bound to AIS_ViewCube for smooth embedding into event loop.

Prs3d_ToolDisk has been extended with parameters specifying angle range.
Graphic3d_MaterialAspect now initializes all coefficients to 1.0
when Graphic3d_NOM_UserDefined is passed to class constructor.
AIS_AnimationCamera::update() now sets the end camera position if animation duration is 0.
Prs3d_DatumAspect, added missing setters.

New command vviewcube has been added.
2019-07-19 12:23:01 +03:00
msv
e8dec5e171 0030790: [REGRESSION] Modeling Algorithms - Crash when loading specific step file
The problem occurred when the algorithm IntCurvesFace_Intersector was called for a face occupying zero extension along V direction. This is obviously a bad face, but we need to have the algorithm not crashing the application. So, the algorithm has been protected against such input data. At attempt to make calculations it establishes NotDone status.

Bad test case tests/de/step_3/D9 has been updated.
False memory leak detection has been suppressed in tests/bugs/fclasses/bug7287_2.
2019-07-19 12:23:00 +03:00
mzernova
0dab581700 0030799: Draw Harness, ViewerTest - setup uniforms via vshader command
vshaderprog command now supports setup custom uniforms
2019-07-19 12:23:00 +03:00
kgv
1c728f2d6d 0030668: Visualization - revise adding ZLayer API
V3d_Viewer::AddZLayer() has been replaced by
V3d_Viewer::InsertLayerBefore() and V3d_Viewer::InsertLayerAfter() methods
allowing to specify Layer settings and index of existing layer to insert new one before/after.
The behavior of V3d_Viewer::AddZLayer() has been adjusted to append
new Layer before Graphic3d_ZLayerId_Top
(between Graphic3d_ZLayerId_Default and Graphic3d_ZLayerId_Top).

Graphic3d_Layer now provides LayerId() property.
Graphic3d_ZLayerSettings has been extended with IsRaytracable() property;
Ray-Tracing now processes multiple layers instead of Graphic3d_ZLayerId_Default.

Moved some methods from OpenGl_View to the base class Graphic3d_CView.
2019-07-19 10:23:22 +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
msv
7c08e3ac6e 0030829: BRepExtrema_ShapeProximity crashes with shape from STL/WRL
The fix makes algorithm independent on geometrical data. Only triangulation is needed for its work.
2019-07-18 11:09:08 +03:00
Benjamin Bihler
718d07fe5e 0030403: Application Framework - Overwriting Big BinOcaf Files Does Not Reduce Their Size
OSD_OpenFileDescriptor(), added truncating flag to fopen() flags for std::ios_base::out,
since truncating is implied by C++ output flag.
This fixes misbehavior of OSD_OpenStream() on MinGW-w64 platform.
2019-07-17 15:46:39 +03:00
abv
bc28da5c3a 0029736: Some Warnings During Compound Transfer to IGES Look Dubious
Incorrect (legacy) warnings during IGES export are removed
2019-07-15 15:56:03 +03:00
kgv
2fb08f0132 0030628: [REGRESSION] Data Exchange - Crash on importing STEP file
RWHeaderSection_RWFileDescription::ReadStep(), added check for an empty list.
2019-07-15 15:48:00 +03:00
ysn
b8d92a7f8f 0029987: Request for translation of French comments in the code
French comments in two files have been translated in English.
2019-07-11 13:36:28 +03:00
kgv
f6abd02cdc 0030837: Data Exchange, XCAFPrs_DocumentExplorer - fix misprint in XCAFPrs_DocumentExplorerFlags_NoStyle check 2019-07-11 11:08:15 +03:00
apn
943b4e5b95 0027710: Make Data-exchange test cases more machine independent
Added description of de test grid in user guide.
2019-07-11 11:04:19 +03:00
iko
c55c8fe929 0030833: Visualization - Graphic3d_Camera constructor's exceptions
Field's initialization part has been added to Graphic3d_Camera constructor receiving Handle(Graphic3d_Camera).
2019-07-10 10:41:26 +03:00
oan
4c04741d4c 0030827: Add common functionality allowing to switch triangulation algorithm in runtime
New classes BRepMesh_ConstrainedBaseMeshAlgo, BRepMesh_CustomBaseMeshAlgo and BRepMesh_CustomDelaunayBaseMeshAlgo are added.
These classes allow to add any custom triangulation algorithm to BRepMesh and perform post-processing and optimization of base mesh generated by those algorithms.
BRepMesh_Delaun: added possibility to process constraints when base mesh is generated by different algorithm.
BRepMesh_DelaunayNodeInsertionMeshAlgo: added PreProcessSurfaceNodes flag controlling addition of surface nodes (either before creation of base mesh or after) to gain maximum performance from triangulation algorithms.

Minor changes:
Use simple algorithm for cylinders when internal vertices mode is switched off to speed up computations.
BRepMesh_IncrementalMesh: added Perform method allowing to execute algorithm using manually created Context.
2019-07-08 15:40:36 +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
tiv
acc6542a1b 0030820: Draw Harness, ViewerTest - vsetcolor has no effect on objects created by vsegment and vtriangle
MyPArrayObject class (an interactive object representing some array of primitives) is improved: a possibility of color changing is added to it.
2019-07-04 19:34:27 +03:00
kgv
803bdcdf2b 0030821: Data Exchange, RWGltf_CafReader - fallback to Mesh name in case of Node name is empty
Added option to use Mesh name as fallback, enabled by default.
2019-07-01 13:31:58 +03:00
emv
b6c113d0eb 0030817: Modeling Algorithms - BRepOffsetAPI_MakePipeShell produces invalid result
BRepFill_TrimShellCorner::CheckAndOrientEdges() - When orienting next edge in a sequence take into account the Orientation of the previous edge.
Test cases for the issue.
2019-06-27 16:07:14 +03:00
kgv
82c59511b4 0030811: Data Exchange, RWGltf_CafReader - fix inaccessibility of properties
Added missing Standard_EXPORT and getters.
Fixed metadata loss.
2019-06-26 18:49:23 +03:00
kgv
d9dd07545d 0030810: Data Exchange, RWObj_CafReader - fix material assignment
RWObj_MtlReader fixed incorrect folder iteration within findRelativePath().
Fixed discarding texture-only material.
RWObj_TriangulationReader::addMesh() - fixed usage of wrong material for flushing previous group.
2019-06-26 18:48:16 +03:00
emv
88c3accd1a 0030787: BRepOffsetAPI_MakePipeShell: hangs on the attached model
Protect IntTools_EdgeEdge::FindSolutions method from cases where splitting edge on parts does not give bounding box decreasing.
Use at least Epsilon from edges parameters as a step in BRepLib::FindValidRange.
Test case for the issue.
2019-06-25 19:47:09 +03:00
oan
3c1b70842d 0030780: [Regression to 7.3.0] BRepMesh fails triangulating one face of the shape
Added new parameter KeepSmallEdges to IMeshTools_Parameters allowing to compute min size for each edge locally, depending on the length of particular edge.
Parameter -smalledges now available for incmesh command.
2019-06-25 19:46:09 +03:00
kgv
62810a3c51 0030809: Data Exchange - fix misprint in RWMesh_CafReader::generateNames() 2019-06-25 19:45:05 +03:00
aba
bbf3fcdecd 0030806: Visualization - AIS Manipulator highlighting is not affected by the view affinity
- AIS_Manipalator object view affinity is now applied to presentation for highlighting.
2019-06-25 19:44:07 +03:00
kgv
e05d8d90c0 0030805: Visualization, StdSelect_BRepSelectionTool - empty sensitivity from polygon-only Edge
StdSelect_BRepSelectionTool::GetEdgeSensitive() now takes polygon points before creating curve Adaptor.
2019-06-25 19:42:49 +03:00
kgv
841aa8c47b 0030804: Foundation Classes - Poly_Connect crashes due to out-of-range array modification
Fixed initialization of edges array based on the wrong statement.
2019-06-25 19:41:23 +03:00
kgv
95bde2af7f 0030802: Draw Harness - add scrollbars to DFBrowse 2019-06-25 19:38:47 +03:00
msv
64a4475285 0029679: Draw Harness - Command 2dapprox works wrong when giving points in command line
Correct the behavior of the command 2dapprox for the case of points input in the command line.
Restore the work of the command 2dinterpole (implemented in the same method as 2dapprox).
Add test cases.
Correct generation of snapshots for the tests lowalgos/2dinter/*.
2019-06-24 19:22:47 +03:00
kgv
0c33a0bf4d 0030748: Visualization - Marker displayed in immediate layer ruins QT Quick view controls
OpenGl_Workspace::ResetAppliedAspect() now resets active texture unit to GL_TEXTURE0.
2019-06-22 19:50:10 +03:00
kgv
4151c94d20 0029296: Data Exchange - implement import of mesh data from files in OBJ format
RWObj_Reader and RWObj_CafReader - added new classes reading triangulation from OBJ file.
2019-06-21 18:19:09 +03:00
kgv
0a419c51ed 0030691: Data Exchange - implement import of mesh data from files in glTF format
Added RWGltf_CafReader class implementing glTF reader.
Added readgltf Draw Harness command for reading glTF files.
2019-06-21 18:19:08 +03:00
oan
eec6e810f1 0027685: Visualization of a shape imported from IGES hangs
Adding test case
2019-06-20 15:20:52 +03:00
emv
c2a25d522b 0030785: Mesh - protect BRepMesh_IncrementalMesh::Perform from raising exception
IMeshTools_ModelAlgo and IMeshTools_ModelBuilder have been changed to provide exception protected interfaces for performing the operations.
Protect single Edge/Face discretization methods from raising exceptions to skip broken Edges/Faces and allow mesh construction on the whole model.
2019-06-20 15:20:51 +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
ika
3b739e69c9 0030789: Data Exchange - Some names are lost during STEP import
Add importing name from PRODUCT_DEFINITION_WITH_ASSOCIATED_DOCUMENTS STEP entity.
Update test cases with files contained this entity.
2019-06-20 15:20:50 +03:00
kgv
c9983ee863 0030706: Visualization - fetch font folder list from fontconfig library on Linux
vfont command now prints fonts in alphabetical order.
2019-06-20 15:20:49 +03:00
kgv
912761ea17 0030782: Visualization, Font_FTFont - use predefined fallback fonts for extended Unicode subsets
Font_FTFont now uses fallback fonts for characters from unsupported Unicode subsets,
managed by Font_FTFont::ToUseUnicodeSubsetFallback()
and Font_FontMgr::ToUseUnicodeSubsetFallback() option, enabled by default.
The fallback list includes common font families for Chinese, Korean and Japanese languages.

Font_FTFont::RenderGlyph() now supports FT_PIXEL_MODE_MONO input format used by some CJK fonts.
OpenGl_Font::createTexture() now limits single texture size to circa 4096 glyphs.

test/testgrid now expects test scripts being in UTF-8 encoding in sync with "DRAWEXE -f script.tcl".

AIS::InitFaceLength() - fixed usage of uninitialized result.
2019-06-19 19:42:24 +03:00
emv
1bb67d3844 0030595: Oriented Bounding Box seems not optimal for some shapes
Add possibility of construction of the Optimal Oriented Bounding Box from set of points (the case of shape with triangulation).

The interface of the BRepBndLib::AddOBB method is not changed, but the option <theIsOptimal> now controls also the construction of the OBB from Set of points.
The slightly modified DiTo algorithm will be used, checking all possible axes created by the extreme points.
The performance of the construction of the Optimal OBB is lower but the quality is usually much higher (can't be worse by definition).

Test cases for the issue.
2019-06-17 09:26:54 +03:00
kgv
6b41f0f335 0030754: Coding - the array of weights should begin with Lower, not the constant value 1 within Geom_BSplineCurve.cxx 2019-06-14 18:58:49 +03:00
ika
d6b200e03a 0030779: Data Exchange - Problems with located subshapes in expand compounds
Protect Expand compounds against problems with located subshapes.
Add method XCAFDoc_ShapeTool::AddSubShape() with Boolean output parameter.
Speed up XCAFDoc_ShapeTool::Expand().
Speed up XCAFDoc_ShapeTool::FindSubShape().
2019-06-14 12:27:34 +03:00
mpv
7f662bf4ef 0030761: Application Framework - HOMEDRIVE and TEMP are undefined on UWP
Avoid CDF_Stroe to find default folder since there is no case where this folder does not reset to exact value given by the user.
Also, remove the exception raising for the case this method is called from outside.
2019-06-13 20:18:28 +03:00
nds
13c556d9de 0030725: Visualization - remove Display calling from SetSelected methods of context
AIS_InteractiveContext::Load/ClearGlobal is modified for correct processing SetSelected for child objects.
As Display/Erase of object with children displays/erases these children, then the children status inside context should also be updated.
2019-06-13 18:56:56 +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
szy
61aef3ce05 0030772: Data Exchange - Invalid person's name constructed by STEPConstruct_AP203Context class.
// fixed remarks.
2019-06-10 12:59:39 +03:00
2006 changed files with 36936 additions and 56273 deletions

View File

@@ -633,6 +633,26 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_TBB")
endif()
# RapidJSON
# search for CSF_RapidJSON variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON)
if (CAN_USE_RAPIDJSON)
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
if (USE_RAPIDJSON)
add_definitions (-DHAVE_RAPIDJSON)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_RAPIDJSON")
OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_RAPIDJSON")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_RAPIDJSON")
OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
endif()
# EIGEN
if (CAN_USE_EIGEN)
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")

View File

@@ -1,4 +1,4 @@
TModelingData TKShapeView TKMessageModel TKMessageView
TModelingData TKShapeView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw TInspectorEXE

View File

@@ -440,4 +440,6 @@ t TKVCAF
n XCAFView
n XCAFNoteObjects
t TKRWMesh
n RWGltf
n RWMesh
n RWObj

View File

@@ -73,7 +73,7 @@ if (WIN32)
set (CSF_OpenGlLibs "opengl32.lib")
endif()
else()
else()
if (APPLE)
set (CSF_objc "objc")
@@ -117,5 +117,6 @@ if (WIN32)
endif()
set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_dl "dl")
set (CSF_fontconfig "fontconfig")
endif()
endif()

86
adm/cmake/rapidjson.cmake Normal file
View File

@@ -0,0 +1,86 @@
# RapidJSON
if (NOT DEFINED INSTALL_RAPIDJSON)
set (INSTALL_RAPIDJSON OFF CACHE BOOL "${INSTALL_RAPIDJSON_DESCR}")
endif()
# RapidJSON directory
if (NOT DEFINED 3RDPARTY_RAPIDJSON_DIR)
set (3RDPARTY_RAPIDJSON_DIR "" CACHE PATH "The directory containing RapidJSON")
endif()
# search for RapidJSON in user defined directory
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_RAPIDJSON_DIR OR NOT EXISTS "${3RDPARTY_RAPIDJSON_DIR}")
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" RapidJSON RAPIDJSON_DIR_NAME)
if (RAPIDJSON_DIR_NAME)
set (3RDPARTY_RAPIDJSON_DIR "${3RDPARTY_DIR}/${RAPIDJSON_DIR_NAME}" CACHE PATH "The directory containing RapidJSON" FORCE)
endif()
endif()
endif()
if (NOT DEFINED 3RDPARTY_RAPIDJSON_INCLUDE_DIR)
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of the RAPIDJSON")
endif()
if (NOT 3RDPARTY_RAPIDJSON_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_RAPIDJSON_INCLUDE_DIR}")
set (HEADER_NAMES rapidjson/rapidjson.h)
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "3RDPARTY_RAPIDJSON_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to RapidJSON header file" FORCE)
if (3RDPARTY_RAPIDJSON_DIR AND EXISTS "${3RDPARTY_RAPIDJSON_DIR}")
find_path (3RDPARTY_RAPIDJSON_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_RAPIDJSON_DIR}
PATH_SUFFIXES include rapidjson
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_RAPIDJSON_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include rapidjson
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
# use default (CMake) RapidJSON search
if (NOT 3RDPARTY_RAPIDJSON_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_RAPIDJSON_INCLUDE_DIR}")
if (3RDPARTY_RAPIDJSON_DIR AND EXISTS "${3RDPARTY_RAPIDJSON_DIR}")
set (CACHED_RAPIDJSON_DIR $ENV{RapidJSON_DIR})
set (ENV{RapidJSON_DIR} "${3RDPARTY_RAPIDJSON_DIR}")
endif()
find_package(RapidJSON QUIET)
# restore ENV{RapidJSON_DIR}
if (3RDPARTY_RAPIDJSON_DIR AND EXISTS "${3RDPARTY_RAPIDJSON_DIR}")
set (ENV{RapidJSON_DIR} ${CACHED_RAPIDJSON_DIR})
endif()
if (${RAPIDJSON_FOUND})
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "${RAPIDJSON_INCLUDE_DIR}" CACHE PATH "the path to RapidJSON header file" FORCE)
set (3RDPARTY_RAPIDJSON_DIR "${RAPIDJSON_ROOT_DIR}" CACHE PATH "The directory containing RapidJSON" FORCE)
endif()
endif()
endif()
if (3RDPARTY_RAPIDJSON_INCLUDE_DIR AND EXISTS "${3RDPARTY_RAPIDJSON_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_RAPIDJSON_INCLUDE_DIR}")
# Install header files
if (INSTALL_RAPIDJSON)
file(GLOB RAPIDJSON_SUBDIRS "${3RDPARTY_RAPIDJSON_INCLUDE_DIR}/*")
foreach(SUBDIR ${RAPIDJSON_SUBDIRS})
if(IS_DIRECTORY "${SUBDIR}")
install (DIRECTORY "${SUBDIR}" DESTINATION "${INSTALL_DIR_INCLUDE}")
else()
install (FILES "${SUBDIR}" DESTINATION "${INSTALL_DIR_INCLUDE}")
endif()
endforeach()
endif()
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_RAPIDJSON_INCLUDE_DIR)
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "" CACHE PATH "the path to RapidJSON header file" FORCE)
endif()
# unset all redundant variables
OCCT_CHECK_AND_UNSET(RapidJSON_DIR)

View File

@@ -94,6 +94,7 @@ INSTALL_MESSAGE (INSTALL_EGL "EGL binaries")
INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries")
INSTALL_MESSAGE (INSTALL_FREETYPE "FreeType binaries")
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
INSTALL_MESSAGE (INSTALL_RAPIDJSON "RapidJSON header files")
INSTALL_MESSAGE (INSTALL_TCL "TCL binaries")
INSTALL_MESSAGE (INSTALL_TK "TK binaries")
INSTALL_MESSAGE (INSTALL_VTK "VTK binaries ")
@@ -161,6 +162,10 @@ set (USE_FREEIMAGE_DESCR
"Indicates whether Freeimage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)")
set (USE_RAPIDJSON_DESCR
"Indicates whether RapidJSON product should be used in OCCT DataExchange
module for support of JSON-based formats like glTF")
set (USE_EGL_DESCR
"Indicates whether EGL should be used in OCCT visualization
module instead of conventional OpenGL context creation APIs")

View File

@@ -189,6 +189,9 @@ proc wokdep:gui:UpdateList {} {
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
}
if { "$::HAVE_RAPIDJSON" == "true" } {
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::CHECK_QT4" == "true" } {
wokdep:SearchQt4 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
@@ -456,6 +459,9 @@ ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib"
checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
checkbutton .myFrame.myChecks.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4"
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
@@ -564,8 +570,8 @@ if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myZLibCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myZLibLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 10 -sticky e
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 11 -sticky w
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
@@ -578,8 +584,8 @@ if { "$::tcl_platform(platform)" == "windows" } {
}
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 10 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 11 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
if { "$::tcl_platform(os)" == "Darwin" } {
@@ -588,6 +594,10 @@ if { "$::tcl_platform(os)" == "Darwin" } {
incr aCheckRowIter
}
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 7 -sticky w
incr aCheckRowIter
# Additional headers search paths
grid .myFrame.myIncLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter

View File

@@ -68,7 +68,7 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
}
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
foreach anEnvIter $THE_ENV_VARIABLES {
set ${anEnvIter} "false"
if { [info exists ::env(${anEnvIter})] } {
@@ -858,6 +858,25 @@ proc wokdep:SearchGLES {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin6
return "$isFound"
}
# Search RapidJSON headers
proc wokdep:SearchRapidJson {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
set isFound "true"
set aRJHPath [wokdep:SearchHeader "rapidjson/rapidjson.h"]
if { "$aRJHPath" == "" } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{rapidjson}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/rapidjson/rapidjson.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
} else {
lappend anErrInc "Error: 'rapidjson/rapidjson.h' not found (RapidJSON)"
set isFound "false"
}
}
return "$isFound"
}
# Auxiliary function, gets VTK version to set default search directory
proc wokdep:VtkVersion { thePath } {
set aResult "6.1"

View File

@@ -1393,6 +1393,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_TclTkLibs) ""
set aLibsMap(CSF_QT) "QtCore QtGui"
} else {
set aLibsMap(CSF_fontconfig) "fontconfig"
if { "$theOS" == "qnx" } {
# CSF_ThreadLibs - pthread API is part of libc on QNX
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"

View File

@@ -63,6 +63,7 @@ win32 {
CSF_TclTkLibs = -lX11 -ltk8.6
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_MotifLibs = -lX11
CSF_fontconfig = -lfontconfig
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
}

View File

@@ -24,6 +24,7 @@ set "HAVE_GLES2=false"
set "HAVE_D3D=false"
set "HAVE_ZLIB=false"
set "HAVE_LIBLZMA=false"
set "HAVE_RAPIDJSON=false"
set "CSF_OPT_INC="
set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
@@ -163,6 +164,7 @@ if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D" & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%"
rem Eliminate VS warning
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -878,7 +878,18 @@ The test grid name is constructed depending on the type of the tested chamfers.
| dist_angle_complex | | Distance from edge and given angle |
| dist_angle_sequence | | Distance from edge and given angle |
@subsubsection testmanual_5_1_7 demo
@subsubsection testmanual_5_1_7 de
This group tests reading and writing of CAD data files (iges, step) to and from OCCT.
Test cases check transfer status, shape and attributes against expected reference values.
| Grid | Commands | Functionality |
| :---- | :----- | :------- |
| iges_1, iges_2, iges_3 | igesbrep, brepiges, ReadIges, WriteIges | IGES tests |
| step_1, step_2, step_3, step_4, step_5 | stepread, stepwrite, ReadStep, WriteStep | STEP tests |
@subsubsection testmanual_5_1_8 demo
This group allows demonstrating how testing cases are created, and testing DRAW commands and the test system as a whole.
@@ -889,7 +900,7 @@ This group allows demonstrating how testing cases are created, and testing DRAW
| samples | | OCCT samples |
@subsubsection testmanual_5_1_8 draft
@subsubsection testmanual_5_1_9 draft
This group allows testing draft operations.
@@ -900,7 +911,7 @@ DRAW module: MODELING.
| Angle | depouille | Drafts with angle (inclined walls) |
@subsubsection testmanual_5_1_9 feat
@subsubsection testmanual_5_1_10 feat
This group allows testing creation of features on a shape.
@@ -914,7 +925,7 @@ DRAW module: MODELING (package *BRepTest*).
| featrevol | | |
| featrf | | |
@subsubsection testmanual_5_1_10 heal
@subsubsection testmanual_5_1_11 heal
This group allows testing the functionality provided by *ShapeHealing* toolkit.
@@ -943,7 +954,7 @@ DRAW module: XSDRAW
| surface_to_revolution_standard | DT_ShapeConvertRev | Convert elementary surfaces to revolutions, simple cases |
| update_tolerance_locked | updatetolerance | Update the tolerance of shape so that it satisfy the rule: toler(face)<=toler(edge)<=toler(vertex) |
@subsubsection testmanual_5_1_11 mesh
@subsubsection testmanual_5_1_12 mesh
This group allows testing shape tessellation (*BRepMesh*) and shading.
@@ -960,7 +971,7 @@ DRAW modules: MODELING (package *MeshTest*), VISUALIZATION (package *ViewerTest*
| advanced_incmesh_parallel | incmesh | Meshing of complex shapes, parallel mode |
| standard_incmesh_parallel | incmesh | Meshing of simple shapes, parallel mode |
@subsubsection testmanual_5_1_12 mkface
@subsubsection testmanual_5_1_13 mkface
This group allows testing creation of simple surfaces.
@@ -975,7 +986,7 @@ DRAW module: MODELING (package *BRepTest*)
| after_revsurf_and_offset | mkface | |
| mkplane | mkplane | |
@subsubsection testmanual_5_1_13 nproject
@subsubsection testmanual_5_1_14 nproject
This group allows testing normal projection of edges and wires onto a face.
@@ -985,7 +996,7 @@ DRAW module: MODELING (package *BRepTest*)
| :---- | :----- | :------- |
| Base | nproject | |
@subsubsection testmanual_5_1_14 offset
@subsubsection testmanual_5_1_15 offset
This group allows testing offset functionality for curves and surfaces.
@@ -1001,7 +1012,7 @@ DRAW module: MODELING (package *BRepTest*)
| shape | offsetshape | |
| wire_closed_outside_0_005, wire_closed_outside_0_025, wire_closed_outside_0_075, wire_closed_inside_0_005, wire_closed_inside_0_025, wire_closed_inside_0_075, wire_unclosed_outside_0_005, wire_unclosed_outside_0_025, wire_unclosed_outside_0_075 | mkoffset | 2d offset of closed and unclosed planar wires with different offset step and directions of offset ( inside / outside ) |
@subsubsection testmanual_5_1_15 pipe
@subsubsection testmanual_5_1_16 pipe
This group allows testing construction of pipes (sweeping of a contour along profile).
@@ -1011,7 +1022,7 @@ DRAW module: MODELING (package *BRepTest*)
| :---- | :----- | :------- |
| Standard | pipe | |
@subsubsection testmanual_5_1_16 prism
@subsubsection testmanual_5_1_17 prism
This group allows testing construction of prisms.
@@ -1021,7 +1032,7 @@ DRAW module: MODELING (package *BRepTest*)
| :---- | :----- | :------- |
| seminf | prism | |
@subsubsection testmanual_5_1_17 sewing
@subsubsection testmanual_5_1_18 sewing
This group allows testing sewing of faces by connecting edges.
@@ -1033,7 +1044,7 @@ DRAW module: MODELING (package *BRepTest*)
| tol_1 | sewing | Sewing faces with tolerance 1 |
| tol_100 | sewing | Sewing faces with tolerance 100 |
@subsubsection testmanual_5_1_18 thrusection
@subsubsection testmanual_5_1_19 thrusection
This group allows testing construction of shell or a solid passing through a set of sections in a given sequence (loft).
@@ -1042,7 +1053,7 @@ This group allows testing construction of shell or a solid passing through a set
| solids | thrusection | Lofting with resulting solid |
| not_solids | thrusection | Lofting with resulting shell or face |
@subsubsection testmanual_5_1_19 xcaf
@subsubsection testmanual_5_1_20 xcaf
This group allows testing extended data exchange packages.

View File

@@ -1716,6 +1716,41 @@ aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array
aGroup->AddPrimitiveArray (aLines);
~~~~
@subsection upgrade_740_text Changes in Graphic3d_Text and OpenGl_Text API
Parameters of *Text* in *Graphic3d_Group* are moved into a new *Graphic3d_Text* class. *AddText* of *Graphic3d_Group* should be used instead of the previous *Text*.
The previous code:
~~~~
Standard_Real x, y, z;
theAttachmentPoint.Coord(x,y,z);
theGroup->Text (theText,
Graphic3d_Vertex(x,y,z),
theAspect->Height(),
theAspect->Angle(),
theAspect->Orientation(),
theAspect->HorizontalJustification(),
theAspect->VerticalJustification());
~~~~
should be replaced by the new code:
~~~~
Handle(Graphic3d_Text) aText = new Graphic3d_Text (theAspect->Height());
aText->SetText (theText.ToExtString());
aText->SetPosition (theAttachmentPoint);
aText->SetHorizontalAlignment (theAspect->HorizontalJustification());
aText->SetVerticalAlignment (theAspect->VerticalJustification());
theGroup->AddText (aText);
~~~~
*OpenGl_Text* contains *Graphic3d_Text* field.
*OpenGl_TextParam* struct is removed. Constructor and *Init* of *OpenGl_Text* with *OpenGl_TextParam* are also removed.
Instead of using them, change *OpenGl_Text*.
Please, note, that after modifying *OpenGl_Text*, *Reset* of *OpenGl_Text* should be called.
*FormatParams* of *OpenGl_Text* is replaced by *Text*.
@subsection upgrade_740_prsupdate Presentation invalidation
Historically AIS_InteractiveObject provided two independent mechanisms invalidating presentation (asking presentation manager to recompute specific display mode or all modes):
@@ -1761,3 +1796,6 @@ The following API changes have been made:
* Methods BOPTools_BoxSelector::Reject and BOPTools_BoxSelector::Accept have been removed as unused.
* The RunParallel flag has been removed from the list of parameters of BOPAlgo_Tools::IntersectVertices method. Earlier, it performed selection from the UB tree in parallel mode. Now all interfering pairs are found in one pass, using pair traverse of the same BVH tree.
@subsection upgrade_740_stdnamespace Standard_Stream.hxx no more has "using std::" statements
*Standard_Stream.hxx* header, commonly included by other OCCT header files, does no more add entities from *std namespace* related to streams (like *std::cout*, *std::istream* and others) into global namespace.
The application code relying on this matter should be updated to either specify std namespace explicitly (like std::cout) or add "using std::" statements locally.

View File

@@ -222,6 +222,7 @@ for which OCCT is certified to work.
| Freetype (for text rendering) | FreeType 2.4.11-2.7.1 https://sourceforge.net/projects/freetype/files/ |
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.17.0+ https://sourceforge.net/projects/freeimage/files |
| FFmpeg (optional, for video recording) | FFmpeg 3.1+ https://www.ffmpeg.org/download.html |
| RapidJSON (optional, for reading glTF) | RapidJSON 1.1+ http://rapidjson.org/ |
| Intel TBB (optional, for multithreaded algorithms) | TBB 4.x or 5.x https://www.threadingbuildingblocks.org/ |
| VTK (for VTK Integration Services | VTK 6.1+ http://www.vtk.org/download/ |
| Doxygen (optional for building documentation) | Doxygen 1.8.5+ https://www.stack.nl/~dimitri/doxygen/download.html |

View File

@@ -5595,7 +5595,7 @@ Draw provides command to create curves and surfaces by approximation.
* **appro** fits a curve through 3d points;
* **surfapp** and **grilapp** fit a surface through 3d points by approximation;
* **surfint** fit a surface through 3d points by interpolation;
* **2dinterpolate** interpolates a curve.
* **2dinterpole** interpolates a curve.
@subsubsection occt_draw_6_8_1 appro, dapprox

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1341,7 +1341,26 @@ Further, let us consider the triangle \f$ T_{0}\left \langle p_{0}, p_{1}, p_{2}
<span>10.</span> Compute the center of OBB and its half dimensions.<br>
<span>11.</span> Create OBB using the center, axes and half dimensions.<br>
This algorithm is implemented in the *Bnd_OBB::ReBuild(...)* method.
@subsubsection occt_modat_6_1_1_opt Creation of Optimal OBB from set of points
For creation of the optimal OBB from set of points the same algorithm as described above is used but with some simplifications in logic and increased computation time.
For the optimal OBB it is necessary to check all possible axes which can be created by the extremal points. And since the extremal points are only valid for the initial axes it is necessary to project the whole set of points on each axis.
This approach usually provides much tighter OBB but the performance is lower. The complexity of the algorithm is still linear and with use of BVH for the set of points it is O(N + C*log(N)).
Here is the example of optimal and not optimal OBB for the model using the set of 125K nodes:
<table align="center">
<tr>
<td>@figure{/user_guides/modeling_data/images/modeling_data_obb_125K.png,"Not optimal OBB by DiTo-14",160}</td>
<td>@figure{/user_guides/modeling_data/images/modeling_data_opt_obb_125K.png,"Optimal OBB by DiTo-14",160}</td>
<td>@figure{/user_guides/modeling_data/images/modeling_data_pca_obb_125K.png,"Not optimal OBB by PCA",160}</td>
</tr>
</table>
Computation of the not optimal OBB in this case took 0.007 sec, optimal - 0.1 sec, which is about 14 times slower. Such performance is comparable to creation of the OBB for this shape by PCA approach (see below) which takes about 0.17 sec.
The computation of optimal OBB is controlled by the same *theIsOptimal* flag in the BRepBndLib::AddOBB method as for PCA algorithm.
These algorithms are implemented in the *Bnd_OBB::ReBuild(...)* method.
@subsubsection occt_modat_6_1_2 Creation of OBB based on Axes of inertia

View File

@@ -596,8 +596,8 @@ void GeomConstraints_Presentation::sample3()
aFileName += "\\points.dat";
// open file
ifstream aFile;
aFile.open(aFileName.ToCString(), ios::failbit);
std::ifstream aFile;
aFile.open(aFileName.ToCString(), std::ios::failbit);
if(!aFile)
{
aFileName += " was not found. The sample can not be shown.";

View File

@@ -80,7 +80,7 @@ void GeoAlgo_Sol::Build(const TColgp_SequenceOfXYZ& seqOfXYZ)
//Filling plate
Plate_Plate myPlate;
cout<<" * Nunber of points = "<< nbPnt << endl;
std::cout<<" * Nunber of points = "<< nbPnt << std::endl;
for (i=1; i<= nbPnt; i++) {
gp_Pnt ptProj(seqOfXYZ.Value(i).X(), seqOfXYZ.Value(i).Y(), 0. );
gp_Vec aVec( ptProj, seqOfXYZ.Value(i));
@@ -90,7 +90,7 @@ void GeoAlgo_Sol::Build(const TColgp_SequenceOfXYZ& seqOfXYZ)
}
myPlate.SolveTI(2, 1.);// resolution
if (!myPlate.IsDone()) {
cout<<" plate computation has failed"<< endl;
std::cout<<" plate computation has failed"<< std::endl;
myIsDone=Standard_False;
}
@@ -144,11 +144,11 @@ Handle(Geom_BSplineSurface) GeoAlgo_Sol::Read(const Standard_CString aGroundName
Standard_Integer nbPnt=0;
// Read points from the file
filebuf fic;
istream in(&fic);
std::filebuf fic;
std::istream in(&fic);
if (!fic.open(aGroundName,ios::in)){
cout << " impossible to open a file : "<<aGroundName<<endl;
if (!fic.open(aGroundName,std::ios::in)){
std::cout << " impossible to open a file : "<<aGroundName<<std::endl;
myIsDone = Standard_False;
return 0;
}

View File

@@ -1217,7 +1217,7 @@ Standard_Real ang = D1.Angle(D2); \n\
Handle(ISession_Direction) aDirection2 = new ISession_Direction(gp_Pnt(0,0,0),D2,3);
aDoc->GetAISContext()->Display(aDirection2, Standard_False);
cout<<" D1.Angle(D2) : "<<ang<<endl;
std::cout<<" D1.Angle(D2) : "<<ang<<std::endl;
TCollection_AsciiString Message2 (ang);
TCollection_AsciiString Message3 (ang/M_PI/180);

View File

@@ -1081,9 +1081,9 @@ void CGeometryDoc::OnCreateSol()
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
CString filename = dlg.GetPathName();
filebuf fic;
istream in(&fic);
if (!fic.open (filename, ios::in))
std::filebuf fic;
std::istream in(&fic);
if (!fic.open (filename, std::ios::in))
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Unable to open file", L"CasCade Error", MB_ICONERROR);
TColgp_SequenceOfXYZ seqOfXYZ;
@@ -1162,7 +1162,7 @@ void CGeometryDoc::OnSimplify()
std::filebuf aFileBuf;
std::istream aStream (&aFileBuf);
if (!aFileBuf.open (initfile, ios::in))
if (!aFileBuf.open (initfile, std::ios::in))
{
initfile += L" was not found. The sample can not be shown.";
myCResultDialog.SetText (initfile);

View File

@@ -4949,9 +4949,9 @@ void CModelingDoc::InputEvent(const Standard_Integer /*x*/,
((OCC_MainFrame*)AfxGetMainWnd())->SetStatusMessage("Building the tangent surface...");
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
CString filename = dlg.GetPathName();
filebuf fic;
istream in(&fic);
if (!fic.open(filename, ios::in))
std::filebuf fic;
std::istream in(&fic);
if (!fic.open(filename, std::ios::in))
MessageBoxW (AfxGetApp()->m_pMainWnd->m_hWnd, L"Error : Unable to open file", L"CasCade Error", MB_ICONERROR);
Standard_Real x,y,z;
BRep_Builder B;

View File

@@ -233,7 +233,7 @@ void CViewer2dDoc::OnBUTTONTestFace()
std::filebuf aFileBuf;
std::istream aStream (&aFileBuf);
if (!aFileBuf.open (dlg.GetPathName(), ios::in))
if (!aFileBuf.open (dlg.GetPathName(), std::ios::in))
{
AfxMessageBox (L"The shape must be not a null Face");
return;

View File

@@ -164,7 +164,7 @@ Standard_Boolean TexturesExt_Presentation::loadShape(TopoDS_Shape& aShape,
std::filebuf aFileBuf;
std::istream aStream (&aFileBuf);
if (!aFileBuf.open (initfile, ios::in))
if (!aFileBuf.open (initfile, std::ios::in))
{
initfile += L" was not found. The sample can not be shown.";
getDocument()->UpdateResultMessageDlg ("Textured Shape", initfile);

View File

@@ -936,7 +936,7 @@ void CViewer3dDoc::DoSample()
catch (Standard_Failure const& anException)
{
Standard_SStream aSStream;
aSStream << "An exception was caught: " << anException << ends;
aSStream << "An exception was caught: " << anException << std::ends;
CString aMsg = aSStream.str().c_str();
AfxMessageBox (aMsg);
}

View File

@@ -925,7 +925,7 @@ void COcafDoc::OnFileSaveAs()
CWaitCursor aWaitCursor;
CString CSPath = dlg.GetPathName();
cout << "Save As " << CSPath << endl;
std::cout << "Save As " << CSPath << std::endl;
PathName=CSPath;
const wchar_t* SPath = CSPath;
TCollection_ExtendedString TPath (SPath);

View File

@@ -76,7 +76,7 @@ Standard_Boolean TOcafFunction_CutDriver::MustExecute(const Handle(TFunction_Log
*/
TCollection_AsciiString aEntry;
TDF_Tool::Entry(Label(), aEntry);
cout << "Entry: "<<aEntry.ToCString()<<endl;
std::cout << "Entry: "<<aEntry.ToCString()<<std::endl;
Label().FindChild(1).FindAttribute(TDF_Reference::GetID(),OriginalRef);
if (log->IsModified(OriginalRef->Get())) return Standard_True; // Original shape.

View File

@@ -425,7 +425,7 @@ void Tesselate_Presentation::sample(const Standard_CString aFileName)
std::filebuf aFileBuf;
std::istream aStream (&aFileBuf);
if (!aFileBuf.open (initfile, ios::in))
if (!aFileBuf.open (initfile, std::ios::in))
{
initfile += L" was not found. The sample can not be shown.";
GetDocument()->PocessTextInDialog ("Compute the triangulation on a shape", initfile);

View File

@@ -349,7 +349,7 @@ void CTriangulationDoc::DoSample()
catch (Standard_Failure const& anException)
{
Standard_SStream aSStream;
aSStream << "An exception was caught: " << anException << ends;
aSStream << "An exception was caught: " << anException << std::ends;
CString aMsg = aSStream.str().c_str();
// aSStream.rdbuf()->freeze(0); // allow deletion of dynamic array
AfxMessageBox (aMsg);

View File

@@ -83,35 +83,35 @@ CAnimationDoc::CAnimationDoc()
std::filebuf aFileBuf;
std::istream aStream (&aFileBuf);
CString aPathCrankArm = aDataDirPath + "\\CrankArm.rle";
if (aFileBuf.open (aPathCrankArm, ios::in))
if (aFileBuf.open (aPathCrankArm, std::ios::in))
{
BRepTools::Read (CrankArm, aStream, B);
aFileBuf.close();
}
CString aPathCylinderHead = aDataDirPath + "\\CylinderHead.rle";
if (aFileBuf.open (aPathCylinderHead, ios::in))
if (aFileBuf.open (aPathCylinderHead, std::ios::in))
{
BRepTools::Read (CylinderHead, aStream, B);
aFileBuf.close();
}
CString aPathPropeller = aDataDirPath + "\\Propeller.rle";
if (aFileBuf.open (aPathPropeller, ios::in))
if (aFileBuf.open (aPathPropeller, std::ios::in))
{
BRepTools::Read (Propeller, aStream, B);
aFileBuf.close();
}
CString aPathPiston = aDataDirPath + "\\Piston.rle";
if (aFileBuf.open (aPathPiston, ios::in))
if (aFileBuf.open (aPathPiston, std::ios::in))
{
BRepTools::Read (Piston, aStream, B);
aFileBuf.close();
}
CString aPathEngineBlock = aDataDirPath + "\\EngineBlock.rle";
if (aFileBuf.open (aPathEngineBlock, ios::in))
if (aFileBuf.open (aPathEngineBlock, std::ios::in))
{
BRepTools::Read (EngineBlock, aStream, B);
aFileBuf.close();

View File

@@ -49,7 +49,7 @@ Handle(TColStd_HArray2OfReal) ReadRegularGrid(CString FileName,
if (fp)
{
fscanf_s(fp, "%d %d", &R2, &C2);
cout << "Reading Grid : ( " << R2 << " , " << C2 << " )." << endl;
std::cout << "Reading Grid : ( " << R2 << " , " << C2 << " )." << std::endl;
H = new TColStd_HArray2OfReal(C1, C2, R1, R2);
@@ -83,14 +83,14 @@ Handle(TColStd_HArray2OfReal) ReadRegularGrid(CString FileName,
}
}
cout << "Deltax = " << Deltax << endl;
cout << "Deltay = " << Deltay << endl;
std::cout << "Deltax = " << Deltax << std::endl;
std::cout << "Deltay = " << Deltay << std::endl;
fclose(fp);
}
else
{
cout << "cannot open file : " << FileName << endl;
std::cout << "cannot open file : " << FileName << std::endl;
}
return H;
}

View File

@@ -153,7 +153,7 @@ void COCCDemoDoc::DoSample()
catch (Standard_Failure const& anException)
{
Standard_SStream aSStream;
aSStream << "An exception was caught: " << anException << ends;
aSStream << "An exception was caught: " << anException << std::ends;
CString aMsg = aSStream.str().c_str();
AfxMessageBox (aMsg);
}

View File

@@ -156,7 +156,7 @@ Standard_Boolean CImportExport::ReadBREP(CString aFileName,
std::filebuf aFileBuf;
std::istream aStream (&aFileBuf);
if (!aFileBuf.open (aFileName, ios::in))
if (!aFileBuf.open (aFileName, std::ios::in))
{
return Standard_False;
}
@@ -230,7 +230,7 @@ Standard_Boolean CImportExport::SaveBREP (CString aFileName,
{
std::filebuf aFileBuf;
std::ostream aStream (&aFileBuf);
if (!aFileBuf.open (aFileName, ios::out))
if (!aFileBuf.open (aFileName, std::ios::out))
{
return Standard_False;
}
@@ -811,7 +811,7 @@ Standard_Boolean CImportExport::SaveVRML(const Standard_CString&
} // iterator of shapes
// Call VRML writer
ofstream writer(aFileName);
std::ofstream writer(aFileName);
writer<<scene;
writer.close();

View File

@@ -129,7 +129,7 @@ case 6: //color
// This triangulation is computed with the deflection myDeflection.
#ifdef DEBUG
cout <<"Deflection = " << myDeflection << "\n" << endl;
std::cout <<"Deflection = " << myDeflection << "\n" << std::endl;
#endif
Standard_Integer NumFace;
@@ -145,7 +145,7 @@ case 6: //color
TopLoc_Location myLocation = myFace.Location();
#ifdef DEBUG
cout << "J\'explore actuellement la face " << NumFace << "\n" << endl;
std::cout << "J\'explore actuellement la face " << NumFace << "\n" << std::endl;
#endif
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, myLocation);
// Returns the Triangulation of the face. It is a null handle if there is no triangulation.
@@ -153,7 +153,7 @@ case 6: //color
if (myT.IsNull())
{
#ifdef DEBUG
// cout << "Triangulation of the face "<< i <<" is null \n"<< endl;
// std::cout << "Triangulation of the face "<< i <<" is null \n"<< std::endl;
#endif
return;
}
@@ -200,7 +200,7 @@ case 6: //color
TopLoc_Location myLocation = myFace.Location();
#ifdef DEBUG
cout << "J\'explore actuellement la face " << NumFace << "\n" << endl;
std::cout << "J\'explore actuellement la face " << NumFace << "\n" << std::endl;
#endif
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, myLocation);
// Returns the Triangulation of the face. It is a null handle if there is no triangulation.
@@ -208,7 +208,7 @@ case 6: //color
if (myT.IsNull())
{
#ifdef DEBUG
//cout << "Triangulation of the face "<< i <<" is null \n"<< endl;
//std::cout << "Triangulation of the face "<< i <<" is null \n"<< std::endl;
#endif
return;
}
@@ -255,7 +255,7 @@ case 6: //color
for (nt = 1; nt <= nnn; nt++)
{
#ifdef DEBUG
cout << "On traite actuellement le triangle : "<< nt <<"\n";
std::cout << "On traite actuellement le triangle : "<< nt <<"\n";
#endif
if (myFace.Orientation() == TopAbs_REVERSED) // si la face est "reversed"
triangles(nt).Get(n1,n3,n2); // le triangle est n1,n3,n2

View File

@@ -50,7 +50,7 @@ int AFXAPI AfxWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
// int i = setvbuf( stdout, NULL, _IONBF, 0 );
// filebuf ff(hCrt);
// cout = &ff;
cout<<"This Debug Window is defined in WinMain.cpp and will disappear in release mode"<<endl;
std::cout<<"This Debug Window is defined in WinMain.cpp and will disappear in release mode"<<std::endl;
#endif // DISPLAYCONSOLE // By Matra

View File

@@ -354,7 +354,7 @@ static void Sample()
Standard_Boolean isverified = constraint->Verified();
if( !isverified ) {
cout << "Constraint is not valid" << endl;
std::cout << "Constraint is not valid" << std::endl;
}

View File

@@ -308,7 +308,7 @@ void Sample()
BRepAlgo_Cut mkCUT (OBJECT, TOOL);
if (!mkCUT.IsDone()) {
cout << "CUT: Algorithm failed" << endl;
std::cout << "CUT: Algorithm failed" << std::endl;
return;
} else
{
@@ -318,7 +318,7 @@ void Sample()
if (!BRepAlgo::IsValid(Larg, mkCUT.Shape(), Standard_True, Standard_False)) {
cout << "CUT: Result is not valid" << endl;
std::cout << "CUT: Result is not valid" << std::endl;
return;
} else
{

View File

@@ -101,9 +101,9 @@ static void Sample()
Handle(TPrsStd_NamedShapeDriver) driver;
if( table->FindDriver(driverguid, driver) )
cout << "Driver was found " << endl;
std::cout << "Driver was found " << std::endl;
else
cout << "Driver wasn't found" << endl;
std::cout << "Driver wasn't found" << std::endl;
// Driver can be used to build AIS_InteractiveObject for presenting the given label

View File

@@ -214,7 +214,7 @@ void MainWindow::compute()
}
aTimer.Show(seconds, minutes, hours, CPUTime);
cout << "Execution of "<<graph->getNbThreads()<< " threads took " << hours << " hours, " << minutes << " minutes, " << seconds << " seconds" << endl;
std::cout << "Execution of "<<graph->getNbThreads()<< " threads took " << hours << " hours, " << minutes << " minutes, " << seconds << " seconds" << std::endl;
// Redraw the nodes (change their colour).
redrawGraph();

View File

@@ -340,7 +340,7 @@ TranslateDlg* Translate::getDialog( const int format, const bool import )
filter.append( "\t" );
}
cout << filter.toLatin1().constData() << endl;
std::cout << filter.toLatin1().constData() << std::endl;
QStringList filters = filter.split( "\t" );
myDlg->setNameFilters ( filters );

90
samples/tcl/logo2019.tcl Normal file
View File

@@ -0,0 +1,90 @@
# The following example constructs a 3D object looking like new OCC logo on top view.
#
#Category: Modeling
#Title: OCC Logo 2019
pload MODELING VISUALIZATION XDE OCAF
# spheric body
psphere s 1
box b 0 0 -2 1.5 1.5 4
bcut sb s b
# toroidal handle
ptorus t 1 0.5
trotate t 0 0 0 0 0 1 -90
ttranslate t 1.5 1.5 0
bcut tb t b
pcylinder p1 0.5 0.5
trotate p1 0 0 0 0 0 1 180
trotate p1 0 0 0 1 0 0 90
ttranslate p1 0.5 1.5 0
pcylinder p2 0.5 0.5
trotate p2 0 0 0 0 0 1 180
trotate p2 0 0 0 1 0 0 90
trotate p2 0 0 0 0 0 1 90
ttranslate p2 1 0.5 0
bfuse tp tb p1
bfuse tp tp p2
# intermediate part
# - get surfaces and edges on half of spheric and toroidal parts for filling
box b -2 -2 -2 4 4 2
bcut sbh sb b
bcut tph tp b
unset b
explode sbh f
renamevar sbh_1 sbf
explode sbf e
explode tph f
renamevar tph_2 tpf1
renamevar tph_13 tpf2
explode tpf1 e
explode tpf2 e
# - make curved surface by plate
#plate r 0 4 tpf1_1 tpf1 1 tpf2_3 tpf2 1 sbf_2 sbf 1 sbf_4 sbf 1
approxplate r1 0 4 tpf1_1 tpf1 0 tpf2_1 tpf2 0 sbf_2 sbf 0 sbf_4 sbf 0 0.00001 100 3 0
# - make solid
tcopy r1 r2
tmirror r2 0 0 0 0 0 1
explode sb f
explode tp f
sewing rr 0.001 r1 r2 sb_2 sb_3 tp_2 tp_5
ssolid rr rs
# rotate all solids by 45 deg to have standard orientation of the logo on top view
trotate sb 0 0 0 0 0 1 -45
trotate tp 0 0 0 0 0 1 -45
trotate rs 0 0 0 0 0 1 -45
# create XDE document
catch {Close D}
XNewDoc D
set main [XNewShape D]
XAddComponent D $main sb
XAddComponent D $main tp
XAddComponent D $main rs
XUpdateAssemblies D
SetName D $main "OCC Logo 2019"
SetName D [XFindShape D sb] "Core"
SetName D [XFindShape D tp] "Loop"
SetName D [XFindShape D rs] "Connector"
XSetColor D sb 1 0.21 0.32
XSetColor D tp 0 0.667 0.855
XSetColor D rs 0 0.45 0.69
# display
vinit
vsetcolorbg 1 1 1
vsetdispmode 1
XDisplay D
vtop
vfit

View File

@@ -273,7 +273,7 @@ Standard_Boolean MainPage::SaveBREP(const wchar_t* theFilePath, const TopoDS_Sha
std::filebuf aFileBuf;
std::ostream aStream(&aFileBuf);
if (!aFileBuf.open(theFilePath, ios::out)) {
if (!aFileBuf.open(theFilePath, std::ios::out)) {
Output_TextBlock->Text += L"Error: cannot open file for export (brep)\n";
return Standard_False;
}
@@ -291,7 +291,7 @@ Standard_Boolean MainPage::SaveIGES(const wchar_t* theFilePath, const TopoDS_Sha
std::filebuf aFileBuf;
std::ostream aStream(&aFileBuf);
if (!aFileBuf.open(theFilePath, ios::out)) {
if (!aFileBuf.open(theFilePath, std::ios::out)) {
Output_TextBlock->Text += L"Error: cannot open file for export (iges)\n";
return Standard_False;
}
@@ -319,7 +319,7 @@ Standard_Boolean MainPage::SaveSTEP(const wchar_t* theFilePath, const TopoDS_Sha
std::filebuf aFileBuf;
std::ostream aStream(&aFileBuf);
if (!aFileBuf.open(theFilePath, ios::out)) {
if (!aFileBuf.open(theFilePath, std::ios::out)) {
Output_TextBlock->Text += L"Error: cannot open file for export (step)\n";
return Standard_False;
}

View File

@@ -82,19 +82,6 @@
const Standard_Real SquareTolerance = Precision::SquareConfusion();
namespace
{
static Standard_CString AIS_Table_PrintDisplayStatus[3] =
{
"DISPLAYED", "ERASED", "NONE"
};
static Standard_CString AIS_Table_PrintKindOfInteractive[6] =
{
"NONE", "DATUM", "SHAPE", "OBJECT", "RELATION", "DIMENSION"
};
}
//=======================================================================
//function : Nearest
//purpose :
@@ -796,6 +783,7 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
BRepAdaptor_Surface surf1( aFace );
Handle( Adaptor3d_HSurface ) surf2;
Standard_Boolean isOffset = Standard_False;
Offset = 0.0;
if (surf1.GetType() == GeomAbs_OffsetSurface)
{
@@ -814,7 +802,6 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
{
aPlane = surf2->Plane();
aSurfType = AIS_KOS_Plane;
Offset = 0.;
Result = Standard_True;
}
@@ -830,7 +817,6 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
gp_Pln thePlane( LinePos, LineDir ^ ExtrusionDir);
aPlane = thePlane;
aSurfType = AIS_KOS_Plane;
Offset = 0.;
Result = Standard_True;
}
}
@@ -839,7 +825,6 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
{
aSurf = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->Surface();
aPlane = (Handle( Geom_Plane )::DownCast( aSurf ))->Pln();
Offset = 0.0e0;
}
if (Result == Standard_False)
{
@@ -852,7 +837,6 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
TheType == STANDARD_TYPE(Geom_ToroidalSurface))
{
aSurf = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->Surface();
Offset = 0.0e0;
}
else
{
@@ -912,20 +896,18 @@ gp_Pnt AIS::ProjectPointOnLine( const gp_Pnt & aPoint, const gp_Lin & aLine )
//function : InitFaceLength
//purpose :
//=======================================================================
void AIS::InitFaceLength (const TopoDS_Face& aFace,
gp_Pln & aPlane,
Handle(Geom_Surface) & aSurface,
AIS_KindOfSurface & aSurfaceType,
Standard_Real & anOffset)
void AIS::InitFaceLength (const TopoDS_Face& theFace,
gp_Pln& thePlane,
Handle(Geom_Surface)& theSurface,
AIS_KindOfSurface& theSurfaceType,
Standard_Real& theOffset)
{
AIS::GetPlaneFromFace( aFace, aPlane, aSurface, aSurfaceType, anOffset );
if (Abs( anOffset ) > Precision::Confusion())
{
aSurface = new Geom_OffsetSurface( aSurface, anOffset );
anOffset = 0.0e0;
}
if (AIS::GetPlaneFromFace (theFace, thePlane, theSurface, theSurfaceType, theOffset)
&& Abs (theOffset) > Precision::Confusion())
{
theSurface = new Geom_OffsetSurface (theSurface, theOffset);
theOffset = 0.0e0;
}
}
//=======================================================================
@@ -1551,63 +1533,3 @@ void AIS::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPr
StdPrs_WFShape::Add (aPresentation, MakEd.Edge(), aDrawer);
}
}
//=======================================================================
//function : DisplayStatusToString
//purpose :
//=======================================================================
Standard_CString AIS::DisplayStatusToString (AIS_DisplayStatus theType)
{
return AIS_Table_PrintDisplayStatus[theType];
}
//=======================================================================
//function : DisplayStatusFromString
//purpose :
//=======================================================================
Standard_Boolean AIS::DisplayStatusFromString (Standard_CString theTypeString,
AIS_DisplayStatus& theType)
{
TCollection_AsciiString aName (theTypeString);
aName.UpperCase();
for (Standard_Integer aTypeIter = 0; aTypeIter <= AIS_DS_None; ++aTypeIter)
{
Standard_CString aTypeName = AIS_Table_PrintDisplayStatus[aTypeIter];
if (aName == aTypeName)
{
theType = AIS_DisplayStatus (aTypeIter);
return Standard_True;
}
}
return Standard_False;
}
//=======================================================================
//function : KindOfInteractiveToString
//purpose :
//=======================================================================
Standard_CString AIS::KindOfInteractiveToString (AIS_KindOfInteractive theType)
{
return AIS_Table_PrintKindOfInteractive[theType];
}
//=======================================================================
//function : KindOfInteractiveFromString
//purpose :
//=======================================================================
Standard_Boolean AIS::KindOfInteractiveFromString (Standard_CString theTypeString,
AIS_KindOfInteractive& theType)
{
TCollection_AsciiString aName (theTypeString);
aName.UpperCase();
for (Standard_Integer aTypeIter = 0; aTypeIter <= AIS_KOI_Dimension; ++aTypeIter)
{
Standard_CString aTypeName = AIS_Table_PrintKindOfInteractive[aTypeIter];
if (aName == aTypeName)
{
theType = AIS_KindOfInteractive (aTypeIter);
return Standard_True;
}
}
return Standard_False;
}

View File

@@ -17,8 +17,6 @@
#ifndef _AIS_HeaderFile
#define _AIS_HeaderFile
#include <AIS_DisplayStatus.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <AIS_KindOfSurface.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
@@ -205,50 +203,6 @@ public:
Standard_EXPORT static void ComputeProjVertexPresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Vertex& aVertex, const gp_Pnt& ProjPoint, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
//! Returns the string name for a given enum type.
//! @param theType display status
//! @return string identifier
Standard_EXPORT static Standard_CString DisplayStatusToString (AIS_DisplayStatus theType);
//! Returns the display status from the given string identifier (using case-insensitive comparison).
//! @param theTypeString string identifier
//! @return status type or AIS_DS_None if string identifier is invalid
static AIS_DisplayStatus DisplayStatusFromString (Standard_CString theTypeString)
{
AIS_DisplayStatus aType = AIS_DS_None;
DisplayStatusFromString (theTypeString, aType);
return aType;
}
//! Determines the shape type from the given string identifier (using case-insensitive comparison).
//! @param theTypeString string identifier
//! @param theType detected display status
//! @return TRUE if string identifier is known
Standard_EXPORT static Standard_Boolean DisplayStatusFromString (const Standard_CString theTypeString,
AIS_DisplayStatus& theType);
//! Returns the string name for a given enum type.
//! @param theType display status
//! @return string identifier
Standard_EXPORT static Standard_CString KindOfInteractiveToString (AIS_KindOfInteractive theType);
//! Returns the display status from the given string identifier (using case-insensitive comparison).
//! @param theTypeString string identifier
//! @return status type or AIS_KOI_None if string identifier is invalid
static AIS_KindOfInteractive KindOfInteractiveFromString (Standard_CString theTypeString)
{
AIS_KindOfInteractive aType = AIS_KOI_None;
KindOfInteractiveFromString (theTypeString, aType);
return aType;
}
//! Determines the shape type from the given string identifier (using case-insensitive comparison).
//! @param theTypeString string identifier
//! @param theType detected display status
//! @return TRUE if string identifier is known
Standard_EXPORT static Standard_Boolean KindOfInteractiveFromString (const Standard_CString theTypeString,
AIS_KindOfInteractive& theType);
};
#endif // _AIS_HeaderFile

View File

@@ -48,7 +48,7 @@ void AIS_AnimationCamera::update (const AIS_AnimationProgress& theProgress)
Handle(Graphic3d_Camera) aCamera = myView->Camera();
Graphic3d_CameraLerp aCamLerp (myCamStart, myCamEnd);
aCamLerp.Interpolate (theProgress.LocalNormalized, aCamera);
aCamLerp.Interpolate (HasOwnDuration() ? theProgress.LocalNormalized : 1.0, aCamera);
const Standard_Boolean aPrevImmUpdate = myView->SetImmediateUpdate (Standard_False);
myView->SetCamera (aCamera);

View File

@@ -33,6 +33,9 @@ public:
//! Return the target view.
const Handle(V3d_View)& View() const { return myView; }
//! Set target view.
void SetView (const Handle(V3d_View)& theView) { myView = theView; }
//! Return camera start position.
const Handle(Graphic3d_Camera)& CameraStart() const { return myCamStart; }

View File

@@ -79,6 +79,31 @@ namespace
Standard_Real aSaturation = NCollection_Lerp<Standard_Real>::Interpolate (theHlsMin[2], theHlsMax[2], aValue);
return Quantity_Color (AIS_ColorScale::hueToValidRange (aHue), aLightness, aSaturation, Quantity_TOC_HLS);
}
//! Return the index of discrete interval for specified value.
//! Note that when value lies exactly on the border between two intervals,
//! determining which interval to return is undefined operation;
//! Current implementation returns the following interval in this case.
//! @param theValue [in] value to map
//! @param theMin [in] values range, lower value
//! @param theMax [in] values range, upper value
//! @param theNbIntervals [in] number of discrete intervals
//! @return index of interval within [1, theNbIntervals] range
static Standard_Integer colorDiscreteInterval (Standard_Real theValue,
Standard_Real theMin,
Standard_Real theMax,
Standard_Integer theNbIntervals)
{
if (Abs (theMax - theMin) <= Precision::Approximation())
{
return 1;
}
Standard_Integer anInterval = 1 + (Standard_Integer )Floor (Standard_Real (theNbIntervals) * (theValue - theMin) / (theMax - theMin));
// map the very upper value (theValue==theMax) to the largest color interval
anInterval = Min (anInterval, theNbIntervals);
return anInterval;
}
}
//=======================================================================
@@ -348,21 +373,14 @@ Standard_Boolean AIS_ColorScale::FindColor (const Standard_Real theValue,
if (myColorType == Aspect_TOCSD_USER)
{
Standard_Integer anIndex = 0;
if (Abs (myMax - myMin) > Precision::Approximation())
{
anIndex = (theValue - myMin < Precision::Confusion())
? 1
: Standard_Integer (Ceiling (( theValue - myMin ) / ( (myMax - myMin) / myNbIntervals)));
}
if (anIndex <= 0 || anIndex > myColors.Length())
const Standard_Integer anInterval = colorDiscreteInterval (theValue, myMin, myMax, myNbIntervals);
if (anInterval < myColors.Lower() || anInterval > myColors.Upper())
{
theColor = Quantity_Color();
return Standard_False;
}
theColor = myColors.Value (anIndex);
theColor = myColors.Value (anInterval);
return Standard_True;
}
@@ -386,13 +404,8 @@ Standard_Boolean AIS_ColorScale::FindColor (const Standard_Real theValue,
return Standard_False;
}
Standard_Real anInterval = 0.0;
if (Abs (theMax - theMin) > Precision::Approximation())
{
anInterval = Floor (Standard_Real (theColorsCount) * (theValue - theMin) / (theMax - theMin));
}
theColor = colorFromValueEx (anInterval, 0, theColorsCount - 1, theColorHlsMin, theColorHlsMax);
const Standard_Integer anInterval = colorDiscreteInterval (theValue, theMin, theMax, theColorsCount);
theColor = colorFromValueEx (anInterval - 1, 0, theColorsCount - 1, theColorHlsMin, theColorHlsMax);
return Standard_True;
}
@@ -798,13 +811,13 @@ void AIS_ColorScale::drawText (const Handle(Graphic3d_Group)& theGroup,
{
const Handle(Prs3d_TextAspect)& anAspect = myDrawer->TextAspect();
Handle(Graphic3d_Text) aTextParams = new Graphic3d_Text (anAspect->Height());
aTextParams->SetText (theText.ToExtString());
aTextParams->SetOrientation (gp_Ax2 (gp_Pnt (theX, theY, 0.0), gp::DZ()));
aTextParams->SetOwnAnchorPoint (Standard_False);
aTextParams->SetVAlignment (theVertAlignment);
Handle(Graphic3d_Text) aText = new Graphic3d_Text ((Standard_ShortReal)anAspect->Height());
aText->SetText (theText.ToExtString());
aText->SetOrientation (gp_Ax2 (gp_Pnt (theX, theY, 0.0), gp::DZ()));
aText->SetOwnAnchorPoint (Standard_False);
aText->SetVerticalAlignment (theVertAlignment);
theGroup->AddText (aTextParams);
theGroup->AddText (aText);
}
//=======================================================================

View File

@@ -633,11 +633,6 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
{
aShadedGroup = thePrs->NewGroup();
aShadedGroup->SetClosed (isClosed);
if (isClosed)
{
if (aDrawer->HasOwnFillCappingAspect())
aShadedGroup->SetGroupPrimitivesAspect (aDrawer->FillCappingAspect());
}
}
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
aShadedGroup->AddPrimitiveArray (aTriangles);

View File

@@ -1,6 +1,4 @@
// Created on: 2011-09-20
// Created by: Sergey ZERCHANINOV
// Copyright (c) 2011-2014 OPEN CASCADE SAS
// Copyright (c) 2018-2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -13,12 +11,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _OpenGl_TextParam_Header
#define _OpenGl_TextParam_Header
#ifndef _AIS_DragAction_HeaderFile
#define _AIS_DragAction_HeaderFile
#include <Graphic3d_Text.hxx>
//! Dragging action.
enum AIS_DragAction
{
AIS_DragAction_Start, //!< (try) start dragging object
AIS_DragAction_Update, //!< perform dragging (update position)
AIS_DragAction_Stop, //!< stop dragging (save position)
AIS_DragAction_Abort, //!< abort dragging (restore initial position)
};
Standard_DEPRECATED("This type name is deprecated - Graphic3d_Text should be used instead")
typedef Graphic3d_Text OpenGl_TextParam;
#endif //_OpenGl_TextParam_Header
#endif // _AIS_DragAction_HeaderFile

View File

@@ -161,6 +161,7 @@ myIsAutoActivateSelMode(Standard_True)
aStyle->SetMethod(Aspect_TOHM_COLOR);
aStyle->SetColor (Quantity_NOC_GRAY40);
}
InitAttributes();
}
@@ -186,6 +187,29 @@ AIS_InteractiveContext::~AIS_InteractiveContext()
}
}
//=======================================================================
//function : LastActiveView
//purpose :
//=======================================================================
Handle(V3d_View) AIS_InteractiveContext::LastActiveView() const
{
if (myLastActiveView == NULL
|| myMainVwr.IsNull())
{
return Handle(V3d_View)();
}
// as a precaution - check that myLastActiveView pointer is a valid active View
for (V3d_ListOfViewIterator aViewIter = myMainVwr->ActiveViewIterator(); aViewIter.More(); aViewIter.Next())
{
if (aViewIter.Value() == myLastActiveView)
{
return aViewIter.Value();
}
}
return Handle(V3d_View)();
}
//=======================================================================
//function : UpdateCurrentViewer
//purpose :
@@ -1944,11 +1968,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
}
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
AIS_NListOfEntityOwner anOwners;
const Handle(SelectMgr_EntityOwner)& aGlobOwner = theIObj->GlobalSelOwner();
if (!aGlobOwner.IsNull())
anOwners.Append(aGlobOwner);
unhighlightOwners (anOwners);
unhighlightOwners (theIObj);
myMainPM->SetVisibility (theIObj, aStatus->DisplayMode(), Standard_False);
if (!myLastPicked.IsNull()
@@ -1980,10 +2000,10 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
}
//=======================================================================
//function : unselectOwners
//function : unhighlightOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::unselectOwners (const Handle(AIS_InteractiveObject)& theObject)
void AIS_InteractiveContext::unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject)
{
SelectMgr_SequenceOfOwner aSeq;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
@@ -2017,7 +2037,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
return;
}
unselectOwners (theIObj);
unhighlightOwners (theIObj);
myMainPM->Erase (theIObj, -1);
theIObj->ErasePresentations (true); // make sure highlighting presentations are properly erased
@@ -2450,12 +2470,10 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView)
}
//=======================================================================
//function : FitSelected
//purpose : Fits the view corresponding to the bounds of selected objects
//function : BoundingBoxOfSelection
//purpose :
//=======================================================================
void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
const Standard_Real theMargin,
const Standard_Boolean theToUpdate)
Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection() const
{
Bnd_Box aBndSelected;
AIS_MapOfObjectOwners anObjectOwnerMap;
@@ -2494,12 +2512,22 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
aBndSelected.Add (aTmpBox);
}
anObjectOwnerMap.Clear();
return aBndSelected;
}
if (aBndSelected.IsVoid())
return;
theView->FitAll (aBndSelected, theMargin, theToUpdate);
//=======================================================================
//function : FitSelected
//purpose : Fits the view corresponding to the bounds of selected objects
//=======================================================================
void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
const Standard_Real theMargin,
const Standard_Boolean theToUpdate)
{
Bnd_Box aBndSelected = BoundingBoxOfSelection();
if (!aBndSelected.IsVoid())
{
theView->FitAll (aBndSelected, theMargin, theToUpdate);
}
}
//=======================================================================
@@ -2525,6 +2553,15 @@ void AIS_InteractiveContext::SetTransformPersistence (const Handle(AIS_Interacti
anActiveViewIter.Value()->View()->InvalidateZLayerBoundingBox (aLayerId);
}
}
//=======================================================================
//function : GravityPoint
//purpose :
//=======================================================================
gp_Pnt AIS_InteractiveContext::GravityPoint (const Handle(V3d_View)& theView) const
{
return theView->GravityPoint();
}
//=======================================================================
//function : setObjectStatus
//purpose :

View File

@@ -25,8 +25,6 @@
#include <AIS_ListOfInteractive.hxx>
#include <AIS_Selection.hxx>
#include <AIS_SelectionModesConcurrency.hxx>
#include <AIS_SelectionScheme.hxx>
#include <AIS_SelectionType.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <AIS_StatusOfPick.hxx>
#include <AIS_TypeOfIso.hxx>
@@ -372,6 +370,9 @@ public: //! @name mouse picking logic (detection and dynamic highlighting of ent
const Standard_Integer theMode,
const Standard_Integer theNewSensitivity);
//! Returns last active View (argument of MoveTo()/Select() methods).
Standard_EXPORT Handle(V3d_View) LastActiveView() const;
//! Relays mouse position in pixels theXPix and theYPix to the interactive context selectors.
//! This is done by the view theView passing this position to the main viewer and updating it.
//! If theToRedrawOnUpdate is set to false, callee should call RedrawImmediate() to highlight detected object.
@@ -469,24 +470,6 @@ public: //! @name Selection management
return AddSelect (theObject->GlobalSelOwner());
}
//! Selects everything found in the bounding rectangle defined by the pixel minima and maxima, XPMin, YPMin, XPMax, and YPMax in the view.
//! The objects detected are passed to the main viewer, which is then updated.
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme);
//! polyline selection; clears the previous picked list
Standard_EXPORT AIS_StatusOfPick Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme);
//! Stores and hilights the previous detected; Unhilights the previous picked.
//! @sa MoveTo().
Standard_EXPORT AIS_StatusOfPick Select (const AIS_SelectionScheme theSelScheme);
//! Selects everything found in the bounding rectangle defined by the pixel minima and maxima, XPMin, YPMin, XPMax, and YPMax in the view.
//! The objects detected are passed to the main viewer, which is then updated.
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer theXPMin,
@@ -525,12 +508,8 @@ public: //! @name Selection management
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer);
//! Sets list of owner selected/deselected using selection scheme
//! It is possible that selection of other objects is changed relatively selection scheme .
//! \param theOwner owners to change selection state
//! \param theSelScheme selection scheme
Standard_EXPORT AIS_StatusOfPick Select (const AIS_NListOfEntityOwner& theOwners,
const AIS_SelectionScheme theSelScheme);
//! Returns bounding box of selected objects.
Standard_EXPORT Bnd_Box BoundingBoxOfSelection() const;
//! Fits the view correspondingly to the bounds of selected objects.
//! Infinite objects are ignored if infinite state of AIS_InteractiveObject is set to true.
@@ -584,6 +563,14 @@ public: //! @name Selection management
Standard_EXPORT void AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& theObject,
const Standard_Boolean theToUpdateViewer);
//! Updates Selected state of specified owner without calling HilightSelected().
//! Has no effect if Selected state is not changed, and redirects to AddOrRemoveSelected() otherwise.
//! @param theOwner owner object to set selected state
//! @param theIsSelected new selected state
//! @return TRUE if Selected state has been changed
Standard_EXPORT Standard_Boolean SetSelectedState (const Handle(SelectMgr_EntityOwner)& theOwner,
const Standard_Boolean theIsSelected);
//! Highlights selected objects.
Standard_EXPORT void HilightSelected (const Standard_Boolean theToUpdateViewer);
@@ -843,6 +830,9 @@ public: //! @name common properties
//! returns the number of removed structures from the viewers.
Standard_EXPORT Standard_Integer PurgeDisplay();
//! Return rotation gravity point.
Standard_EXPORT virtual gp_Pnt GravityPoint (const Handle(V3d_View)& theView) const;
public: //! @name debug visualization
//! Visualization of sensitives - for debugging purposes!
@@ -1219,13 +1209,13 @@ public: //! @name sub-intensity management (deprecated)
Standard_EXPORT void SubIntensityOff (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer);
//! Sets selection instance to manipulate a container of selected owners
//! \param theSelection an instance of the selection
void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
//! Returns selection instance
const Handle(AIS_Selection)& Selection() const { return mySelection; }
//! Sets selection instance to manipulate a container of selected owners
//! @param theSelection an instance of the selection
void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
protected: //! @name internal methods
Standard_EXPORT void GetDefModes (const Handle(AIS_InteractiveObject)& anIobj, Standard_Integer& Dmode, Standard_Integer& HiMod, Standard_Integer& SelMode) const;
@@ -1245,7 +1235,7 @@ protected: //! @name internal methods
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
//! Helper function that highlights the owner given with <theStyle> without
//! performing AutoHighlight checks, e.g. is used for dynamic highlight.
@@ -1256,17 +1246,12 @@ protected: //! @name internal methods
//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
//! Helper function that highlights the owners given with <theStyle> with check
//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners,
const Standard_Boolean& theToUseObjectDisplayMode);
//! Helper function that highlights global owner of the object given with <theStyle> with check
//! for AutoHighlight, e.g. is used for selection.
//! If global owner is null, it simply highlights the whole object
Standard_EXPORT void highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theDispMode);
const Standard_Integer theDispMode) const;
//! Helper function that unhighlights all owners that are stored in current AIS_Selection.
//! The function updates global status and selection state of owner and interactive object.
@@ -1274,14 +1259,9 @@ protected: //! @name internal methods
//! switched on in AIS_GlobalStatus will be highlighted with context's sub-intensity color.
Standard_EXPORT void unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
//! Helper function that highlights the owners given with <theStyle> with check
//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
//! Helper function that unhighlights global selection owner of given interactive.
//! The function does not perform any updates of global or owner status
Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj);
Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj) const;
//! Helper function that turns on sub-intensity in global status and highlights
//! given objects with sub-intensity color
@@ -1412,6 +1392,7 @@ protected: //! @name internal fields
Handle(PrsMgr_PresentationManager3d) myMainPM;
Handle(V3d_Viewer) myMainVwr;
Handle(StdSelect_ViewerSelector3d) myMainSel;
V3d_View* myLastActiveView;
Handle(SelectMgr_EntityOwner) myLastPicked;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;
@@ -1424,6 +1405,7 @@ protected: //! @name internal fields
SelectMgr_PickingStrategy myPickingStrategy; //!< picking strategy to be applied within MoveTo()
Standard_Boolean myAutoHilight;
Standard_Boolean myIsAutoActivateSelMode;
};
DEFINE_STANDARD_HANDLE(AIS_InteractiveContext, Standard_Transient)

View File

@@ -85,9 +85,30 @@ void AIS_InteractiveContext::highlightWithColor (const Handle(SelectMgr_EntityOw
//=======================================================================
void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner)
{
AIS_NListOfEntityOwner anOwners;
anOwners.Append (theOwner);
highlightOwners (anOwners, Standard_False/*check if it is really important*/);
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
if (anObj.IsNull())
{
return;
}
if (!theOwner->IsAutoHilight())
{
SelectMgr_SequenceOfOwner aSeq;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
if (aSelIter.Value()->IsSameSelectable (anObj))
{
aSeq.Append (aSelIter.Value());
}
}
anObj->HilightSelected (myMainPM, aSeq);
}
else
{
const Handle(Prs3d_Drawer)& aStyle = getSelStyle (anObj, theOwner);
const Standard_Integer aHiMode = getHilightMode (anObj, aStyle, -1);
theOwner->HilightWithColor (myMainPM, aStyle, aHiMode);
}
}
//=======================================================================
@@ -96,15 +117,14 @@ void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwn
//=======================================================================
void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer /*theDispMode*/)
const Standard_Integer theDispMode) const
{
if (theObj.IsNull())
{
return;
}
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, aStatus->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, theDispMode);
const Handle(SelectMgr_EntityOwner)& aGlobOwner = theObj->GlobalSelOwner();
if (aGlobOwner.IsNull())
@@ -113,9 +133,22 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
return;
}
AIS_NListOfEntityOwner anOwners;
anOwners.Append (aGlobOwner);
highlightOwners (anOwners, Standard_True);
if (!aGlobOwner->IsAutoHilight())
{
SelectMgr_SequenceOfOwner aSeq;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
if (aSelIter.Value()->IsSameSelectable (theObj))
{
aSeq.Append (aSelIter.Value());
}
}
theObj->HilightSelected (myMainPM, aSeq);
}
else
{
aGlobOwner->HilightWithColor (myMainPM, theStyle, aHiMode);
}
}
//=======================================================================
@@ -123,30 +156,24 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity)
{
unhighlightOwners (mySelection->Objects(), theIsToHilightSubIntensity);
}
//=======================================================================
//function : unhighlightOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
const Standard_Boolean theIsToHilightSubIntensity)
{
NCollection_IndexedMap<Handle(AIS_InteractiveObject)> anObjToClear;
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anInteractive);
Handle(AIS_GlobalStatus) aStatus;
if (!myObjects.Find (anInteractive, aStatus))
{
continue;
}
if (anOwner->IsAutoHilight())
{
anOwner->Unhilight (myMainPM);
if (theIsToHilightSubIntensity)
{
if (!aStatus.IsNull() && aStatus->IsSubIntensityOn())
if (aStatus->IsSubIntensityOn())
{
const Standard_Integer aHiMode = getHilightMode (anInteractive, aStatus->HilightStyle(), aStatus->DisplayMode());
highlightWithSubintensity (anOwner, aHiMode);
@@ -157,9 +184,9 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
{
anObjToClear.Add (anInteractive);
}
if (!aStatus.IsNull() && anOwner == anInteractive->GlobalSelOwner())
if (anOwner == anInteractive->GlobalSelOwner())
{
aStatus->SetHilightStatus (Standard_False);
myObjects.ChangeFind (anInteractive)->SetHilightStatus (Standard_False);
}
}
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
@@ -174,7 +201,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
//function : unhighlightGlobal
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj)
void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj) const
{
if (theObj.IsNull())
{
@@ -188,9 +215,15 @@ void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObje
return;
}
AIS_NListOfEntityOwner anOwners;
anOwners.Append (aGlobOwner);
unhighlightOwners (anOwners);
if (aGlobOwner->IsAutoHilight())
{
aGlobOwner->Unhilight (myMainPM);
}
else
{
myMainPM->Unhighlight (theObj);
theObj->ClearSelected();
}
}
//=======================================================================
@@ -292,6 +325,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
myCurDetected = 0;
myCurHighlighted = 0;
myDetectedSeq.Clear();
myLastActiveView = theView.get();
// preliminaires
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
@@ -452,22 +486,38 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMi
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
const Standard_Boolean toUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
AIS_NListOfEntityOwner aPickedOwners;
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.Append (myMainSel->Picked (aPickIter));
const Handle(SelectMgr_EntityOwner)& aCurOwner = myMainSel->Picked (aPickIter);
if (aCurOwner.IsNull() || !aCurOwner->HasSelectable() || !myFilters->IsOk (aCurOwner))
continue;
mySelection->Select (aCurOwner);
}
return Select (aPickedOwners, theSelScheme);
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
@@ -476,87 +526,106 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMi
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const AIS_SelectionScheme theSelScheme)
const Standard_Boolean toUpdateViewer)
{
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::Select() - invalid argument");
}
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (thePolyline, theView);
AIS_NListOfEntityOwner aPickedOwners;
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
aPickedOwners.Append (myMainSel->Picked (aPickIter));
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
}
return Select (aPickedOwners, theSelScheme);
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_SelectionScheme theSelScheme)
{
// special case: single selection of detected owner - is it necessary ?
/*if (myWasLastMain && !myLastPicked.IsNull() && !myAutoHilight &&
(myLastPicked->IsSelected()
&& !myLastPicked->IsForcedHilight()
&& NbSelected() <= 1))
if (myAutoHilight)
{
mySelection->selectOwner(myLastPicked, aPrevSelected, SelectionScheme (AIS_SelectionType_Select));
return getStatusOfPick (NbSelected());
}*/
HilightSelected (toUpdateViewer);
}
AIS_NListOfEntityOwner aPickedOwners;
aPickedOwners.Append (myLastPicked);
Standard_Integer aSelNum = NbSelected();
return Select (aPickedOwners, theSelScheme);
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean)
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdateViewer)
{
return Select (theXPMin, theYPMin, theXPMax, theYPMax, theView, AIS_SelectionScheme_ClearAndAdd);
}
if (!myLastPicked.IsNull())
{
Graphic3d_Vec2i aMousePos (-1, -1);
if (myMainSel->GetManager().GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Point)
{
aMousePos.SetValues ((Standard_Integer )myMainSel->GetManager().GetMousePosition().X(),
(Standard_Integer )myMainSel->GetManager().GetMousePosition().Y());
}
if (myLastPicked->HandleMouseClick (aMousePos, Aspect_VKeyMouse_LeftButton, Aspect_VKeyFlags_NONE, false))
{
return AIS_SOP_NothingSelected;
}
//=======================================================================
//function : Select
//purpose : Selection by polyline
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean)
{
return Select (thePolyline, theView, AIS_SelectionScheme_ClearAndAdd);
}
if (myAutoHilight)
{
clearDynamicHighlight();
}
if (!myLastPicked->IsSelected()
|| myLastPicked->IsForcedHilight()
|| NbSelected() > 1)
{
SetSelected (myLastPicked, Standard_False);
if(toUpdateViewer)
{
UpdateCurrentViewer();
}
}
}
else
{
ClearSelected (toUpdateViewer);
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean)
{
return Select (AIS_SelectionScheme_ClearAndAdd);
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
//function : ShiftSelect
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean)
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Boolean toUpdateViewer)
{
return Select (AIS_SelectionScheme_Switch);
if (myAutoHilight)
{
clearDynamicHighlight();
}
if (!myLastPicked.IsNull())
{
AddOrRemoveSelected (myLastPicked, toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
@@ -568,9 +637,39 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView,
const Standard_Boolean)
const Standard_Boolean toUpdateViewer)
{
return Select (theXPMin, theYPMin, theXPMax, theYPMax, theView, AIS_SelectionScheme_Switch);
if (theView->Viewer() != myMainVwr)
{
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
}
myLastActiveView = theView.get();
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
}
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
}
if (myAutoHilight)
{
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
return (aSelNum == 0) ? AIS_SOP_NothingSelected
: (aSelNum == 1) ? AIS_SOP_OneSelected
: AIS_SOP_SeveralSelected;
}
//=======================================================================
@@ -579,31 +678,31 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView,
const Standard_Boolean)
const Standard_Boolean toUpdateViewer)
{
return Select (thePolyline, theView, AIS_SelectionScheme_Switch);
}
//=======================================================================
//function : Select
//purpose :
//=======================================================================
AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_NListOfEntityOwner& theOwners,
const AIS_SelectionScheme theSelScheme)
{
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
if (myAutoHilight)
if (theView->Viewer() != myMainVwr)
{
clearDynamicHighlight();
UnhilightSelected (Standard_False);
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
}
mySelection->SelectOwners (theOwners, theSelScheme, myFilters);
myLastActiveView = theView.get();
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
}
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
const Handle(SelectMgr_EntityOwner) anOwner = myMainSel->Picked (aPickIter);
if (anOwner.IsNull() || !anOwner->HasSelectable() || !myFilters->IsOk (anOwner))
continue;
mySelection->Select (anOwner);
}
if (myAutoHilight)
{
HilightSelected (Standard_False);
HilightSelected (toUpdateViewer);
}
Standard_Integer aSelNum = NbSelected();
@@ -621,31 +720,14 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
{
// In case of selection without using local context
clearDynamicHighlight();
highlightOwners (mySelection->Objects(), Standard_True);
if (theToUpdateViewer)
UpdateCurrentViewer();
}
//=======================================================================
//function : highlightOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theOwners,
const Standard_Boolean& theToUseObjectDisplayMode)
{
AIS_MapOfObjSelectedOwners anObjOwnerMap;
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anObj.IsNull())
continue;
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
if (theToUseObjectDisplayMode && anOwner == anObj->GlobalSelOwner())
if (anOwner == anObj->GlobalSelOwner())
{
aState->SetHilightStatus (Standard_True);
aState->SetHilightStyle (anObjSelStyle);
@@ -666,7 +748,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
}
else
{
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, theToUseObjectDisplayMode ? aState->DisplayMode() : -1);
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, aState->DisplayMode());
anOwner->HilightWithColor (myMainPM, anObjSelStyle, aHiMode);
}
}
@@ -679,6 +761,9 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
}
anObjOwnerMap.Clear();
}
if (theToUpdateViewer)
UpdateCurrentViewer();
}
//=======================================================================
@@ -687,7 +772,17 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
//=======================================================================
void AIS_InteractiveContext::UnhilightSelected (const Standard_Boolean theToUpdateViewer)
{
unhighlightSelected();
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anOwner == anObj->GlobalSelOwner())
{
myObjects.ChangeFind (anObj)->SetHilightStatus (Standard_False);
}
anOwner->Unhilight (myMainPM);
}
if (theToUpdateViewer)
UpdateCurrentViewer();
@@ -842,6 +937,13 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
}
}
if (myAutoHilight && theOwner == anObject->GlobalSelOwner())
{
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObject);
aState->SetHilightStatus (Standard_True);
aState->SetHilightStyle (anObjSelStyle);
}
if (theToUpdateViewer)
UpdateCurrentViewer();
}
@@ -888,19 +990,28 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
if (!myObjects.IsBound(anObj)) // e.g. AIS_ViewCubeFlat is not displayed
return;
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
if (theOwner->IsSelected())
{
highlightSelected (theOwner);
if (isGlobal)
{
aStatus->SetHilightStatus (Standard_True);
aStatus->SetHilightStyle (getSelStyle (anObj, theOwner));
}
}
else
{
AIS_NListOfEntityOwner anOwners;
anOwners.Append (theOwner);
unhighlightOwners (anOwners);
if (theOwner->IsAutoHilight())
{
theOwner->Unhilight (myMainPM);
}
else
{
anObj->ClearSelected();
}
aStatus->SetHilightStatus (Standard_False);
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
}
}
@@ -909,6 +1020,43 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
UpdateCurrentViewer();
}
// =======================================================================
// function : SetSelectedState
// purpose :
// =======================================================================
Standard_Boolean AIS_InteractiveContext::SetSelectedState (const Handle(SelectMgr_EntityOwner)& theEntity,
const Standard_Boolean theIsSelected)
{
if (theEntity.IsNull())
{
throw Standard_ProgramError ("Internal error: AIS_InteractiveContext::SetSelectedState() called with NO object");
}
if (!theEntity->HasSelectable()
|| mySelection->IsSelected (theEntity) == theIsSelected)
{
return false;
}
if (theEntity->IsAutoHilight())
{
AddOrRemoveSelected (theEntity, false);
return true;
}
if (theIsSelected)
{
const AIS_SelectStatus aSelStatus = mySelection->AddSelect (theEntity);
theEntity->SetSelected (true);
return aSelStatus == AIS_SS_Added;
}
else
{
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity);
theEntity->SetSelected (false);
return aSelStatus == AIS_SS_Removed;
}
}
//=======================================================================
//function : IsSelected

View File

@@ -18,7 +18,6 @@
#include <AIS_InteractiveContext.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectFillCapping.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
@@ -144,26 +143,3 @@ void AIS_InteractiveObject::SetAspect(const Handle(Prs3d_BasicAspect)& theAspect
aGroup->SetGroupPrimitivesAspect (aTextAspect->Aspect());
}
}
const TCollection_AsciiString AIS_InteractiveObject_ClassName = "AIS_InteractiveObject";
// =======================================================================
// function : Dump
// purpose :
// =======================================================================
void AIS_InteractiveObject::Dump (Standard_OStream& OS) const
{
DUMP_START_KEY (OS, AIS_InteractiveObject_ClassName);
{
Standard_SStream aTmpStream;
SelectMgr_SelectableObject::Dump (aTmpStream);
DUMP_VALUES (OS, "SelectMgr_SelectableObject", TCollection::ToDumpString (aTmpStream));
}
DUMP_VALUES (OS, "InteractiveContext", TCollection::GetPointerInfo (myCTXPtr));
DUMP_VALUES (OS, "Owner", TCollection::GetPointerInfo (myOwner));
DUMP_STOP_KEY (OS, AIS_InteractiveObject_ClassName);
}

View File

@@ -118,9 +118,6 @@ public:
Standard_DEPRECATED("Deprecated method, results might be undefined")
Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect);
//! Dumps the content of me on the stream <OS>.
Standard_EXPORT virtual void Dump (Standard_OStream& OS) const Standard_OVERRIDE;
protected:
//! The TypeOfPresention3d means that the interactive object

View File

@@ -1035,15 +1035,21 @@ void AIS_Manipulator::HilightOwnerWithColor (const Handle(PrsMgr_PresentationMan
{
return;
}
aPresentation->CStructure()->ViewAffinity = thePM->StructureManager()->ObjectAffinity (Handle(Standard_Transient) (this));
if (anOwner->Mode() == AIS_MM_TranslationPlane)
{
Handle(Prs3d_Drawer) aStyle = new Prs3d_Drawer();
aStyle->SetColor(myAxes[anOwner->Index()].Color());
aStyle->SetTransparency(0.5);
aPresentation->Highlight(aStyle);
aStyle->SetColor (myAxes[anOwner->Index()].Color());
aStyle->SetTransparency (0.5);
aPresentation->Highlight (aStyle);
}
else
aPresentation->Highlight(theStyle);
{
aPresentation->Highlight (theStyle);
}
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aPresentation->Groups());
aGroupIter.More(); aGroupIter.Next())
{

View File

@@ -0,0 +1,36 @@
// Copyright (c) 2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_MouseGesture_HeaderFile
#define _AIS_MouseGesture_HeaderFile
#include <NCollection_DataMap.hxx>
//! Mouse gesture - only one can be active at one moment.
enum AIS_MouseGesture
{
AIS_MouseGesture_NONE, //!< no active gesture
//
AIS_MouseGesture_SelectRectangle, //!< rectangular selection
AIS_MouseGesture_SelectLasso, //!< polygonal selection
//
AIS_MouseGesture_Zoom, //!< view zoom gesture
AIS_MouseGesture_Pan, //!< view panning gesture
AIS_MouseGesture_RotateOrbit, //!< orbit rotation gesture
AIS_MouseGesture_RotateView, //!< view rotation gesture
};
//! Map defining mouse gestures.
typedef NCollection_DataMap<unsigned int, AIS_MouseGesture> AIS_MouseGestureMap;
#endif // _AIS_MouseGesture_HeaderFile

View File

@@ -11,21 +11,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_NavigationMode_HeaderFile
#define _AIS_NavigationMode_HeaderFile
#ifndef _AIS_SelectionType_HeaderFile
#define _AIS_SelectionType_HeaderFile
//! Sets selection schemes for interactive contexts.
//! It is possible to use combination of schemes.
enum AIS_SelectionType
//! Camera navigation mode.
enum AIS_NavigationMode
{
AIS_SelectionType_Select,
AIS_SelectionType_SelectInRect,
AIS_SelectionType_SelectInPoly,
AIS_SelectionType_ShiftSelect,
AIS_SelectionType_ShiftSelectInRect,
AIS_SelectionType_ShiftSelectInPoly
AIS_NavigationMode_Orbit, //!< orbit rotation
AIS_NavigationMode_FirstPersonFlight, //!< flight rotation (first person)
AIS_NavigationMode_FirstPersonWalk, //!< walking mode (first person)
};
#endif // _AIS_SelectionType_HeaderFile
enum
{
AIS_NavigationMode_LOWER = 0,
AIS_NavigationMode_UPPER = AIS_NavigationMode_FirstPersonWalk
};
#endif // _V3d_NavigationMode_HeaderFile

View File

@@ -79,7 +79,7 @@ mySAttach(0.,0.,0.)
myArrowSize = fabs (myVal/10.0);
if (myArrowSize > 30.) myArrowSize = 30.;
if (myArrowSize < 15.) myArrowSize = 15.;
//cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
}
//=======================================================================
@@ -95,7 +95,7 @@ void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&,
myArrowSize = fabs (myVal/10.0);
if (myArrowSize > 30.) myArrowSize = 30.;
if (myArrowSize < 15.) myArrowSize = 15.;
//cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
BRepAdaptor_Surface surf1(TopoDS::Face(myFShape));
BRepAdaptor_Surface surf2(TopoDS::Face(mySShape));
@@ -163,7 +163,7 @@ void AIS_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aS
myArrowSize = fabs (myVal/10.0);
if (myArrowSize > 30.) myArrowSize = 30.;
if (myArrowSize < 15.) myArrowSize = 15.;
//cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
gp_Pnt myTFAttach = myFAttach.Transformed (myRelativePos);
gp_Pnt myTSAttach = mySAttach.Transformed (myRelativePos);
gp_Dir myTDirAttach = myDirAttach.Transformed (myRelativePos);
@@ -325,7 +325,7 @@ void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)&
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
//cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
arr->SetLength(myArrowSize);
arr = la->ArrowAspect();
arr->SetLength(myArrowSize);
@@ -431,7 +431,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
//cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<endl;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
arr->SetLength(myArrowSize);
arr = la->ArrowAspect();
arr->SetLength(myArrowSize);

View File

@@ -0,0 +1,33 @@
// Copyright (c) 2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_RotationMode_HeaderFile
#define _AIS_RotationMode_HeaderFile
//! Camera rotation mode.
enum AIS_RotationMode
{
AIS_RotationMode_BndBoxActive, //!< default OCCT rotation
AIS_RotationMode_PickLast, //!< rotate around last picked point
AIS_RotationMode_PickCenter, //!< rotate around point at the center of window
AIS_RotationMode_CameraAt, //!< rotate around camera center
AIS_RotationMode_BndBoxScene, //!< rotate around scene center
};
enum
{
AIS_RotationMode_LOWER = 0,
AIS_RotationMode_UPPER = AIS_RotationMode_BndBoxScene,
};
#endif // _AIS_RotationMode_HeaderFile

View File

@@ -15,8 +15,6 @@
#include <AIS_Selection.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_SelectionScheme.hxx>
#include <SelectMgr_Filter.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Selection, Standard_Transient)
@@ -132,71 +130,3 @@ AIS_SelectStatus AIS_Selection::AddSelect (const Handle(SelectMgr_EntityOwner)&
theObject->SetSelected (Standard_True);
return AIS_SS_Added;
}
//=======================================================================
//function : SelectOwners
//purpose :
//=======================================================================
void AIS_Selection::SelectOwners (const AIS_NListOfEntityOwner& thePickedOwners,
const int theSelScheme,
const Handle(SelectMgr_Filter)& theFilter)
{
int aSelScheme = theSelScheme;
AIS_NListOfEntityOwner aPrevSelected = Objects();
if (theSelScheme & AIS_SelectionScheme_Clear)
{
Clear();
if (theSelScheme & AIS_SelectionScheme_Switch &&
theSelScheme & AIS_SelectionScheme_PickedIfEmpty &&
thePickedOwners.Size() < aPrevSelected.Size())
{
// check if all picked objects are in previous selected list, if so, all objects will be deselected,
// but in mode AIS_SelectionScheme_PickedIfEmpty new picked objects should be selected, here, after Clear, Add
Standard_Boolean anOtherFound = Standard_False;
for (AIS_NListOfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
anOtherFound = !aPrevSelected.Contains (aSelIter.Value());
if (anOtherFound)
break;
}
if (!anOtherFound)
aSelScheme = AIS_SelectionScheme_Add;
}
}
for (AIS_NListOfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
selectOwner(aSelIter.Value(), aPrevSelected, aSelScheme, theFilter);
}
}
//=======================================================================
//function : selectOwner
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::selectOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const AIS_NListOfEntityOwner& thePreviousSelected,
const int theSelScheme,
const Handle(SelectMgr_Filter)& theFilter)
{
if (theOwner.IsNull() || !theOwner->HasSelectable() || !theFilter->IsOk (theOwner))
return AIS_SS_NotDone;
if (theSelScheme & AIS_SelectionScheme_Add)
{
return AddSelect (theOwner);
}
else if (theSelScheme & AIS_SelectionScheme_Switch)
{
if (thePreviousSelected.Contains (theOwner)) // was selected, should not be now
{
if (theOwner->IsSelected())
return Select (theOwner); // deselect
}
else
return AddSelect (theOwner); // was not selected, should be now
}
return AIS_SS_NotDone;
}

View File

@@ -22,8 +22,6 @@
#include <Standard.hxx>
#include <Standard_Type.hxx>
class SelectMgr_Filter;
//! Class holding the list of selected owners.
class AIS_Selection : public Standard_Transient
{
@@ -77,28 +75,6 @@ public:
//! Return selected object at iterator position.
const Handle(SelectMgr_EntityOwner)& Value() const { return myIterator.Value(); }
//! Select or deselect owners depending on the selection scheme
//! \param theOwners elements to change selection state
//! \param theSelScheme selection scheme, defines how owner is selected
//! \param theFilter context filter to skip not acceptable owners
//! \return result of selection
Standard_EXPORT virtual void SelectOwners (const AIS_NListOfEntityOwner& thePickedOwners,
const int theSelScheme,
const Handle(SelectMgr_Filter)& theFilter);
protected:
//! Select or deselect owner depending on the selection scheme
//! \param theOwner element to change selection state
//! \param thePreviousSelected previous selected objects
//! \param theSelScheme selection scheme, defines how owner is selected
//! \param theFilter context filter to skip not acceptable owners
//! \return result of selection
Standard_EXPORT virtual AIS_SelectStatus selectOwner (const Handle(SelectMgr_EntityOwner)& theOwner,
const AIS_NListOfEntityOwner& thePreviousSelected,
const int theSelScheme,
const Handle(SelectMgr_Filter)& theFilter);
private:
AIS_NListOfEntityOwner myresult;

View File

@@ -1,34 +0,0 @@
// Copyright (c) 2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_SelectionScheme_HeaderFile
#define _AIS_SelectionScheme_HeaderFile
//! Sets selection schemes for interactive contexts.
//! It is possible to use combination of schemes.
enum AIS_SelectionScheme
{
AIS_SelectionScheme_Empty = 0x0000, // do nothing
AIS_SelectionScheme_Clear = 0x0001, // clears current selection
AIS_SelectionScheme_Add = 0x0002, // add detected object to current selection
AIS_SelectionScheme_Switch = 0x0004, // switch selection state in values selected/deselected
AIS_SelectionScheme_PickedIfEmpty = 0x0008, // if after switch, result selection is empty, select picked objects
AIS_SelectionScheme_ClearAndSwitch = AIS_SelectionScheme_Clear | AIS_SelectionScheme_Switch,
AIS_SelectionScheme_ClearAndAdd = AIS_SelectionScheme_Clear | AIS_SelectionScheme_Add,
AIS_SelectionScheme_ClearAndSwitchAndPicked = AIS_SelectionScheme_ClearAndSwitch | AIS_SelectionScheme_PickedIfEmpty,
AIS_SelectionScheme_Custom // reserved item for custom selection scheme
};
#endif // _AIS_SelectionScheme_HeaderFile

View File

@@ -180,7 +180,10 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
try
{
OCC_CATCH_SIGNALS
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer, myDrawer->FillCappingAspect());
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer,
myDrawer->ShadingAspect()->Aspect()->ToMapTexture()
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
myUVOrigin, myUVRepeat, myUVScale);
}
catch (Standard_Failure const& anException)
{
@@ -790,7 +793,7 @@ const Bnd_Box& AIS_Shape::BoundingBox()
}
if(myCompBB) {
BRepBndLib::AddClose(myshape, myBB);
BRepBndLib::Add (myshape, myBB, false);
myCompBB = Standard_False;
}
return myBB;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,684 @@
// Copyright (c) 2016-2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_ViewController_HeaderFile
#define _AIS_ViewController_HeaderFile
#include <Aspect_VKeySet.hxx>
#include <Aspect_TouchMap.hxx>
#include <AIS_DragAction.hxx>
#include <AIS_MouseGesture.hxx>
#include <AIS_NavigationMode.hxx>
#include <AIS_ViewInputBuffer.hxx>
#include <AIS_RotationMode.hxx>
#include <AIS_WalkDelta.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_Vec3.hxx>
#include <NCollection_Array1.hxx>
#include <OSD_Timer.hxx>
#include <Precision.hxx>
#include <Standard_Mutex.hxx>
class AIS_AnimationCamera;
class AIS_InteractiveObject;
class AIS_InteractiveContext;
class AIS_Point;
class AIS_RubberBand;
class V3d_View;
//! Auxiliary structure for handling viewer events between GUI and Rendering threads.
//!
//! Class implements the following features:
//! - Buffers storing the state of user input (mouse, touches and keyboard).
//! - Mapping mouse/multi-touch input to View camera manipulations (panning/rotating/zooming).
//! - Input events are not applied immediately but queued for separate processing from two working threads
//! UI thread receiving user input and Rendering thread for OCCT 3D Viewer drawing.
class AIS_ViewController
{
public:
//! Empty constructor.
Standard_EXPORT AIS_ViewController();
//! Return input buffer.
const AIS_ViewInputBuffer& InputBuffer (AIS_ViewInputBufferType theType) const { return theType == AIS_ViewInputBufferType_UI ? myUI : myGL; }
//! Return input buffer.
AIS_ViewInputBuffer& ChangeInputBuffer (AIS_ViewInputBufferType theType) { return theType == AIS_ViewInputBufferType_UI ? myUI : myGL; }
//! Return view animation; empty (but not NULL) animation by default.
const Handle(AIS_AnimationCamera)& ViewAnimation() const { return myViewAnimation; }
//! Set view animation to be handled within handleViewRedraw().
void SetViewAnimation (const Handle(AIS_AnimationCamera)& theAnimation) { myViewAnimation = theAnimation; }
//! Interrupt active view animation.
Standard_EXPORT void AbortViewAnimation();
public: //! @name global parameters
//! Return camera rotation mode, AIS_RotationMode_BndBoxActive by default.
AIS_RotationMode RotationMode() const { return myRotationMode; }
//! Set camera rotation mode.
void SetRotationMode (AIS_RotationMode theMode) { myRotationMode = theMode; }
//! Return camera navigation mode; AIS_NavigationMode_Orbit by default.
AIS_NavigationMode NavigationMode() const { return myNavigationMode; }
//! Set camera navigation mode.
Standard_EXPORT void SetNavigationMode (AIS_NavigationMode theMode);
//! Return mouse input acceleration ratio in First Person mode; 1.0 by default.
float MouseAcceleration() const { return myMouseAccel; }
//! Set mouse input acceleration ratio.
void SetMouseAcceleration (float theRatio) { myMouseAccel = theRatio; }
//! Return orbit rotation acceleration ratio; 1.0 by default.
float OrbitAcceleration() const { return myOrbitAccel; }
//! Set orbit rotation acceleration ratio.
void SetOrbitAcceleration (float theRatio) { myOrbitAccel = theRatio; }
//! Return TRUE if panning anchor point within perspective projection should be displayed in 3D Viewer; TRUE by default.
bool ToShowPanAnchorPoint() const { return myToShowPanAnchorPoint; }
//! Set if panning anchor point within perspective projection should be displayed in 3D Viewer.
void SetShowPanAnchorPoint (bool theToShow) { myToShowPanAnchorPoint = theToShow; }
//! Return TRUE if rotation point should be displayed in 3D Viewer; TRUE by default.
bool ToShowRotateCenter() const { return myToShowRotateCenter; }
//! Set if rotation point should be displayed in 3D Viewer.
void SetShowRotateCenter (bool theToShow) { myToShowRotateCenter = theToShow; }
//! Return TRUE if camera up orientation within AIS_NavigationMode_Orbit rotation mode should be forced Z up; FALSE by default.
bool ToLockOrbitZUp() const { return myToLockOrbitZUp; }
//! Set if camera up orientation within AIS_NavigationMode_Orbit rotation mode should be forced Z up.
void SetLockOrbitZUp (bool theToForceUp) { myToLockOrbitZUp = theToForceUp; }
//! Return TRUE if z-rotation via two-touches gesture is enabled; FALSE by default.
bool ToAllowTouchZRotation() const { return myToAllowTouchZRotation; }
//! Set if z-rotation via two-touches gesture is enabled.
void SetAllowTouchZRotation (bool theToEnable) { myToAllowTouchZRotation = theToEnable; }
//! Return TRUE if camera rotation is allowed; TRUE by default.
bool ToAllowRotation() const { return myToAllowRotation; }
//! Set if camera rotation is allowed.
void SetAllowRotation (bool theToEnable) { myToAllowRotation = theToEnable; }
//! Return TRUE if panning is allowed; TRUE by default.
bool ToAllowPanning() const { return myToAllowPanning; }
//! Set if panning is allowed.
void SetAllowPanning (bool theToEnable) { myToAllowPanning = theToEnable; }
//! Return TRUE if zooming is allowed; TRUE by default.
bool ToAllowZooming() const { return myToAllowZooming; }
//! Set if zooming is allowed.
void SetAllowZooming (bool theToEnable) { myToAllowZooming = theToEnable; }
//! Return TRUE if ZFocus change is allowed; TRUE by default.
bool ToAllowZFocus() const { return myToAllowZFocus; }
//! Set if ZFocus change is allowed.
void SetAllowZFocus (bool theToEnable) { myToAllowZFocus = theToEnable; }
//! Return TRUE if dynamic highlight on mouse move is allowed; TRUE by default.
bool ToAllowHighlight() const { return myToAllowHighlight; }
//! Set if dragging object is allowed.
void SetAllowHighlight (bool theToEnable) { myToAllowHighlight = theToEnable; }
//! Return TRUE if dragging object is allowed; TRUE by default.
bool ToAllowDragging() const { return myToAllowDragging; }
//! Set if dynamic highlight on mouse move is allowed.
void SetAllowDragging (bool theToEnable) { myToAllowDragging = theToEnable; }
//! Return TRUE if picked point should be projected to picking ray on zooming at point; TRUE by default.
bool ToStickToRayOnZoom() const { return myToStickToRayOnZoom; }
//! Set if picked point should be projected to picking ray on zooming at point.
void SetStickToRayOnZoom (bool theToEnable) { myToStickToRayOnZoom = theToEnable; }
//! Return TRUE if picked point should be projected to picking ray on rotating around point; TRUE by default.
bool ToStickToRayOnRotation() const { return myToStickToRayOnRotation; }
//! Set if picked point should be projected to picking ray on rotating around point.
void SetStickToRayOnRotation (bool theToEnable) { myToStickToRayOnRotation = theToEnable; }
//! Return TRUE if pitch direction should be inverted while processing Aspect_VKey_NavLookUp/Aspect_VKey_NavLookDown; FALSE by default.
bool ToInvertPitch() const { return myToInvertPitch; }
//! Set flag inverting pitch direction.
void SetInvertPitch (bool theToInvert) { myToInvertPitch = theToInvert; }
//! Return normal walking speed, in m/s; 1.5 by default.
float WalkSpeedAbsolute() const { return myWalkSpeedAbsolute; }
//! Set normal walking speed, in m/s; 1.5 by default.
void SetWalkSpeedAbsolute (float theSpeed) { myWalkSpeedAbsolute = theSpeed; }
//! Return walking speed relative to scene bounding box; 0.1 by default.
float WalkSpeedRelative() const { return myWalkSpeedRelative; }
//! Set walking speed relative to scene bounding box.
void SetWalkSpeedRelative (float theFactor) { myWalkSpeedRelative = theFactor; }
//! Return active thrust value; 0.0f by default.
float ThrustSpeed() const { return myThrustSpeed; }
//! Set active thrust value.
void SetThrustSpeed (float theSpeed) { myThrustSpeed = theSpeed; }
//! Return TRUE if previous position of MoveTo has been defined.
bool HasPreviousMoveTo() const { return myPrevMoveTo != Graphic3d_Vec2i (-1); }
//! Return previous position of MoveTo event in 3D viewer.
const Graphic3d_Vec2i& PreviousMoveTo() const { return myPrevMoveTo; }
//! Reset previous position of MoveTo.
void ResetPreviousMoveTo() { myPrevMoveTo = Graphic3d_Vec2i (-1); }
public: //! @name keyboard input
//! Return keyboard state.
const Aspect_VKeySet& Keys() const { return myKeys; }
//! Return keyboard state.
Aspect_VKeySet& ChangeKeys() { return myKeys; }
//! Press key.
//! @param theKey key pressed
//! @param theTime event timestamp
Standard_EXPORT virtual void KeyDown (Aspect_VKey theKey,
double theTime,
double thePressure = 1.0);
//! Release key.
//! @param theKey key pressed
//! @param theTime event timestamp
Standard_EXPORT virtual void KeyUp (Aspect_VKey theKey,
double theTime);
//! Simulate key up/down events from axis value.
Standard_EXPORT virtual void KeyFromAxis (Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
double thePressure);
//! Fetch active navigation actions.
Standard_EXPORT AIS_WalkDelta FetchNavigationKeys (Standard_Real theCrouchRatio,
Standard_Real theRunRatio);
public: //! @name mouse input
//! Return map defining mouse gestures.
const AIS_MouseGestureMap& MouseGestureMap() const { return myMouseGestureMap; }
//! Return map defining mouse gestures.
AIS_MouseGestureMap& ChangeMouseGestureMap() { return myMouseGestureMap; }
//! Return double click interval in seconds; 0.4 by default.
double MouseDoubleClickInterval() const { return myMouseDoubleClickInt; }
//! Set double click interval in seconds.
void SetMouseDoubleClickInterval (double theSeconds) { myMouseDoubleClickInt = theSeconds; }
//! Perform selection in 3D viewer.
//! This method is expected to be called from UI thread.
//! @param thePnt picking point
//! @param theIsXOR XOR selection flag
Standard_EXPORT virtual void SelectInViewer (const Graphic3d_Vec2i& thePnt,
const bool theIsXOR = false);
//! Perform selection in 3D viewer.
//! This method is expected to be called from UI thread.
//! @param thePnts picking point
//! @param theIsXOR XOR selection flag
Standard_EXPORT virtual void SelectInViewer (const NCollection_Sequence<Graphic3d_Vec2i>& thePnts,
const bool theIsXOR = false);
//! Update rectangle selection tool.
//! This method is expected to be called from UI thread.
//! @param thePntFrom rectangle first corner
//! @param thePntTo rectangle another corner
//! @param theIsXOR XOR selection flag
Standard_EXPORT virtual void UpdateRubberBand (const Graphic3d_Vec2i& thePntFrom,
const Graphic3d_Vec2i& thePntTo,
const bool theIsXOR = false);
//! Update polygonal selection tool.
//! This method is expected to be called from UI thread.
//! @param thePnt new point to add to polygon
//! @param theToAppend append new point or update the last point
Standard_EXPORT virtual void UpdatePolySelection (const Graphic3d_Vec2i& thePnt,
bool theToAppend);
//! Update zoom event (e.g. from mouse scroll).
//! This method is expected to be called from UI thread.
//! @param theDelta mouse cursor position to zoom at and zoom delta
//! @return TRUE if new zoom event has been created or FALSE if existing one has been updated
Standard_EXPORT virtual bool UpdateZoom (const Aspect_ScrollDelta& theDelta);
//! Update Z rotation event.
//! @param theAngle rotation angle, in radians.
//! @return TRUE if new zoom event has been created or FALSE if existing one has been updated
Standard_EXPORT virtual bool UpdateZRotation (double theAngle);
//! Update mouse scroll event; redirects to UpdateZoom by default.
//! This method is expected to be called from UI thread.
//! @param theDelta mouse cursor position and delta
//! @return TRUE if new event has been created or FALSE if existing one has been updated
Standard_EXPORT virtual bool UpdateMouseScroll (const Aspect_ScrollDelta& theDelta);
//! Handle mouse button press/release event.
//! This method is expected to be called from UI thread.
//! @param thePoint mouse cursor position
//! @param theButtons pressed buttons
//! @param theModifiers key modifiers
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
//! but emulated from non-precise input like touch on screen
//! @return TRUE if View should be redrawn
Standard_EXPORT virtual bool UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
bool theIsEmulated);
//! Handle mouse cursor movement event.
//! This method is expected to be called from UI thread.
//! @param thePoint mouse cursor position
//! @param theButtons pressed buttons
//! @param theModifiers key modifiers
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
//! but emulated from non-precise input like touch on screen
//! @return TRUE if View should be redrawn
Standard_EXPORT virtual bool UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
bool theIsEmulated);
//! Handle mouse button press event.
//! This method is expected to be called from UI thread.
//! @param thePoint mouse cursor position
//! @param theButton pressed button
//! @param theModifiers key modifiers
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
//! but emulated from non-precise input like touch on screen
//! @return TRUE if View should be redrawn
bool PressMouseButton (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsEmulated)
{
return UpdateMouseButtons (thePoint, myMousePressed | theButton, theModifiers, theIsEmulated);
}
//! Handle mouse button release event.
//! This method is expected to be called from UI thread.
//! @param thePoint mouse cursor position
//! @param theButton released button
//! @param theModifiers key modifiers
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
//! but emulated from non-precise input like touch on screen
//! @return TRUE if View should be redrawn
bool ReleaseMouseButton (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsEmulated)
{
Aspect_VKeyMouse aButtons = myMousePressed & (~theButton);
return UpdateMouseButtons (thePoint, aButtons, theModifiers, theIsEmulated);
}
//! Handle mouse button click event (emulated by UpdateMouseButtons() while releasing single button).
//! Note that as this method is called by UpdateMouseButtons(), it should be executed from UI thread.
//! Default implementation redirects to SelectInViewer().
//! This method is expected to be called from UI thread.
//! @param thePoint mouse cursor position
//! @param theButton clicked button
//! @param theModifiers key modifiers
//! @param theIsDoubleClick flag indicating double mouse click
//! @return TRUE if View should be redrawn
Standard_EXPORT virtual bool UpdateMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick);
//! Return currently pressed mouse buttons.
Aspect_VKeyMouse PressedMouseButtons() const { return myMousePressed; }
//! Return active key modifiers passed with last mouse event.
Aspect_VKeyFlags LastMouseFlags() const { return myMouseModifiers; }
//! Return last mouse position.
const Graphic3d_Vec2i& LastMousePosition() const { return myMousePositionLast; }
public: //! @name multi-touch input
//! Return scale factor for adjusting tolerances for starting multi-touch gestures; 1.0 by default
//! This scale factor is expected to be computed from touch screen resolution.
float TouchToleranceScale() const { return myTouchToleranceScale; }
//! Set scale factor for adjusting tolerances for starting multi-touch gestures.
void SetTouchToleranceScale (float theTolerance) { myTouchToleranceScale = theTolerance; }
//! Return TRUE if touches map is not empty.
bool HasTouchPoints() const { return !myTouchPoints.IsEmpty(); }
//! Add touch point with the given ID.
//! This method is expected to be called from UI thread.
//! @param theId touch unique identifier
//! @param thePnt touch coordinates
//! @param theClearBefore if TRUE previously registered touches will be removed
Standard_EXPORT virtual void AddTouchPoint (Standard_Size theId,
const Graphic3d_Vec2d& thePnt,
Standard_Boolean theClearBefore = false);
//! Remove touch point with the given ID.
//! This method is expected to be called from UI thread.
//! @param theId touch unique identifier
//! @param theClearSelectPnts if TRUE will initiate clearing of selection points
//! @return TRUE if point has been removed
Standard_EXPORT virtual bool RemoveTouchPoint (Standard_Size theId,
Standard_Boolean theClearSelectPnts = false);
//! Update touch point with the given ID.
//! If point with specified ID was not registered before, it will be added.
//! This method is expected to be called from UI thread.
//! @param theId touch unique identifier
//! @param thePnt touch coordinates
Standard_EXPORT virtual void UpdateTouchPoint (Standard_Size theId,
const Graphic3d_Vec2d& thePnt);
public:
//! Return event time (e.g. current time).
double EventTime() const { return myEventTimer.ElapsedTime(); }
//! Reset input state (pressed keys, mouse buttons, etc.) e.g. on window focus loss.
//! This method is expected to be called from UI thread.
Standard_EXPORT virtual void ResetViewInput();
//! Reset view orientation.
//! This method is expected to be called from UI thread.
Standard_EXPORT virtual void UpdateViewOrientation (V3d_TypeOfOrientation theOrientation,
bool theToFitAll);
//! Update buffer for rendering thread.
//! This method is expected to be called within synchronization barrier between GUI
//! and Rendering threads (e.g. GUI thread should be locked beforehand to avoid data races).
//! @param theCtx interactive context
//! @param theView active view
//! @param theToHandle if TRUE, the HandleViewEvents() will be called
Standard_EXPORT virtual void FlushViewEvents (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
Standard_Boolean theToHandle = Standard_False);
//! Process events within rendering thread.
Standard_EXPORT virtual void HandleViewEvents (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
public:
//! Callback called by handleMoveTo() on Selection in 3D Viewer.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void OnSelectionChanged (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Callback called by handleMoveTo() on dragging object in 3D Viewer.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void OnObjectDragged (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
AIS_DragAction theAction);
//! Pick closest point under mouse cursor.
//! This method is expected to be called from rendering thread.
//! @param thePnt [out] result point
//! @param theCtx [in] interactive context
//! @param theView [in] active view
//! @param theCursor [in] mouse cursor
//! @param theToStickToPickRay [in] when TRUE, the result point will lie on picking ray
//! @return TRUE if result has been found
Standard_EXPORT virtual bool PickPoint (gp_Pnt& thePnt,
const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const Graphic3d_Vec2i& theCursor,
bool theToStickToPickRay);
//! Compute rotation gravity center point depending on rotation mode.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual gp_Pnt GravityPoint (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
public:
//! Perform camera actions.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleCameraActions (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const AIS_WalkDelta& theWalk);
//! Perform moveto/selection/dragging.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleMoveTo (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Return TRUE if another frame should be drawn right after this one.
bool toAskNextFrame() const { return myToAskNextFrame; }
//! Set if another frame should be drawn right after this one.
void setAskNextFrame (bool theToDraw = true) { myToAskNextFrame = theToDraw; }
//! Return if panning anchor point has been defined.
bool hasPanningAnchorPoint() const { return !Precision::IsInfinite (myPanPnt3d.X()); }
//! Return active panning anchor point.
const gp_Pnt& panningAnchorPoint() const { return myPanPnt3d; }
//! Set active panning anchor point.
void setPanningAnchorPoint (const gp_Pnt& thePnt) { myPanPnt3d = thePnt; }
//! Handle panning event myGL.Panning.
Standard_EXPORT virtual void handlePanning (const Handle(V3d_View)& theView);
//! Handle Z rotation event myGL.ZRotate.
Standard_EXPORT virtual void handleZRotate (const Handle(V3d_View)& theView);
//! Return minimal camera distance for zoom operation.
double MinZoomDistance() const { return myMinCamDistance; }
//! Set minimal camera distance for zoom operation.
void SetMinZoomDistance (double theDist) { myMinCamDistance = theDist; }
//! Handle zoom event myGL.ZoomActions.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleZoom (const Handle(V3d_View)& theView,
const Aspect_ScrollDelta& theParams,
const gp_Pnt* thePnt);
//! Handle ZScroll event myGL.ZoomActions.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleZFocusScroll (const Handle(V3d_View)& theView,
const Aspect_ScrollDelta& theParams);
//! Handle orbital rotation events myGL.OrbitRotation.
//! @param theView view to modify
//! @param thePnt 3D point to rotate around
//! @param theToLockZUp amend camera to exclude roll angle (put camera Up vector to plane containing global Z and view direction)
Standard_EXPORT virtual void handleOrbitRotation (const Handle(V3d_View)& theView,
const gp_Pnt& thePnt,
bool theToLockZUp);
//! Handle view direction rotation events myGL.ViewRotation.
//! This method is expected to be called from rendering thread.
//! @param theView camera to modify
//! @param theYawExtra extra yaw increment
//! @param thePitchExtra extra pitch increment
//! @param theRoll roll value
//! @param theToRestartOnIncrement flag indicating flight mode
Standard_EXPORT virtual void handleViewRotation (const Handle(V3d_View)& theView,
double theYawExtra,
double thePitchExtra,
double theRoll,
bool theToRestartOnIncrement);
//! Handle view redraw.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
protected:
//! Flush buffers.
Standard_EXPORT virtual void flushBuffers (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Flush touch gestures.
Standard_EXPORT virtual void flushGestures (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Return current and previously fetched event times.
//! This callback is intended to compute delta between sequentially processed events.
//! @param thePrevTime [out] events time fetched previous time by this method
//! @param theCurrTime [out] actual events time
void updateEventsTime (double& thePrevTime,
double& theCurrTime)
{
thePrevTime = myLastEventsTime;
myLastEventsTime = EventTime();
theCurrTime = myLastEventsTime;
}
//! Perform selection via mouse click.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleSelectionPick (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Perform dynamic highlight on mouse move.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleDynamicHighlight (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Perform rubber-band selection.
//! This method is expected to be called from rendering thread.
Standard_EXPORT virtual void handleSelectionPoly (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView);
//! Lazy AIS_InteractiveContext::MoveTo() with myPrevMoveTo check.
Standard_EXPORT virtual void contextLazyMoveTo (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const Graphic3d_Vec2i& thePnt);
protected:
AIS_ViewInputBuffer myUI; //!< buffer for UI thread
AIS_ViewInputBuffer myGL; //!< buffer for rendering thread
OSD_Timer myEventTimer; //!< timer for timestamping events
Standard_Real myLastEventsTime; //!< last fetched events timer value for computing delta/progress
Standard_Boolean myToAskNextFrame; //!< flag indicating that another frame should be drawn right after this one
Standard_Real myMinCamDistance; //!< minimal camera distance for zoom operation
AIS_RotationMode myRotationMode; //!< rotation mode
AIS_NavigationMode myNavigationMode; //!< navigation mode (orbit rotation / first person)
Standard_ShortReal myMouseAccel; //!< mouse input acceleration ratio in First Person mode
Standard_ShortReal myOrbitAccel; //!< Orbit rotation acceleration ratio
Standard_Boolean myToShowPanAnchorPoint; //!< option displaying panning anchor point
Standard_Boolean myToShowRotateCenter; //!< option displaying rotation center point
Standard_Boolean myToLockOrbitZUp; //!< force camera up orientation within AIS_NavigationMode_Orbit rotation mode
Standard_Boolean myToInvertPitch; //!< flag inverting pitch direction while processing Aspect_VKey_NavLookUp/Aspect_VKey_NavLookDown
Standard_Boolean myToAllowTouchZRotation; //!< enable z-rotation two-touches gesture; FALSE by default
Standard_Boolean myToAllowRotation; //!< enable rotation; TRUE by default
Standard_Boolean myToAllowPanning; //!< enable panning; TRUE by default
Standard_Boolean myToAllowZooming; //!< enable zooming; TRUE by default
Standard_Boolean myToAllowZFocus; //!< enable ZFocus change; TRUE by default
Standard_Boolean myToAllowHighlight; //!< enable dynamic highlight on mouse move; TRUE by default
Standard_Boolean myToAllowDragging; //!< enable dragging object; TRUE by default
Standard_Boolean myToStickToRayOnZoom; //!< project picked point to ray while zooming at point, TRUE by default
Standard_Boolean myToStickToRayOnRotation; //!< project picked point to ray while rotating around point; TRUE by default
Standard_ShortReal myWalkSpeedAbsolute; //!< normal walking speed, in m/s; 1.5 by default
Standard_ShortReal myWalkSpeedRelative; //!< walking speed relative to scene bounding box; 0.1 by default
Standard_ShortReal myThrustSpeed; //!< active thrust value
Standard_Boolean myHasThrust; //!< flag indicating active thrust
Handle(AIS_AnimationCamera) myViewAnimation; //!< view animation
Handle(AIS_RubberBand) myRubberBand; //!< Rubber-band presentation
Handle(AIS_InteractiveObject) myDragObject; //!< currently dragged object
Graphic3d_Vec2i myPrevMoveTo; //!< previous position of MoveTo event in 3D viewer
Standard_Boolean myHasHlrOnBeforeRotation; //!< flag for restoring Computed mode after rotation
protected: //! @name keyboard input variables
Aspect_VKeySet myKeys; //!< keyboard state
protected: //! @name mouse input variables
Standard_Real myMouseClickThreshold; //!< mouse click threshold in pixels; 3 by default
Standard_Real myMouseDoubleClickInt; //!< double click interval in seconds; 0.4 by default
Standard_ShortReal myScrollZoomRatio; //!< distance ratio for mapping mouse scroll event to zoom; 15.0 by default
AIS_MouseGestureMap myMouseGestureMap; //!< map defining mouse gestures
AIS_MouseGesture myMouseActiveGesture; //!< initiated mouse gesture (by pressing mouse button)
Standard_Boolean myMouseActiveIdleRotation; //!< flag indicating view idle rotation state
Graphic3d_Vec2i myMousePositionLast; //!< last mouse position
Graphic3d_Vec2i myMousePressPoint; //!< mouse position where active gesture was been initiated
Graphic3d_Vec2i myMouseProgressPoint; //!< gesture progress
OSD_Timer myMouseClickTimer; //!< timer for handling double-click event
Standard_Integer myMouseClickCounter; //!< counter for handling double-click event
Aspect_VKeyMouse myMousePressed; //!< active mouse buttons
Aspect_VKeyFlags myMouseModifiers; //!< active key modifiers passed with last mouse event
Standard_Integer myMouseSingleButton; //!< index of mouse button pressed alone (>0)
protected: //! @name multi-touch input variables
Standard_ShortReal myTouchToleranceScale; //!< tolerance scale factor; 1.0 by default
Standard_ShortReal myTouchRotationThresholdPx; //!< threshold for starting one-touch rotation gesture in pixels; 6 by default
Standard_ShortReal myTouchZRotationThreshold; //!< threshold for starting two-touch Z-rotation gesture in radians; 2 degrees by default
Standard_ShortReal myTouchPanThresholdPx; //!< threshold for starting two-touch panning gesture in pixels; 4 by default
Standard_ShortReal myTouchZoomThresholdPx; //!< threshold for starting two-touch zoom (pitch) gesture in pixels; 6 by default
Standard_ShortReal myTouchZoomRatio; //!< distance ratio for mapping two-touch zoom (pitch) gesture from pixels to zoom; 0.13 by default
Aspect_TouchMap myTouchPoints; //!< map of active touches
Graphic3d_Vec2d myStartPanCoord; //!< touch coordinates at the moment of starting panning gesture
Graphic3d_Vec2d myStartRotCoord; //!< touch coordinates at the moment of starting rotating gesture
Standard_Integer myNbTouchesLast; //!< number of touches within previous gesture flush to track gesture changes
Standard_Boolean myUpdateStartPointPan; //!< flag indicating that new anchor point should be picked for starting panning gesture
Standard_Boolean myUpdateStartPointRot; //!< flag indicating that new gravity point should be picked for starting rotation gesture
Standard_Boolean myUpdateStartPointZRot; //!< flag indicating that new gravity point should be picked for starting Z-rotation gesture
protected: //! @name rotation/panning transient state variables
Handle(AIS_Point) myAnchorPointPrs1; //!< anchor point presentation (Graphic3d_ZLayerId_Top)
Handle(AIS_Point) myAnchorPointPrs2; //!< anchor point presentation (Graphic3d_ZLayerId_Topmost)
gp_Pnt myPanPnt3d; //!< active panning anchor point
gp_Pnt myRotatePnt3d; //!< active rotation center of gravity
gp_Dir myCamStartOpUp; //!< camera Up direction at the beginning of rotation
gp_Dir myCamStartOpDir; //!< camera View direction at the beginning of rotation
gp_Pnt myCamStartOpEye; //!< camera Eye position at the beginning of rotation
gp_Pnt myCamStartOpCenter; //!< camera Center position at the beginning of rotation
gp_Vec myCamStartOpToCenter; //!< vector from rotation gravity point to camera Center at the beginning of rotation
gp_Vec myCamStartOpToEye; //!< vector from rotation gravity point to camera Eye at the beginning of rotation
Graphic3d_Vec3d myRotateStartYawPitchRoll; //!< camera yaw pitch roll at the beginning of rotation
};
#endif // _AIS_ViewController_HeaderFile

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,153 @@
// Copyright (c) 2016-2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_ViewInputBuffer_HeaderFile
#define _AIS_ViewInputBuffer_HeaderFile
#include <Aspect_ScrollDelta.hxx>
#include <Graphic3d_Vec2.hxx>
#include <NCollection_Sequence.hxx>
#include <V3d_TypeOfOrientation.hxx>
//! Selection mode
enum AIS_ViewSelectionTool
{
AIS_ViewSelectionTool_Picking, //!< pick to select
AIS_ViewSelectionTool_RubberBand, //!< rubber-band to select
AIS_ViewSelectionTool_Polygon //!< polyline to select
};
//! Input buffer type.
enum AIS_ViewInputBufferType
{
AIS_ViewInputBufferType_UI, //!< input buffer for filling from UI thread
AIS_ViewInputBufferType_GL, //!< input buffer accessible from GL thread
};
//! Auxiliary structure defining viewer events
class AIS_ViewInputBuffer
{
public:
bool IsNewGesture; //!< transition from one action to another
NCollection_Sequence<Aspect_ScrollDelta> ZoomActions; //!< the queue with zoom actions
struct _orientation
{
bool ToFitAll; //!< perform FitAll operation
bool ToSetViewOrient; //!< set new view orientation
V3d_TypeOfOrientation ViewOrient; //!< new view orientation
_orientation() : ToFitAll (false), ToSetViewOrient (false), ViewOrient (V3d_Xpos) {}
} Orientation;
struct _highlighting
{
bool ToHilight; //!< perform dynamic highlighting at specified point
Graphic3d_Vec2i Point; //!< the new point for dynamic highlighting
_highlighting() : ToHilight (false) {}
} MoveTo;
struct _selection
{
AIS_ViewSelectionTool Tool; //!< perform selection
bool IsXOR; //!< perform shift selection
NCollection_Sequence<Graphic3d_Vec2i>
Points; //!< the points for selection
bool ToApplyTool; //!< apply rubber-band selection tool
_selection() : Tool (AIS_ViewSelectionTool_Picking), IsXOR (false), ToApplyTool (false) {}
} Selection;
struct _panningParams
{
bool ToStart; //!< start panning
Graphic3d_Vec2i PointStart; //!< panning start point
bool ToPan; //!< perform panning
Graphic3d_Vec2i Delta; //!< panning delta
_panningParams() : ToStart (false), ToPan (false) {}
} Panning;
struct _draggingParams
{
bool ToStart; //!< start dragging
bool ToStop; //!< stop dragging
bool ToAbort; //!< abort dragging (restore previous position)
Graphic3d_Vec2i PointStart; //!< drag start point
Graphic3d_Vec2i PointTo; //!< drag end point
_draggingParams() : ToStart (false), ToStop (false), ToAbort (false) {}
} Dragging;
struct _orbitRotation
{
bool ToStart; //!< start orbit rotation
Graphic3d_Vec2d PointStart; //!< orbit rotation start point
bool ToRotate; //!< perform orbit rotation
Graphic3d_Vec2d PointTo; //!< orbit rotation end point
_orbitRotation() : ToStart (false), ToRotate (false) {}
} OrbitRotation;
struct _viewRotation
{
bool ToStart; //!< start view rotation
Graphic3d_Vec2d PointStart; //!< view rotation start point
bool ToRotate; //!< perform view rotation
Graphic3d_Vec2d PointTo; //!< view rotation end point
_viewRotation() : ToStart (false), ToRotate (false) {}
} ViewRotation;
struct _zrotateParams
{
Graphic3d_Vec2i Point; //!< Z rotation start point
double Angle; //!< Z rotation angle
bool ToRotate; //!< start Z rotation
_zrotateParams() : Angle (0.0), ToRotate (false) {}
} ZRotate;
public:
AIS_ViewInputBuffer()
: IsNewGesture (false) {}
//! Reset events buffer.
void Reset()
{
Orientation.ToFitAll = false;
Orientation.ToSetViewOrient = false;
MoveTo.ToHilight = false;
Selection.ToApplyTool = false;
IsNewGesture = false;
ZoomActions.Clear();
Panning.ToStart = false;
Panning.ToPan = false;
Dragging.ToStart = false;
Dragging.ToStop = false;
Dragging.ToAbort = false;
OrbitRotation.ToStart = false;
OrbitRotation.ToRotate = false;
ViewRotation.ToStart = false;
ViewRotation.ToRotate = false;
ZRotate.ToRotate = false;
}
};
#endif // _AIS_ViewInputBuffer_HeaderFile

115
src/AIS/AIS_WalkDelta.hxx Normal file
View File

@@ -0,0 +1,115 @@
// Copyright (c) 2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_WalkDelta_HeaderFile
#define _AIS_WalkDelta_HeaderFile
#include <Standard_Real.hxx>
//! Walking translation components.
enum AIS_WalkTranslation
{
AIS_WalkTranslation_Forward = 0, //!< translation delta, Forward walk
AIS_WalkTranslation_Side, //!< translation delta, Side walk
AIS_WalkTranslation_Up, //!< translation delta, Up walk
};
//! Walking rotation components.
enum AIS_WalkRotation
{
AIS_WalkRotation_Yaw = 0, //!< yaw rotation angle
AIS_WalkRotation_Pitch, //!< pitch rotation angle
AIS_WalkRotation_Roll, //!< roll rotation angle
};
//! Walking value.
struct AIS_WalkPart
{
Standard_Real Value; //!< value
Standard_Real Pressure; //!< key pressure
Standard_Real Duration; //!< duration
//! Return TRUE if delta is empty.
bool IsEmpty() const { return Abs (Value) <= RealSmall(); }
//! Empty constructor.
AIS_WalkPart() : Value (0.0), Pressure (1.0), Duration (0.0) {}
};
//! Walking values.
struct AIS_WalkDelta
{
//! Empty constructor.
AIS_WalkDelta()
: myIsJumping (false), myIsCrouching (false), myIsRunning (false) {}
//! Return translation component.
const AIS_WalkPart& operator[] (AIS_WalkTranslation thePart) const { return myTranslation[thePart]; }
//! Return translation component.
AIS_WalkPart& operator[] (AIS_WalkTranslation thePart) { return myTranslation[thePart]; }
//! Return rotation component.
const AIS_WalkPart& operator[] (AIS_WalkRotation thePart) const { return myRotation[thePart]; }
//! Return rotation component.
AIS_WalkPart& operator[] (AIS_WalkRotation thePart) { return myRotation[thePart]; }
//! Return jumping state.
bool IsJumping() const { return myIsJumping; }
//! Set jumping state.
void SetJumping (bool theIsJumping) { myIsJumping = theIsJumping; }
//! Return crouching state.
bool IsCrouching() const { return myIsCrouching; }
//! Set crouching state.
void SetCrouching (bool theIsCrouching) { myIsCrouching = theIsCrouching; }
//! Return running state.
bool IsRunning() const { return myIsRunning; }
//! Set running state.
void SetRunning (bool theIsRunning) { myIsRunning = theIsRunning; }
//! Return TRUE when both Rotation and Translation deltas are empty.
bool IsEmpty() const { return !ToMove() && !ToRotate(); }
//! Return TRUE if translation delta is defined.
bool ToMove() const
{
return !myTranslation[AIS_WalkTranslation_Forward].IsEmpty()
|| !myTranslation[AIS_WalkTranslation_Side].IsEmpty()
|| !myTranslation[AIS_WalkTranslation_Up].IsEmpty();
}
//! Return TRUE if rotation delta is defined.
bool ToRotate() const
{
return !myRotation[AIS_WalkRotation_Yaw].IsEmpty()
|| !myRotation[AIS_WalkRotation_Pitch].IsEmpty()
|| !myRotation[AIS_WalkRotation_Roll].IsEmpty();
}
private:
AIS_WalkPart myTranslation[3];
AIS_WalkPart myRotation[3];
bool myIsJumping;
bool myIsCrouching;
bool myIsRunning;
};
#endif // _AIS_WalkDelta_HeaderFile

View File

@@ -56,6 +56,7 @@ AIS_DimensionSelectionMode.hxx
AIS_DisplayMode.hxx
AIS_DisplaySpecialSymbol.hxx
AIS_DisplayStatus.hxx
AIS_DragAction.hxx
AIS_EllipseRadiusDimension.cxx
AIS_EllipseRadiusDimension.hxx
AIS_EqualDistanceRelation.cxx
@@ -106,6 +107,7 @@ AIS_MaxRadiusDimension.cxx
AIS_MaxRadiusDimension.hxx
AIS_MediaPlayer.cxx
AIS_MediaPlayer.hxx
AIS_MouseGesture.hxx
AIS_MidPointRelation.cxx
AIS_MidPointRelation.hxx
AIS_MidPointRelation.lxx
@@ -114,6 +116,7 @@ AIS_MinRadiusDimension.hxx
AIS_MultipleConnectedInteractive.cxx
AIS_MultipleConnectedInteractive.hxx
AIS_MultipleConnectedInteractive.lxx
AIS_NavigationMode.hxx
AIS_NListOfEntityOwner.hxx
AIS_OffsetDimension.cxx
AIS_OffsetDimension.hxx
@@ -135,14 +138,13 @@ AIS_RadiusDimension.cxx
AIS_RadiusDimension.hxx
AIS_Relation.cxx
AIS_Relation.hxx
AIS_RotationMode.hxx
AIS_RubberBand.hxx
AIS_RubberBand.cxx
AIS_Selection.cxx
AIS_Selection.hxx
AIS_SelectStatus.hxx
AIS_SelectionModesConcurrency.hxx
AIS_SelectionScheme.hxx
AIS_SelectionType.hxx
AIS_SequenceOfDimension.hxx
AIS_SequenceOfInteractive.hxx
AIS_Shape.cxx
@@ -177,5 +179,9 @@ AIS_TypeOfAxis.hxx
AIS_TypeOfDist.hxx
AIS_TypeOfIso.hxx
AIS_TypeOfPlane.hxx
AIS_ViewCube.hxx
AIS_ViewController.cxx
AIS_ViewController.hxx
AIS_ViewInputBuffer.hxx
AIS_ViewCube.cxx
AIS_ViewCube.hxx
AIS_WalkDelta.hxx

View File

@@ -1054,44 +1054,44 @@ Standard_Real
void AdvApp2Var_ApproxAFunc2Var::Dump(Standard_OStream& o) const
{
Standard_Integer iesp=1,NbKU,NbKV,ik;
o<<endl;
if (!myHasResult) { o<<"No result"<<endl; }
o<<std::endl;
if (!myHasResult) { o<<"No result"<<std::endl; }
else {
o<<"There is a result";
if (myDone) {
o<<" within the requested tolerance "<<my3DTolerances->Value(iesp)<<endl;
o<<" within the requested tolerance "<<my3DTolerances->Value(iesp)<<std::endl;
}
else if (my3DMaxError->Value(iesp)>my3DTolerances->Value(iesp)) {
o<<" WITHOUT the requested tolerance "<<my3DTolerances->Value(iesp)<<endl;
o<<" WITHOUT the requested tolerance "<<my3DTolerances->Value(iesp)<<std::endl;
}
else {
o<<" WITHOUT the requested continuities "<<endl;
o<<" WITHOUT the requested continuities "<<std::endl;
}
o<<endl;
o<<"Result max error :"<<my3DMaxError->Value(iesp)<<endl;
o<<"Result average error :"<<my3DAverageError->Value(iesp)<<endl;
o<<"Result max error on U frontiers :"<<my3DUFrontError->Value(iesp)<<endl;
o<<"Result max error on V frontiers :"<<my3DVFrontError->Value(iesp)<<endl;
o<<endl;
o<<std::endl;
o<<"Result max error :"<<my3DMaxError->Value(iesp)<<std::endl;
o<<"Result average error :"<<my3DAverageError->Value(iesp)<<std::endl;
o<<"Result max error on U frontiers :"<<my3DUFrontError->Value(iesp)<<std::endl;
o<<"Result max error on V frontiers :"<<my3DVFrontError->Value(iesp)<<std::endl;
o<<std::endl;
o<<"Degree of Bezier patches in U : "<<myDegreeInU
<<" in V : "<<myDegreeInV<<endl;
o<<endl;
<<" in V : "<<myDegreeInV<<std::endl;
o<<std::endl;
Handle(Geom_BSplineSurface) S
= Handle(Geom_BSplineSurface)::DownCast(mySurfaces->Value(iesp));
o<<"Number of poles in U : "<<S->NbUPoles()
<<" in V : "<<S->NbVPoles()<<endl;
o<<endl;
<<" in V : "<<S->NbVPoles()<<std::endl;
o<<std::endl;
NbKU = S->NbUKnots();
NbKV = S->NbVKnots();
o<<"Number of knots in U : "<<NbKU<<endl;
o<<"Number of knots in U : "<<NbKU<<std::endl;
for (ik=1;ik<=NbKU;ik++) {
o<<" "<<ik<<" : "<<S->UKnot(ik)<<" mult : "<<S->UMultiplicity(ik)<<endl;
o<<" "<<ik<<" : "<<S->UKnot(ik)<<" mult : "<<S->UMultiplicity(ik)<<std::endl;
}
o<<endl;
o<<"Number of knots in V : "<<NbKV<<endl;
o<<std::endl;
o<<"Number of knots in V : "<<NbKV<<std::endl;
for (ik=1;ik<=NbKV;ik++) {
o<<" "<<ik<<" : "<<S->VKnot(ik)<<" mult : "<<S->VMultiplicity(ik)<<endl;
o<<" "<<ik<<" : "<<S->VKnot(ik)<<" mult : "<<S->VMultiplicity(ik)<<std::endl;
}
o<<endl;
o<<std::endl;
}
}

View File

@@ -46,7 +46,7 @@ static Standard_Boolean lesparam(const Standard_Integer iordre,
else {
nbpnts = 50;
#ifdef OCCT_DEBUG
cout << "F(U, V) : Not enough points of discretization" << endl;
std::cout << "F(U, V) : Not enough points of discretization" << std::endl;
#endif
}

View File

@@ -89,10 +89,10 @@ static void MAPDBN(const Standard_Integer dimension,
if ( (Diff-Der).Norm() > eps * (Der.Norm()+1) ) {
cout << " Debug Ft au parametre t+ = " << t << endl;
cout << " Positionement sur la derive "<< OrdreDer
<< " : " << Der << endl;
cout << " Erreur estime : " << (Der-Diff) << endl;
std::cout << " Debug Ft au parametre t+ = " << t << std::endl;
std::cout << " Positionement sur la derive "<< OrdreDer
<< " : " << Der << std::endl;
std::cout << " Erreur estime : " << (Der-Diff) << std::endl;
}
// Verif a la fin
@@ -112,10 +112,10 @@ static void MAPDBN(const Standard_Integer dimension,
if ( (Diff-Der).Norm() > eps * (Der.Norm()+1) ) {
cout << " Debug Ft au parametre t- = " << t << endl;
cout << " Positionement sur la derive "<< OrdreDer
<< " : " << Der << endl;
cout << " Erreur estime : " << (Der-Diff) << endl;
std::cout << " Debug Ft au parametre t- = " << t << std::endl;
std::cout << " Positionement sur la derive "<< OrdreDer
<< " : " << Der << std::endl;
std::cout << " Erreur estime : " << (Der-Diff) << std::endl;
}
}
}
@@ -1092,25 +1092,25 @@ Standard_Real AdvApprox_ApproxAFunction::AverageError(
void AdvApprox_ApproxAFunction::Dump(Standard_OStream& o) const
{
Standard_Integer ii;
o << "Dump of ApproxAFunction" << endl;
o << "Dump of ApproxAFunction" << std::endl;
if (myNumSubSpaces[0] > 0) {
o << "Error(s) 1d = " << endl;
o << "Error(s) 1d = " << std::endl;
for (ii=1; ii <= myNumSubSpaces[0]; ii++) {
o << " " << MaxError(1, ii) << endl;
o << " " << MaxError(1, ii) << std::endl;
}
}
if (myNumSubSpaces[1] > 0) {
o << "Error(s) 2d = " << endl;
o << "Error(s) 2d = " << std::endl;
for (ii=1; ii <= myNumSubSpaces[1]; ii++) {
o << " " << MaxError(2, ii) << endl;
o << " " << MaxError(2, ii) << std::endl;
}
}
if (myNumSubSpaces[2] > 0) {
o << "Error(s) 3d = " << endl;
o << "Error(s) 3d = " << std::endl;
for (ii=1; ii <= myNumSubSpaces[2]; ii++) {
o << " " << MaxError(3, ii) << endl;
o << " " << MaxError(3, ii) << std::endl;
}
}
}

View File

@@ -232,7 +232,7 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi
}
}
// for (i=0; i<(WorkDegree+1)*TotalDimension; i++)
// cout << " Coeff(" << i << ") = " << Coeff(i) << endl;
// std::cout << " Coeff(" << i << ") = " << Coeff(i) << std::endl;
// the computing of NewDegree
TColStd_Array1OfReal JacCoeff(0, myTotalDimension*(myWorkDegree+1)-1);
@@ -380,9 +380,9 @@ Standard_Real AdvApprox_SimpleApprox::AverageError(const Standard_Integer Index)
void AdvApprox_SimpleApprox::Dump(Standard_OStream& o) const
{
Standard_Integer ii;
o << "Dump of SimpleApprox " << endl;
o << "Dump of SimpleApprox " << std::endl;
for (ii=1; ii <= myTotalNumSS; ii++) {
o << "Error " << MaxError(ii) << endl;
o << "Error " << MaxError(ii) << std::endl;
}
}

View File

@@ -391,8 +391,8 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
mytol2d = Max(TheTol2d, mytol2d);
}
#ifdef OCCT_DEBUG
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
std::cout << " Tolerances obtenues --> 3d : "<< mytol3d << std::endl;
std::cout << " --> 2d : "<< mytol2d << std::endl;
#endif
multC = theapprox.SplineValue();
}
@@ -436,8 +436,8 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
theapprox.Perform(multL);
theapprox.Error(mytol3d,mytol2d);
#ifdef OCCT_DEBUG
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
std::cout << " Tolerances obtenues --> 3d : "<< mytol3d << std::endl;
std::cout << " --> 2d : "<< mytol2d << std::endl;
#endif
tol3dreached = mytol3d;
tol2dreached = mytol2d;
@@ -498,8 +498,8 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin,
mytol3d = Variation.MaxError();
mytol2d = 0.;
#ifdef OCCT_DEBUG
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
std::cout << " Tolerances obtenues --> 3d : "<< mytol3d << std::endl;
std::cout << " --> 2d : "<< mytol2d << std::endl;
#endif
tol3dreached = mytol3d;
tol2dreached = mytol2d;
@@ -827,8 +827,8 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
// modified by EAP Thu Jan 3 15:45:27 2002 ___END___
}
#ifdef OCCT_DEBUG
cout << " Tolerances obtenues --> 3d : "<< mytol3d << endl;
cout << " --> 2d : "<< mytol2d << endl;
std::cout << " Tolerances obtenues --> 3d : "<< mytol3d << std::endl;
std::cout << " --> 2d : "<< mytol2d << std::endl;
#endif
tol3dreached = mytol3d;
tol2dreached = mytol2d;
@@ -852,8 +852,8 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin,
tabVKnots->ChangeArray1()
);
#ifdef OCCT_DEBUG
cout << "Warning: AppBlend_AppSurf::Perform(), bad length of aParamSeq: " <<
aParamSeq.Length() << " instead of " << tabVKnots->Length() << endl;
std::cout << "Warning: AppBlend_AppSurf::Perform(), bad length of aParamSeq: " <<
aParamSeq.Length() << " instead of " << tabVKnots->Length() << std::endl;
#endif
}
else

View File

@@ -97,8 +97,8 @@ AppDef_MultiPointConstraint AppDef_MultiLine::Value (const Standard_Integer Inde
void AppDef_MultiLine::Dump(Standard_OStream& o) const
{
o << "AppDef_MultiLine dump:" << endl;
o << "AppDef_MultiLine dump:" << std::endl;
// AppDef_MultiPointConstraint MP = tabMult->Value(1);
o << "It contains " << tabMult->Length() << " MultiPointConstraint"<< endl;
// o << MP->NbPoints() << " 3d and " << MP->NbPoints2d() << endl;
o << "It contains " << tabMult->Length() << " MultiPointConstraint"<< std::endl;
// o << MP->NbPoints() << " 3d and " << MP->NbPoints2d() << std::endl;
}

View File

@@ -319,5 +319,5 @@ Standard_Boolean AppDef_MultiPointConstraint::IsCurvaturePoint() const
void AppDef_MultiPointConstraint::Dump(Standard_OStream& o) const
{
o << "AppDef_MultiPointConstraint dump:" << endl;
o << "AppDef_MultiPointConstraint dump:" << std::endl;
}

View File

@@ -582,11 +582,11 @@ void AppDef_Variational::Approximate()
{
for (jp3d=1;jp3d<=myNbP3d;jp3d++)
{
// cout << "\n Poles(ipole,1)" << PolesPtr->Value(ipole,index);
// std::cout << "\n Poles(ipole,1)" << PolesPtr->Value(ipole,index);
P3d.SetX(PolesPtr->Value(ipole,index++));
// cout << "\n Poles(ipole,1)" << PolesPtr->Value(ipole,index);
// std::cout << "\n Poles(ipole,1)" << PolesPtr->Value(ipole,index);
P3d.SetY(PolesPtr->Value(ipole,index++));
// cout << "\n Poles(ipole,1)" << PolesPtr->Value(ipole,index);
// std::cout << "\n Poles(ipole,1)" << PolesPtr->Value(ipole,index);
P3d.SetZ(PolesPtr->Value(ipole,index++));
TabP3d.SetValue(jp3d,P3d);
}
@@ -897,32 +897,32 @@ Standard_Integer AppDef_Variational::NbIterations() const
//
void AppDef_Variational::Dump(Standard_OStream& o) const
{
o << " \nVariational Smoothing " << endl;
o << " Number of multipoints " << myNbPoints << endl;
o << " Number of 2d par multipoint " << myNbP2d << endl;
o << " Nombre of 3d par multipoint " << myNbP3d << endl;
o << " Number of PassagePoint " << myNbPassPoints << endl;
o << " Number of TangencyPoints " << myNbTangPoints << endl;
o << " Number of CurvaturePoints " << myNbCurvPoints << endl;
o << " \nTolerance " << o.setf(ios::scientific) << setprecision(3) << setw(9) << myTolerance;
if ( WithMinMax()) { o << " as Max Error." << endl;}
else { o << " as size Error." << endl;}
o << " \nVariational Smoothing " << std::endl;
o << " Number of multipoints " << myNbPoints << std::endl;
o << " Number of 2d par multipoint " << myNbP2d << std::endl;
o << " Nombre of 3d par multipoint " << myNbP3d << std::endl;
o << " Number of PassagePoint " << myNbPassPoints << std::endl;
o << " Number of TangencyPoints " << myNbTangPoints << std::endl;
o << " Number of CurvaturePoints " << myNbCurvPoints << std::endl;
o << " \nTolerance " << o.setf(std::ios::scientific) << std::setprecision(3) << std::setw(9) << myTolerance;
if ( WithMinMax()) { o << " as Max Error." << std::endl;}
else { o << " as size Error." << std::endl;}
o << "CriteriumWeights : " << myPercent[0] << " , "
<< myPercent[1] << " , " << myPercent[2] << endl;
<< myPercent[1] << " , " << myPercent[2] << std::endl;
if (myIsDone ) {
o << " MaxError " << setprecision(3) << setw(9) << myMaxError << endl;
o << " Index of MaxError " << myMaxErrorIndex << endl;
o << " Average Error " << setprecision(3) << setw(9) << myAverageError << endl;
o << " Quadratic Error " << setprecision(3) << setw(9) << myCriterium[0] << endl;
o << " Tension Criterium " << setprecision(3) << setw(9) << myCriterium[1] << endl;
o << " Flexion Criterium " << setprecision(3) << setw(9) << myCriterium[2] << endl;
o << " Jerk Criterium " << setprecision(3) << setw(9) << myCriterium[3] << endl;
o << " NbSegments " << myKnots->Length()-1 << endl;
o << " MaxError " << std::setprecision(3) << std::setw(9) << myMaxError << std::endl;
o << " Index of MaxError " << myMaxErrorIndex << std::endl;
o << " Average Error " << std::setprecision(3) << std::setw(9) << myAverageError << std::endl;
o << " Quadratic Error " << std::setprecision(3) << std::setw(9) << myCriterium[0] << std::endl;
o << " Tension Criterium " << std::setprecision(3) << std::setw(9) << myCriterium[1] << std::endl;
o << " Flexion Criterium " << std::setprecision(3) << std::setw(9) << myCriterium[2] << std::endl;
o << " Jerk Criterium " << std::setprecision(3) << std::setw(9) << myCriterium[3] << std::endl;
o << " NbSegments " << myKnots->Length()-1 << std::endl;
}
else
{ if (myIsOverConstr) o << "The probleme is overconstraint " << endl;
else o << " Erreur dans l''approximation" << endl;
{ if (myIsOverConstr) o << "The probleme is overconstraint " << std::endl;
else o << " Erreur dans l''approximation" << std::endl;
}
}
//
@@ -2539,7 +2539,7 @@ void AppDef_Variational::Adjusting(
TColStd_Array1OfReal& Ecarts)
{
// cout << "=========== Adjusting =============" << endl;
// std::cout << "=========== Adjusting =============" << std::endl;
/* Initialized data */

View File

@@ -286,24 +286,24 @@ void AppParCurves_MultiBSpCurve::D2 (const Standard_Integer CuIndex,
void AppParCurves_MultiBSpCurve::Dump(Standard_OStream& o) const
{
o << "AppParCurves_MultiBSpCurve dump:" << endl;
o << " It contains " << NbCurves() << " BSpline curves "<< endl;
o << " The poles are: " << endl;
o << "AppParCurves_MultiBSpCurve dump:" << std::endl;
o << " It contains " << NbCurves() << " BSpline curves "<< std::endl;
o << " The poles are: " << std::endl;
/* for (Standard_Integer i = 1; i <= NbCurves(); i++) {
o << " Curve No. " << i << endl;
o << " Curve No. " << i << std::endl;
if (Dimension(i) == 3) {
for (Standard_Integer j = 1; j <= tabPoint->Length(); j++) {
o << " Pole No. " << j << ": " << endl;
o << " Pole x = " << (tabPoint->Value(j)->Point(i)).X() << endl;
o << " Pole y = " << (tabPoint->Value(j)->Point(i)).Y() << endl;
o << " Pole z = " << (tabPoint->Value(j)->Point(i)).Z() << endl;
o << " Pole No. " << j << ": " << std::endl;
o << " Pole x = " << (tabPoint->Value(j)->Point(i)).X() << std::endl;
o << " Pole y = " << (tabPoint->Value(j)->Point(i)).Y() << std::endl;
o << " Pole z = " << (tabPoint->Value(j)->Point(i)).Z() << std::endl;
}
}
else {
for (Standard_Integer j = 1; j <= tabPoint->Length(); j++) {
o << " Pole No. " << j << ": " << endl;
o << " Pole x = " << (tabPoint->Value(j)->Point2d(i)).X() << endl;
o << " Pole y = " << (tabPoint->Value(j)->Point2d(i)).Y() << endl;
o << " Pole No. " << j << ": " << std::endl;
o << " Pole x = " << (tabPoint->Value(j)->Point2d(i)).X() << std::endl;
o << " Pole y = " << (tabPoint->Value(j)->Point2d(i)).Y() << std::endl;
}
}
}

View File

@@ -286,24 +286,24 @@ void AppParCurves_MultiCurve::D2 (const Standard_Integer CuIndex,
void AppParCurves_MultiCurve::Dump(Standard_OStream& o) const
{
o << "AppParCurves_MultiCurve dump:" << endl;
o << " It contains " << NbCurves() << " Bezier curves of degree " << tabPoint->Length()-1 << endl;
o << " The poles are: " << endl;
o << "AppParCurves_MultiCurve dump:" << std::endl;
o << " It contains " << NbCurves() << " Bezier curves of degree " << tabPoint->Length()-1 << std::endl;
o << " The poles are: " << std::endl;
/* for (Standard_Integer i = 1; i <= NbCurves(); i++) {
o << " Curve No. " << i << endl;
o << " Curve No. " << i << std::endl;
if (Dimension(i) == 3) {
for (Standard_Integer j = 1; j <= tabPoint->Length(); j++) {
o << " Pole No. " << j << ": " << endl;
o << " Pole x = " << (tabPoint->Value(j)->Point(i)).X() << endl;
o << " Pole y = " << (tabPoint->Value(j)->Point(i)).Y() << endl;
o << " Pole z = " << (tabPoint->Value(j)->Point(i)).Z() << endl;
o << " Pole No. " << j << ": " << std::endl;
o << " Pole x = " << (tabPoint->Value(j)->Point(i)).X() << std::endl;
o << " Pole y = " << (tabPoint->Value(j)->Point(i)).Y() << std::endl;
o << " Pole z = " << (tabPoint->Value(j)->Point(i)).Z() << std::endl;
}
}
else {
for (Standard_Integer j = 1; j <= tabPoint->Length(); j++) {
o << " Pole No. " << j << ": " << endl;
o << " Pole x = " << (tabPoint->Value(j)->Point2d(i)).X() << endl;
o << " Pole y = " << (tabPoint->Value(j)->Point2d(i)).Y() << endl;
o << " Pole No. " << j << ": " << std::endl;
o << " Pole x = " << (tabPoint->Value(j)->Point2d(i)).X() << std::endl;
o << " Pole y = " << (tabPoint->Value(j)->Point2d(i)).Y() << std::endl;
}
}
}

View File

@@ -169,20 +169,20 @@ const gp_Pnt2d& AppParCurves_MultiPoint::Point2d (const Standard_Integer Index)
void AppParCurves_MultiPoint::Dump(Standard_OStream& o) const
{
o << "AppParCurves_MultiPoint dump:" << endl;
o << "AppParCurves_MultiPoint dump:" << std::endl;
const Standard_Integer aNbPnts3D = NbPoints(),
aNbPnts2D = NbPoints2d();
o << "It contains " << aNbPnts3D << " 3d points and " << aNbPnts2D <<" 2d points." << endl;
o << "It contains " << aNbPnts3D << " 3d points and " << aNbPnts2D <<" 2d points." << std::endl;
if(aNbPnts3D > 0)
{
for(Standard_Integer i = tabPoint->Lower(); i <= tabPoint->Upper(); i++)
{
o << "3D-Point #" << i << endl;
o << "3D-Point #" << i << std::endl;
o << " Pole x = " << (tabPoint->Value(i)/*->Point(j)*/).X() << endl;
o << " Pole y = " << (tabPoint->Value(i)/*->Point(j)*/).Y() << endl;
o << " Pole z = " << (tabPoint->Value(i)/*->Point(j)*/).Z() << endl;
o << " Pole x = " << (tabPoint->Value(i)/*->Point(j)*/).X() << std::endl;
o << " Pole y = " << (tabPoint->Value(i)/*->Point(j)*/).Y() << std::endl;
o << " Pole z = " << (tabPoint->Value(i)/*->Point(j)*/).Z() << std::endl;
}
}
@@ -190,10 +190,10 @@ void AppParCurves_MultiPoint::Dump(Standard_OStream& o) const
{
for(Standard_Integer i = tabPoint2d->Lower(); i <= tabPoint2d->Upper(); i++)
{
o << "2D-Point #" << i << endl;
o << "2D-Point #" << i << std::endl;
o << " Pole x = " << (tabPoint2d->Value(i)/*->Point2d(j)*/).X() << endl;
o << " Pole y = " << (tabPoint2d->Value(i)/*->Point2d(j)*/).Y() << endl;
o << " Pole x = " << (tabPoint2d->Value(i)/*->Point2d(j)*/).X() << std::endl;
o << " Pole y = " << (tabPoint2d->Value(i)/*->Point2d(j)*/).Y() << std::endl;
}
}
}

View File

@@ -64,20 +64,20 @@ static void DUMP(const MultiLine& Line)
TColgp_Array1OfPnt tabP(1, mynbP3d);
TColgp_Array1OfPnt2d tabP2d(1, mynbP2d);
cout <<"DUMP de la MultiLine entre "<<firstP <<" et "<<lastP<<": "<<endl;
std::cout <<"DUMP de la MultiLine entre "<<firstP <<" et "<<lastP<<": "<<std::endl;
for (i = firstP; i <= lastP; i++) {
if (nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i, tabP, tabP2d);
else if (nbP2d != 0) LineTool::Value(Line, i, tabP2d);
else if (nbP3d != 0) LineTool::Value(Line, i, tabP);
cout << "point "<<i<<":"<< endl;
std::cout << "point "<<i<<":"<< std::endl;
for (j = 1; j <= nbP3d; j++) {
P1 = tabP(j);
cout <<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<endl;
std::cout <<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<std::endl;
}
for (j = 1; j <= nbP2d; j++) {
P12d = tabP2d(j);
cout <<P12d.X()<<" "<<P12d.Y()<<endl;
std::cout <<P12d.X()<<" "<<P12d.Y()<<std::endl;
}
}
@@ -197,7 +197,7 @@ static Standard_Boolean CheckMultiCurve(const AppParCurves_MultiCurve& theMultiC
if (ScalProd < MinScalProd)
{
#ifdef DRAW
cout<<"ScalProd("<<indp-2<<","<<indp-1<<")-("<<indp-1<<","<<indp<<") = "<<ScalProd<<endl;
std::cout<<"ScalProd("<<indp-2<<","<<indp-1<<")-("<<indp-1<<","<<indp<<") = "<<ScalProd<<std::endl;
#endif
LoopFound = Standard_True;
break;
@@ -329,7 +329,7 @@ static Standard_Boolean CheckMultiCurve(const AppParCurves_MultiCurve& theMultiC
if (ScalProd < MinScalProd)
{
#ifdef DRAW
cout<<"ScalProd("<<k-2<<","<<k-1<<")-("<<k-1<<","<<k<<") = "<<ScalProd<<endl;
std::cout<<"ScalProd("<<k-2<<","<<k-1<<")-("<<k-1<<","<<k<<") = "<<ScalProd<<std::endl;
#endif
LoopFound = Standard_True;
break;
@@ -1486,7 +1486,7 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
#ifdef OCCT_DEBUG
if (!Parallel) {
if (mydebug) cout <<"droite mais tangentes pas vraiment paralleles!!"<< endl;
if (mydebug) std::cout <<"droite mais tangentes pas vraiment paralleles!!"<< std::endl;
}
#endif
AppParCurves_MultiCurve mySCU(mydegremin+1);

View File

@@ -174,8 +174,8 @@ Approx_Curve3d::Approx_Curve3d(const Handle(Adaptor3d_HCurve)& Curve,
void Approx_Curve3d::Dump(Standard_OStream& o) const
{
o << "******* Dump of ApproxCurve *******" << endl;
o << "*******Degree " << Curve()->Degree() << endl;
o << "*******NbSegments " << Curve()->NbKnots() - 1 << endl;
o << "*******Error " << MaxError() << endl;
o << "******* Dump of ApproxCurve *******" << std::endl;
o << "*******Degree " << Curve()->Degree() << std::endl;
o << "*******NbSegments " << Curve()->NbKnots() - 1 << std::endl;
o << "*******Error " << MaxError() << std::endl;
}

View File

@@ -197,11 +197,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
#ifdef OCCT_DEBUG_CHRONO
ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl;
cout<<"initialization time = "<<t_init<<endl;
cout<<"approximation time = "<<t_approx<<endl;
cout<<"total time for uparam computation = "<<t_uparam<<endl;
cout<<"number uparam calles = "<<uparam_count<<endl;
std::cout<<" total reparametrization time = "<<t_total<<std::endl;
std::cout<<"initialization time = "<<t_init<<std::endl;
std::cout<<"approximation time = "<<t_approx<<std::endl;
std::cout<<"total time for uparam computation = "<<t_uparam<<std::endl;
std::cout<<"number uparam calles = "<<uparam_count<<std::endl;
#endif
}
@@ -358,11 +358,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
#ifdef OCCT_DEBUG_CHRONO
ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl;
cout<<"initialization time = "<<t_init<<endl;
cout<<"approximation time = "<<t_approx<<endl;
cout<<"total time for uparam computation = "<<t_uparam<<endl;
cout<<"number uparam calles = "<<uparam_count<<endl;
std::cout<<" total reparametrization time = "<<t_total<<std::endl;
std::cout<<"initialization time = "<<t_init<<std::endl;
std::cout<<"approximation time = "<<t_approx<<std::endl;
std::cout<<"total time for uparam computation = "<<t_uparam<<std::endl;
std::cout<<"number uparam calles = "<<uparam_count<<std::endl;
#endif
}
@@ -531,11 +531,11 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
#ifdef OCCT_DEBUG_CHRONO
ResultChron(chr_total, t_total);
cout<<" total reparametrization time = "<<t_total<<endl;
cout<<"initialization time = "<<t_init<<endl;
cout<<"approximation time = "<<t_approx<<endl;
cout<<"total time for uparam computation = "<<t_uparam<<endl;
cout<<"number uparam calles = "<<uparam_count<<endl;
std::cout<<" total reparametrization time = "<<t_total<<std::endl;
std::cout<<"initialization time = "<<t_init<<std::endl;
std::cout<<"approximation time = "<<t_approx<<std::endl;
std::cout<<"total time for uparam computation = "<<t_uparam<<std::endl;
std::cout<<"number uparam calles = "<<uparam_count<<std::endl;
#endif
}
@@ -628,12 +628,12 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
void Approx_CurvilinearParameter::Dump(Standard_OStream& o) const
{
o << "Dump of Approx_CurvilinearParameter" << endl;
o << "Dump of Approx_CurvilinearParameter" << std::endl;
if (myCase==2 || myCase==3)
o << "myMaxError2d1 = " << myMaxError2d1 << endl;
o << "myMaxError2d1 = " << myMaxError2d1 << std::endl;
if (myCase==3)
o << "myMaxError2d2 = " << myMaxError2d2 << endl;
o << "myMaxError3d = " << myMaxError3d << endl;
o << "myMaxError2d2 = " << myMaxError2d2 << std::endl;
o << "myMaxError3d = " << myMaxError3d << std::endl;
}
//=======================================================================
@@ -665,7 +665,7 @@ void Approx_CurvilinearParameter::ToleranceComputation(const Handle(Adaptor2d_HC
TolW = Tol / (4.*Max_dS_dw);
#ifdef OCCT_DEBUG
cout << "TolV = " << TolV << endl;
cout << "TolW = " << TolW << endl;
std::cout << "TolV = " << TolV << std::endl;
std::cout << "TolW = " << TolW << std::endl;
#endif
}

View File

@@ -36,17 +36,17 @@ static void DEBUG(const AppParCurves_MultiCurve& MC) {
TColgp_Array1OfPnt2d Poles2d(1, nbpoles);
for (i = 1; i <= nbcu; i++) {
cout << " Curve No. " << i << endl;
std::cout << " Curve No. " << i << std::endl;
if (MC.Dimension(i) == 3) {
MC.Curve(i, Poles);
for (j = 1; j <= nbpoles; j++) {
cout<< " Pole = " << Poles(j).X() <<" "<<Poles(j).Y()<<" "<<Poles(j).Z()<< endl;
std::cout<< " Pole = " << Poles(j).X() <<" "<<Poles(j).Y()<<" "<<Poles(j).Z()<< std::endl;
}
}
else {
MC.Curve(i, Poles2d);
for (j = 1; j <= nbpoles; j++) {
cout<< " Pole = " << Poles2d(j).X() <<" "<<Poles2d(j).Y()<< endl;
std::cout<< " Pole = " << Poles2d(j).X() <<" "<<Poles2d(j).Y()<< std::endl;
}
}
}

View File

@@ -542,7 +542,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
{
//Projector
#ifdef OCCT_DEBUG
cout << "Projection not done" << endl;
std::cout << "Projection not done" << std::endl;
#endif
}
}
@@ -558,7 +558,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
// If not already SameP and tangent to mill, abandon.
mySameParameter = Standard_False;
#ifdef OCCT_DEBUG
cout<<"SameParameter problem : zero tangent to extremities"<<endl;
std::cout<<"SameParameter problem : zero tangent to extremities"<<std::endl;
#endif
return;
}
@@ -653,7 +653,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
}
else {
#ifdef OCCT_DEBUG
cout << "Projection not done" << endl;
std::cout << "Projection not done" << std::endl;
#endif
}
}
@@ -687,7 +687,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if (Precision::IsInfinite(algtol)) {
mySameParameter = Standard_False;
#ifdef OCCT_DEBUG
cout<<"SameParameter problem : function of interpolation of parametration at mills !!"<<endl;
std::cout<<"SameParameter problem : function of interpolation of parametration at mills !!"<<std::endl;
#endif
return;
}
@@ -778,7 +778,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
}
else {
#ifdef OCCT_DEBUG
cout << "Projection not done" << endl;
std::cout << "Projection not done" << std::endl;
#endif
}
}

View File

@@ -737,19 +737,19 @@ Standard_Real Approx_SweepApproximation::TolCurveOnSurf(const Standard_Integer I
void Approx_SweepApproximation::Dump(Standard_OStream& o) const
{
o << "Dump of SweepApproximation" << endl;
o << "Dump of SweepApproximation" << std::endl;
if (done) {
o << "Error 3d = " << MaxErrorOnSurf() << endl;
o << "Error 3d = " << MaxErrorOnSurf() << std::endl;
if (Num2DSS>0) {
o << "Error 2d = ";
for (Standard_Integer ii=1; ii<=Num2DSS; ii++)
{ o << Max2dError(ii);
if (ii < Num2DSS) o << " , " << endl;
if (ii < Num2DSS) o << " , " << std::endl;
}
cout << endl;
std::cout << std::endl;
}
o << tabVKnots->Length()-1 <<" Segment(s) of degree " << vdeg << endl;
o << tabVKnots->Length()-1 <<" Segment(s) of degree " << vdeg << std::endl;
}
else cout << " Not Done " << endl;
else std::cout << " Not Done " << std::endl;
}

View File

@@ -170,10 +170,10 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
}
#ifdef APPROXINT_KNOTTOOLS_DEBUG
cout << "Discrete curvature array is" << endl;
std::cout << "Discrete curvature array is" << std::endl;
for(i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
{
cout << i << " " << aCurv(i) << endl;
std::cout << i << " " << aCurv(i) << std::endl;
}
#endif
@@ -219,11 +219,11 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
#if defined(APPROXINT_KNOTTOOLS_DEBUG)
{
cout << "Feature indices new: " << endl;
std::cout << "Feature indices new: " << std::endl;
i;
for(i = theInds.Lower(); i <= theInds.Upper(); ++i)
{
cout << i << " : " << theInds(i) << endl;
std::cout << i << " : " << theInds(i) << std::endl;
}
}
#endif
@@ -608,10 +608,10 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
ComputeKnotInds(aCoords, aDim, thePars, aKnots);
#if defined(APPROXINT_KNOTTOOLS_DEBUG)
cout << "Draft knot sequence: " << endl;
std::cout << "Draft knot sequence: " << std::endl;
for(i = aKnots.Lower(); i <= aKnots.Upper(); ++i)
{
cout << i << " : " << aKnots(i) << endl;
std::cout << i << " : " << aKnots(i) << std::endl;
}
#endif
@@ -619,10 +619,10 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
FilterKnots(aKnots, theMinNbPnts, theKnots);
#if defined(APPROXINT_KNOTTOOLS_DEBUG)
cout << "Result knot sequence: " << endl;
std::cout << "Result knot sequence: " << std::endl;
for(i = theKnots.Lower(); i <= theKnots.Upper(); ++i)
{
cout << i << " : " << theKnots(i) << endl;
std::cout << i << " : " << theKnots(i) << std::endl;
}
#endif

View File

@@ -21,7 +21,7 @@
#include <math_FunctionSetRoot.hxx>
#include <Precision.hxx>
#define Debug(expr) cout<<" expr :"<<expr;
#define Debug(expr) std::cout<<" expr :"<<expr;
#define MySurf1 MyIntersectionOn2S.Function().AuxillarSurface1()
#define MySurf2 MyIntersectionOn2S.Function().AuxillarSurface2()

Some files were not shown because too many files have changed in this diff Show More