1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

..

213 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
age
d31fb73a09 0030765: Visualization - Incorrect intersection with Select3D_SensitiveBox when clipping is turned on
SelectMgr_RectangularFrustum::Overlaps method for computing intersection of box with frustum was reworked. Now the nearest non-clipped point is calculated.
2019-06-07 15:02:39 +03:00
nds
8d2c79f4e3 0030726: Visualization - change Selected state of owner in AIS_Selection
AIS_InteractiveContext::IsHilighted() behavior has been changed.
It should use the same logic for owner processing like when it is highlighted. IsSelected of owner is used for selection state, not highlight.

 Without this correction, object is never shown as selected by click (Select(bool)):
 if (!HighlightStyle (theOwner, aCustomStyle) ||
    (!aCustomStyle.IsNull() && aCustomStyle != anObjSelStyle))

 IsSelected is already true, so the highlight style is equal to selection style, nothing to do.
2019-06-07 15:02:39 +03:00
kgv
fc552d842e 0030692: Data Exchange - introduce base framework RWMesh for importing mesh data formats into XDE document
RWMesh_CafReader - added new interface class for common workflow for reading mesh data files into XDE document.

OSD_Path - added auxiliary methods splitting path into folder+file pair
and checking relative/absolute path semantically:
OSD_Path::FolderAndFileFromPath(), ::IsRelativePath(), ::IsAbsolutePath().

V3d_TypeOfOrientation enumeration has been extended with aliases
(like front/left) for Z-up and Y-up conventions.
V3d_View::SetProj() now accepts argument for asking Y-up instead of Z-up.

Added command vviewproj defining standard camera direction.
Commands vaxo, vleft, vright, vtop, vbottom, vfront, vbottom now redirect to vviewproj.

TCollection_AsciiString::SubString() now uses Standard_OutOfRange_Always_Raise_if() to suppress GCC warning.

Eliminated gcc 4.4 compilation errors within Standard_OutOfRange_Raise_if,Standard_RangeError_Raise_if.
2019-06-07 15:02:38 +03:00
apn
5771d380b1 0030715: Configuration, CMake - error build with QTANGLE
SEARCH_TEMPLATES was modified to find EGL and GLES2 libraries in different folders (angle-gles, egl-gles, egl, angle, etc).
Find 3rdparty products procedure allows to define 3RDPARTY_LIBRARY_DIR or 3RDPARTY_DLL_DIR manually to find necessary libraries and dlls.
2019-06-05 13:35:24 +03:00
emv
78005ffefe 0030760: Modeling Algorithms - Intersection fails in Occt 7.3.0
Use FORWARD orientation of edges and face when attaching pcurve from one edge to another.
Test case for the issue.
2019-06-05 13:35:24 +03:00
emv
9324aa2d0d 0030656: Modeling Algorithms - Change Boolean Operations algorithm to use BVH tree instead of UBTree
Switching the Boolean Operations algorithm to use the BVH tree instead of UB tree as selection of the elements from BVH tree is usually faster.
2019-06-04 17:36:43 +03:00
abv
0616aa9ecf 0030764: Coding - warnings in Image_AlienPixMap.cxx when built with MSVC10
Disable warnings when including system headers (conflict between VS 2010 and Windows SDK definitions).
2019-06-04 17:31:13 +03:00
kgv
0ae9ac2179 0030729: Visualization - TKOpenGl reports OpenGL 4.5 loading functions error on Intel drivers
Make reported error more verbose.
2019-06-03 10:44:07 +03:00
kgv
b30b2c1381 0028668: Point Cloud Rendering - standard selection API returns invalid values
Added an argument to OpenGl_GraphicDriver::GetSharedContext() for returning only currently bound OpenGL context.
SelectMgr_SelectingVolumeManager::GetMousePosition() - added getter returning mouse coordinates.
2019-05-31 19:47:03 +03:00
kgv
edc4ba21c4 0030756: Visualization, TKOpenGl - capping plane does not work for ZLayer with non-zero origin
OpenGl_CappingPlaneResource::updateTransform() now takes into account ZLayer origin.

Fixed VT_ProcessKeyPress() passing arbitrary input to Draw::Atoi() leading
to messages in console like "unclosed braces".
2019-05-30 18:42:32 +03:00
kgv
9aceb23df6 0030745: Visualization, TKOpenGl - fix initialization of GLES3 context
OpenGl_GraphicDriver::InitContext() now tries to initialize GLES3 context
(EGL_CONTEXT_CLIENT_VERSION) and then fallback to GLES2.
2019-05-30 18:31:33 +03:00
iko
8e6ce38cf4 0030698: Volume Rendering - Early clipping of volume object's bounding box
Flag to control check of bounding box clipping before drawing has been added.
2019-05-30 18:17:06 +03:00
emv
7c1a821000 0030655: Modeling Data - Provide interfaces for selection of the elements from BVH tree
Provide the easy to use interfaces for selection of the elements from BVH tree.
The selection rules should be implemented in the selector class derived from *BVH_Traverse* or in *BVH_PairTraverse* in Reject/Accept methods.

The *BVH_Traverse* is used for selection of the elements from the tree.
The *BVH_PairTraverse* is used for selection of the pairs of elements from two BVH trees.

Auxiliary changes:
- Two methods BVH_Box::IsOut(OtherBox) and BVH_Box::IsOut(Point) have been added;
- Added methods for conversion of Bnd boxes to BVH boxes

Added new class *BVH_Tools* containing useful static methods operating on BVH points and boxes.

The classes BRepExtrema_OverlapTool and BVH_DistanceField have been rebased to use the new traverse methods.
2019-05-28 19:02:22 +03:00
Benjamin Bihler
1b827f0484 0030731: Modeling Data - B-Spline should have explicit data check error messages
Error messages have been added in throw statements.
2019-05-27 12:21:45 +03:00
kgv
e3249d8e5a 0030694: Data Exchange - support non-standard GB2312-encoded STEP files
STEPCAFControl_Reader::SourceCodePage() - added property defining text encoding
for converting names within STEPCAFControl_Reader::ReadNames() method.
Added associated "read.stepcaf.codepage" parameter,
which default value is Resource_UTF8, preserving current behavior.

Resource_FormatType enumeration has been extended by UTF8 and SystemLocale values.
Resource_Unicode - added conversion methods taking Resource_FormatType as argument.

GetName command has been corrected to NOT replace non-Latin symbols.
2019-05-24 16:59:16 +03:00
kgv
48ba181118 0030702: Configuration, CMake - error for iOS build due to searching macos frameworks
Look for UIKit+OpenGLES on iOS instead of AppKit+OpenGL.
2019-05-24 16:47:06 +03:00
kgv
f6973d9054 0030738: Data Exchange - XCAFDoc_ShapeTool::updateComponent() is too long
Cache subshapes list into map instead of re-iterating it multiple times within the loop.
Avoid iteration at all if modified state has been already detected.

XCAFDoc now returns GUIDs by const reference instead of a copy.
2019-05-24 16:44:30 +03:00
jgv
9369e98a62 0030590: Wrong result of Boolean Cut algorithm
Modification in static method BoundedArc of IntStart_SearchOnBoundaries:
    add exact intersection of canonical curve-surface (when Func is IntPatch_ArcFunction).
2019-05-24 12:11:52 +03:00
ika
7783ba1120 0030727: Data Exchange - Problems in Shape Tool
Add protection from return of not top-level shape by FindShape method.
Add protection against located roots into FindMainShape method.
Add new Draw command for FindMainShape.
Add flag findInstance to Draw command FindShape
2019-05-24 10:33:24 +03:00
emv
47cd8af2d2 0030670: Modeling Algorithms - Performance improvement of Boolean Operations algorithm
The following improvements have been made in Boolean operations algorithm:
1. Added possibility to update FaceInfo structure for many faces at once which helps to avoid nested loops.
2. Improve Point-Face classification procedure by caching the FaceExplorer for a face.
2019-05-24 10:33:23 +03:00
kgv
a4d594cbda 0030440: Visualization - Graphic3d_Camera::Frustum() returns wrong planes in portrait mode
Graphic3d_Camera::Frustum() now handles window Aspect Ratio < 1.0.
2019-05-23 15:46:47 +03:00
kgv
0ef04197f7 0030687: Visualization - remove redundant interfaces SelectBasics_EntityOwner and SelectBasics_SensitiveEntity
SelectBasics_EntityOwner has been merged into SelectMgr_EntityOwner.
Unused property SelectMgr_EntityOwner::ResetLocation() has been removed.
SelectBasics package has been moved from TKService to TKV3d.

SelectBasics_SensitiveEntity has been merged into Select3D_SensitiveEntity.
2019-05-21 19:42:15 +03:00
tiv
547fcc76b2 0030718: Mesh - broken triangulation within 32-bit builds
The problem caused by the changing of HashCode() method of TColStd_PackedMapOfInteger::TColStd_intMapNode class done as a part of 30550 changes is solved.
2019-05-21 19:15:26 +03:00
kgv
98eb4489d7 0030680: VIS - IVtkOCC_ShapeMesher displays Isoline wrong
IVtkOCC_ShapeMesher now calls StdPrs_Isolines tool instead of code copy-paste.
2019-05-21 18:58:14 +03:00
kgv
a9080ef924 0030717: Visualization, AIS_InteractiveContext::Erase() - selection presentation in a mode other than the default after hiding an object
AIS_InteractiveContext::EraseGlobal() now erases all object owners
(in the same way as AIS_InteractiveContext::ClearGlobal()).

Removed redundant fields AIS_InteractiveContext::myLastinMain and myWasLastMain.
2019-05-21 18:53:46 +03:00
mnv
8cf3bf84ce 0030713: Visualization, TKOpenGl - stipple line artifacts on Intel UHD Graphics 630
Added workaround for dashed line presentation on Intel UHD Graphics 630.
2019-05-20 11:19:41 +03:00
tiv
8fd45ae74f 0030716: Visualization - Set polygon offset units property to 1.0
The default value of the Units property of the Graphic3d_PolygonOffset class is changed to 1.0f (instead of 0.0f used previously).
2019-05-20 11:05:30 +03:00
msv
4811214cc0 0030679: Attached model hangs most of OCCT common functionality
Evaluator of offset surface has been protected against evaluation at infinite parameters. Now it throws exception when evaluating such data.

The methods IsUClosed and IsVClosed of the class ShapeAnalysis_Surface have been corrected to avoid evaluation of the surface at infinite parameters (fighting with regressions "parasolid doc_3 E3" and "parasolid doc_2 A3" in products).
2019-05-16 19:46:25 +03:00
asl
52c38ce17d 0030561: Visualization, PrsMgr_PresentableObject - Keep the current transformation for child in AddChild()
New methods AddChildWithCurrentTransformation(), RemoveChildWithRestoreTransformation() are implemented to keep the current global transformation of the object (child).
In DRAW a new command vchild is provided for testing low-level connections between presentations.
2019-05-16 19:34:17 +03:00
msv
b271edb092 0030712: Application Framework - Protect binary TriangulationDriver against empty triangulation in the file
The matter is that when the binary OCAF file contained a triangulation with 0 nodes and 0 triangles the method Paste would cause construction error of Poly_Triangulation.
This patch protects this method against exception.
2019-05-15 20:11:51 +03:00
emv
cca36b6b21 0030708: Modeling Data - Exception is raised while initializing TopoDS_Iterator with null shape
Added protection from null shapes to TopoDS_Iterator::Initialize method.
2019-05-15 20:05:31 +03:00
kgv
853af31fb1 0030705: Visualization, TKOpenGl - stipple line GLSL error on using OpenGL 2.1 + GL_EXT_gpu_shader4 extension on macOS
Fix compatibility with pure GL_EXT_gpu_shader4 specs by defining "uint" as "unsigned int".
2019-05-14 18:26:17 +03:00
kgv
ab1f458034 0030690: Draw Harness - provide XDisplay command for displaying XDE document
XDisplay - added new command displaying XDE document in ViewerTest map of object:
> XDisplay Doc [label1 [label2 [...]]] [-explore {on|off}] [-docPrefix {on|off}] [-names {on|off}]
>              [-noupdate] [-dispMode Mode] [-highMode Mode]

vstate - added NULL checks.
vdisplay now prints error on attempt to specify unsupported display mode.
verase, vremove now raise Tcl exception on attempt to hide non-existing object.
verase, vremove, vdir now accept name masks like "verase b*".
vremove and vdir output is now consistent to verase command (space-separated list of removed objects).
2019-05-14 18:24:09 +03:00
kgv
49dfdb7a97 0030516: Visualization - Pointer to an OpenGl_Structure is deleted and accessed later after PrsMgr_Presentation::Highlight()
Do not set IsForHighlight flag for already displayed presentation.
2019-05-14 18:21:17 +03:00
kgv
43070f2fd8 0030696: Draw Harness, testgrid - specify encoding in HTML header 2019-05-07 14:28:58 +03:00
kgv
77bc2ad1e0 0030683: Coding Rules - eliminate CLang compiler warnings -Wreturn-std-move
Added generalized move constructor and assignment operator to initialize TopoDS_Shape by object of this or derived type.
Added move constructor and assignment operator for TopLoc_SListOfItemLocation.
Macro OCCT_NO_RVALUE_REFERENCE is used in Standard_Handle.hxx instead of direct check of compiler version.
2019-05-07 14:22:52 +03:00
nbv
858435884d 0029523: Problem with BRepOffsetAPI_MakeEvolved
The capabilities of the class BRepOffsetAPI_MakeEvolved have been extended with involving alternate algorithm of resolving the loops in the piped shape. The new option theIsVolume is added for that in the constructor.

New class BRepFill_AdvancedEvolved has been created in order to provide new OCCT-algorithm combining BRepFill_PipeShell and BOPAlgo_MakerVolume.

A change in BOPAlgo_PaveFiller.cxx has been made in order to solve a specific problem of Boolean operation.

The interface of DRAW-command "evolved" has been updated to add the new option. DRAW-command "evolvedsolid" has been deleted. Now it is replaced with DRAW-command "evolved" with the option "-solid".

Testgrid "evolved" has been created.
2019-05-07 14:20:58 +03:00
kgv
1ac1059961 0030684: Coding Rules - eliminate GCC compiler warnings -Wformat-overflow and -Wcatch-value 2019-05-06 15:57:57 +03:00
kgv
b44bf0f8fe 0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation-persistent objects
SelectMgr_ViewerSelector::updatePoint3d() - added missing Abs() for computed tolerance
and added check to not attempt transforming undefined 3D point.
2019-05-06 15:57:57 +03:00
ifv
6f2411378b 0030433: Checkshape: bad solid, created by revolution, is reported as valid.
BRepPrimAPI_MakeRevol.cxx, hxx
Insert checking of self-intersecting of generated surfaces in MakeRevol

BRepTest_SweepCommands.cxx
Adjusting command revol to current behavior of MakeRevol algorithm.
2019-05-06 15:57:56 +03:00
kgv
7dd7c146e8 0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presentation
Removed redundant proxy class Prs3d_Presentation - Graphic3d_Structure now should be used directly.
Removed auxiliary class PrsMgr_ModedPresentation holding Structure and Display Mode index (field has been moved to Structure itself),
so that PrsMgr_Presentations (AIS_InteractiveObject::Presentations()) now holds Structures directly.
PrsMgr_Prs proxy class has been removed, and PrsMgr_Presentation now inherits Graphic3d_Structure.

Graphic3d_Structure, maps declarations have been corrected to use class instead of void*, which allowed to avoid redundant casts.
Several methods have been also modified to avoid creating Handle from this pointer.
AIS package headers have been cleaned up from forward declaration of Prs3d_Presentation class.

Fixed dereference of destroyed presentations within connected and HLR computed objects:
- AIS_InteractiveContext::Disconnect() now erases connected presentation.
- Graphic3d_CView::Clear() now removes destructed structures from Computed list.

- fix inaccessibility of PrsMgr_Presentation methods
2019-05-06 15:57:56 +03:00
kgv
faa0a91133 0030682: Configuration, qmake - all warnings are suppressed on macOS target
Fixed inconsistency of compiler flags with genproj.
warn_on+QMAKE_CXXFLAGS_WARN_ON is now used instead of warn_off+QMAKE_CXXFLAGS.
Added No_Exception to DEFINES.
2019-04-30 14:26:52 +03:00
kgv
42451ec057 0030681: Configuration - suppress OpenGL deprecation warning on macOS 10.14
Define GL_SILENCE_DEPRECATION to suppress warnings.
2019-04-30 14:26:51 +03:00
kgv
66278500db 0030672: Visualization - AIS_InteractiveContext::SetLocation() sets invalid selection BVH flag to removed object
SelectMgr_SelectionManager::Remove() now deactivates selection before removal.
2019-04-26 16:59:35 +03:00
kgv
245cbf9441 0030669: Visualization - AIS_Manipulator ignores parent transformation
AIS_Manipulator::Transform() now considers object parent transformation.

Added new command vchild for easier testing of low-level connections between presentations.
2019-04-25 16:41:17 +03:00
kgv
2b88626548 0030674: Visualization, AIS_InteractiveObject - fix accessibility of several properties
AIS_InteractiveObject/SelectMgr_SelectableObject/PrsMgr_PresentableObject
- added missing getters;
- removed redundant private sections;
- improved documentation;
- AIS_InteractiveObject::Compute() marked as pure interface;
- methods within this hierarchy have been moved to the base class, when reasonable.

Removed redundant typedefs to pointers (PrsMgr_PresentationPointer, PrsMgr_PresentableObjectPointer).
2019-04-25 16:41:16 +03:00
kgv
2506cf29b3 0030652: Configuration, genproj - reuse PRODUCTS_PATH within generated custom.bat
genconfdeps.tcl now puts %PRODUCTS_PATH%/$PRODUCTS_PATH into generated custom.bat/custom.sh scripts.
Added missing CSF_winmm definition to OccToolkit.pri
2019-04-25 16:35:55 +03:00
azv
6fd9bdf2cc 0030645: Modeling Algorithms - B-spline segmentation produces wrong parametrization
Method Segment() of B-spline curve and surface has been extended by parameter theTolerance (theUTolerance and theVTolerance for surface), which defines the proximity between knots of a NURBS and boundaries of cutting segment. The default value of the tolerance is Precision::PConfusion().
Test cases have been added to check segmenting of B-spline surface and curves both 2D and 3D.
2019-04-23 18:17:47 +03:00
ifv
d1775ee992 0030621: Implementation of building U-periodical surfaces.
draw_test_harness.md - description of new options in Draw commands

AppDef_BSplineCompute.hxx, BRepApprox_TheComputeLineOfApprox.hxx, GeomInt_TheComputeLineOfWLApprox.hxx, Approx_BSplComputeLine.gxx - implementation of method SetPeriodic(...) and implementation periodic boundary conditions for multiline in order to get periodic multicurve.

GeomAPI_PointsToBSplineSurface.hxx, GeomAPI_PointsToBSplineSurface.cxx - adding new parameter for methods Init(...) and Interpolate(...), implementation of building periodic tangents for first and last AppDef_MultiPointConstraint of multiline for U direction of surface.

GeometryTest_APICommands.cxx - implementation of new functionality in Draw command surfapp and surfint

GeomFill_NSections.cxx
Fixing problem with bugs modalg_3 bug606_2
2019-04-23 18:12:16 +03:00
tiv
293211aee0 0030592: Draw Harness, ViewerTest - provide vbackground command unifying vsetbg, vsetbgmode, vsetgradientbg, vsetgrbgmode, vsetcolorbg
A new command vbackground is created. Old background commands are made aliases for the newly created command (including vsetdefaultbg).
Tests are modified using newly added command vbackground.
2019-04-22 19:31:24 +03:00
vro
1bbd7c793c 0030663: Visualization - synthesize italic style for a font having no italic style
Font_FTFont now defines shear transformation to synthesize italic style for fonts having no such style.
Font_FontMgr::FindFont() and command "vfont -find" have been extended with -strict option
to check whether the given font is actually registered or not.
Font_FTFont::Init() - added constructor from memory buffer.
Second Font_FTFont::Init() override has been renamed to Font_FTFont::FindAndInit()
to avoid ambiguity between two similar methods taking full font path and font name as string.
2019-04-22 19:28:11 +03:00
ifv
ba7f665dce 0030435: Improving performance of Approx_ComputeCLine
1. Approx_ComputeCLine.gxx, Approx_FitAndDivide.hxx, Approx_FitAndDivide2d.hxx, BRepFill_ComputeCLine.hxx
It is base modification, which allows improve performance of approximation with help of Approx_ComputeCLine. The main idea of improvement is using degree selection by inverse order - from maxdegree to mindegree. If tolerance for maxdegree is not reached, there is no sense to make approximation for current number of knots with lower degree, it is necessary to cut parametric interval.

2. ProjLib_ComputeApprox, ProjLib_ComputeApproxOnPolarSurface, ProjLib_ComputeApproxOnPolarSurface, ProjLib_ProjectOnPlane
It is additional modification of methods using Approx_ComputeCLine.
Mainly, modifications concern to more optimal choosing parameters for approximation algorithm.

3. BRepCheck_Face
Small improvement of method Intersect(...), which intersects two wires on face.

4. BRepTopAdaptor_FClass2d
Impovement of treatment infinitely narrow faces.

5. ChFi3d/ChFi3d_Builder_6.cxx
Small improvement, which forbids extension of singular boundary of surface.
It was TODO problem in tests/bugs/modalg_7/bug27711_3

6. IntTools_EdgeEdge.cxx
Improvement of performance for cases of searching common parts between line  and analytical curve

7. GeomliteTest_CurveCommands.cxx
Adding Draw command fitcurve. This command is analog of approxcurve, but uses Approx_FitAndDivide algorithm.
Mainly to have direct draw command for testing Approx_ComputeCLine.

8. Extrema_ExtElC.cxx

Treatment of case "infinite solutions" for extrema line-ellipse

9. Modification of some tests according to new behavior of algorithm.

10. tests/perf/moddata/bug30435
Test for new improved algorithm.

11. Implementation QAcommand OCC30435 in QABugs_20.cxx used in test bug30435
2019-04-22 14:03:45 +03:00
kgv
130bc3c097 0030657: Visualization - misprint in Graphic3d_ZLayerSettings::SetOrigin()
Add missing initialization of Geom_Transformation object.
2019-04-19 14:36:23 +03:00
kgv
1ec17fb48a 0030644: Coding - inline trivial methods of V3d_View class 2019-04-18 18:23:54 +03:00
tiv
2b2be3fb82 0030550: Coding - Integer overflow in Standard_CString HashCodes
0030551: Foundation Classes - Integer overflow in NCollection_CellFilter HashCode

Signed integers are not used in hash code functions now to prevent undefined behavior on left shift operations with signed integers.
A possibility of negative values of hash codes is eliminated.
INT_MAX → IntegerLast() in hash code functions.
All found hash code functions behaves uniformly now: they return a value in the range [1, theUpperBound]. Relevant comments are added to such functions.
2019-04-16 20:38:23 +03:00
ifv
833034f301 0030647: Geom2dGcc_Circ2d2TanRad not giving all the solutions
Method for calculation of correct number of sampling points is added for
Adaptor2d_OffsetCurve.
Now number of sampling points correspond with similar method for
Geom2dAdaptor_Curve for curve type GeomAbs_OffsetCurve
Test case added
2019-04-16 14:07:45 +03:00
tiv
f9b30c0db3 0030623: Draw Harness - support hex color codes within ViewerTest::ParseColor()
ViewerTest::ParseColor() function is improved to be able to parse the following set of input arguments:
  - "Red Green Blue [Alpha]", where Red, Green, Blue, Alpha must be integers within the range [0, 255] or reals within the range [0.0, 1.0]. Note that "0 0 1" triple is parsed as "0.0 0.0 1.0" and will be interpreted as a blue color.
  - "ColorName [Alpha]", where ColorName is one of WHITE, BLACK, RED, GREEN, BLUE, etc. (look at Quantity_NameOfColor enumeration for all possible variants). Alpha may be integer or real, as described at the previous list item.
  - #HHH, [#]HHH[H], [#]HHHHHH[HH], where H is a hexadecimal digit (0 .. 9, a .. f, or A .. F). There are a short hexadecimal RGB, RGBA formats, and a usual RGB[A], respectively.
2019-04-12 18:48:18 +03:00
jgv
a5278fc126 0030597: BRepOffsetAPI_MakePipeShell raises Standard_RangeError
Constructor of GeomFill_SectionPlacement has been corrected: add correction of boundaries of curve to avoid mistake of LocateU in the case when the curve is BSpline.
2019-04-12 11:34:54 +03:00
kgv
74413ca7d3 0030643: Visualization, Ray-Tracing - shader compilation errors are not properly logged
OpenGl_View::initShader() now uses OpenGl_ShaderObject::LoadAndCompile().
2019-04-10 15:33:55 +03:00
kgv
98e6c6d17b 0030612: Visualization - provide texture map with video as image source
Introduced package Media wrapping FFmpeg structures.
Media_PlayerContext class manages video decoding into Media_IFrameQueue interface.
Graphic3d_MediaTextureSet implements Media_IFrameQueue interface and can be used as texture source.
AIS_MediaPlayer implements simple AIS object displaying video.
2019-04-09 14:18:35 +03:00
kgv
9491df8c1b 0030638: Visualization, TKOpenGl - load OpenGL 4.5 functions within OpenGl_Context 2019-04-09 14:17:47 +03:00
kgv
d325cb7f57 0030635: Visualization - move OpenGl_Layer to Graphic3d_Layer
Renamed classes (moved from TKOpenGl to TKV3d):
- OpenGl_Layer -> Graphic3d_Layer;
- OpenGl_BVHClipPrimitiveSet -> Graphic3d_BvhCStructureSet;
- OpenGl_BVHClipPrimitiveTrsfPersSet -> Graphic3d_BvhCStructureSetTrsfPers;
- OpenGl_BVHTreeSelector -> Graphic3d_CullingTool.

Method OpenGl_Layer::Render() has been moved to OpenGl_LayerList::renderLayer().

Standard Z-layers list definition has been moved
from OpenGl_GraphicDriver to base class Graphic3d_GraphicDriver.
2019-04-09 14:16:33 +03:00
kgv
24ee60ffd7 0030636: Configuration, qmake - unable to build using VS2017 2019-04-09 12:33:43 +03:00
emv
cea8d5c1ab 0030629: Modeling Algorithms - Invalid result of fuse operation
Plane/Torus intersection: take into account the Plane-Torus distance sign to compute the correct location of the section curve.

Test case for the issue.
2019-04-08 16:03:41 +03:00
kgv
fc867b96a5 0030618: Modeling Algorithms, BOPTools_Parallel - avoid using map for thread-local contexts without TBB
OSD_Parallel::ToUseOcctThreads() - new flag allowing to use OCCT threads implementation even when compiled with TBB (for testing).
Added new command dparallel for managing default Thread Pool.
OSD_Parallel::For() now avoid creation of universal iterator in simplest case.

BOPTools_Parallel - eliminated redundant typedefs/explicit instantiations of templates.
Added functor using array of per-thread context instead of a map.
2019-04-08 15:59:23 +03:00
kgv
aafe169f89 0030339: Configuration - add project files for qmake
Added adm/qmake/Occt.pro for building OCCT using Qt Creator.
genproj/genconf scripts have been extended with an option defining project format.

Draw_Appli now tries resolving CASROOT/DRAWDEFAULT/CSF_OCCTResourcePath/CSF_OCCTSamplesPath
locations within usual OCCT development/installation environment.
Added missing TKShHealing dependency to TKDraw/DRAWEXE (inherited from TKMesh).
OSD_Process::ExecutableFolder() - added method returning executable folder.
2019-04-07 13:21:59 +03:00
iko
84b904bc36 0030626: Visualization - manipulator crashes when is attached with scaling mode disabled
AIS_Manipulator crashes on SetPart method when 2 inputs (AIS_ManipulatorMode, Standard_Boolean) has been fixed up.
Test case for this bug has been added.
2019-04-03 19:05:38 +03:00
gka
33defc7121 0030616: Crash on reading STEP file
Added protections to avoid exceptions for null objects.
For reading entity StepShape_ToleranceValue was added reading lower and upper bounds represented by entities "StepRepr_ReprItemAndMeasureWithUnit" or "StepRepr_MeasureRepresentationItem"
2019-04-02 21:24:57 +03:00
kgv
2a0522b1c6 0030622: Visualization, TKOpenGl - Path Tracing fails on macOS
Fixed usage of non-existing function texture2D().
2019-04-01 18:31:16 +03:00
kgv
8693dfd0e8 0030619: Draw Harness, ViewerTest - add continuous rendering option to vrepaint command
Aspect_Window::InvalidateContent() - added new virtual method for invalidating window content using platform-specific API.

TKDraw, tkLoop() on Window platform has been changed so that to prevent
continuous input window events blocking terminal input
(e.g. in case if processing events is not fast enough or
if another continuously sends new events).

TKViewerTest, on X11 platform has been fixed a message processing
so that to avoid messages being not processed.
Added aggregation of Exposer and ConfigureNotify events.
Fixed aggregation MotionNotify events.
2019-04-01 18:29:16 +03:00
kgv
a738b534ca 0030611: Coding Rules - eliminate GCC compiler warnings -Wcatch-value
Add missing const& to catch statements.
2019-03-31 23:39:50 +03:00
kgv
f996b507d8 0030579: Draw Harness, Draw_Interpretor - catch exceptions other than Standard_Failure 2019-03-25 18:24:18 +03:00
kgv
d9166000fe 0030574: Configuration, genproj - CSF_DEFINES is not reset at the beginning of env.bat
env.bat now resets %CSF_DEFINES% variable to empty state
and append optional %CSF_DEFINES_EXTRA% external value.
2019-03-25 18:20:51 +03:00
kgv
3697d4fa2f 0030556: Coding - IGESData_GlobalSection missing member initialization in default constructor
IGESData_GlobalSection now initializes class fields.
2019-03-25 18:19:12 +03:00
iko
4bcd07385e 0030505: Volume Rendering - Deferred lighting
Missing getter for OpenGl_Texture::mySizedFormat has been added.
2019-03-25 18:16:41 +03:00
emv
d84b49c743 0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depending on the order of parameters
The following improvements have been implemented in BRepLib_MakeWire class to make it more reliable:
1. Quit adding edges of a wire into result if the current edges have not been added. Return NotDone status.
2. Allow merging not only bounding vertices (connected to only one edge) but also the middle ones, so the multi-connected vertices may appear in the result.

Test case for the issue.
2019-03-22 17:21:01 +03:00
kgv
aff73fd598 0030582: Coding - avoid defining references to properties of NULL objects
Approx_SweepApproximation::Perform() now creates empty arrays.
GeomAdaptor_SurfaceOfRevolution::UTrim() - fixed No_Exception misuse.
StdPrs_ShadedShape - fixed defining an invalid reference to Poly_Triangulation::UVNodes().

BSplCLib::MovePoint() and BSplCLib::MovePointAndTangent() now take optional
weights parameter as pointer consistent to other methods like BSplCLib::BuildEval().
2019-03-22 17:21:01 +03:00
ifv
afb3647b34 0030489: Modeling Algorithms - BRepBuilderAPI_GTransform hangs
Approx_ComputeCLine.gxx - criterium to stop interval cutting is increased.
ProjLib_ProjectedCurve.cxx - fix regression for bugs modalg_5 bug25886
Other tests are modified according to current state of algorithm
2019-03-22 17:21:00 +03:00
kgv
2328cae25d 0030593: Modeling Algorithms - ShapeUpgrade_ShapeDivide::Perform() throws Standard_NoMoreObject
Added missing TopExp_Explorer::More() checks to ShapeUpgrade_ShapeDivide::Perform() and BRepCheck_Analyzer::Perform().
2019-03-21 13:16:11 +03:00
kgv
85831628d6 0027316: Draw Harness - access violation on passing non-existing shape to XAddShape
Add NULL check to XAddShape command.
Removed broken test case bugs/step/bug27316.
2019-03-21 13:15:15 +03:00
kgv
667b5eb81b 0030583: Draw Harness - ignore cpulimit when Debugger is attached on Windows platform
cpulimit now omits ExitProcess() when IsDebuggerPresent() returns TRUE.
2019-03-20 19:00:48 +03:00
kgv
de07af824b 0030594: Data Exchange - access violation within IGESGeom_BSplineCurve constructor
Added NULL check.
2019-03-20 18:11:41 +03:00
kgv
cb6cad7df1 0023838: Modeling Data - Standard_OutOfRange in Geom_OffsetSurface::LocalDN (called by BRepFill_PipeShell)
Fixed incorrect array allocation within GeomEvaluator_OffsetSurface::CalculateDN()
and protection against assigning out-of-range values in case of non-square
number of U and V derivatives on surface.
2019-03-20 11:25:06 +03:00
kgv
ad67e36766 0030588: Coding - avoid calling operator->() on NULL Handle
Use .get() method instead of operator->() where result can be NULL.
STEPCAFControl_Reader::ReadLayers(), XCAFDoc_ColorTool,
XCAFDoc_LayerTool::SetVisibility() - fixed static functions syntax.
2019-03-20 11:23:45 +03:00
kgv
18434846a3 0030558: Coding - replace math_SingleTab with NCollection_LocalArray
math_Vector::Multiplied() - fixed modification of original array.

math_SVD::Solve(), math_SVD::PseudoInverse(), GeomFill_LocationGuide::InitX() - removed incorrect constness.

math_Vector, math_IntegerVector - math_SingleTab has been replaced by NCollection_LocalArray+NCollection_Array1.
Added accessors returning const value.
2019-03-20 11:23:08 +03:00
vro
43c8661e5e 0030536: Foundation Classes - TCollection_ExtendedString::StartsWith() and EndsWith() have a mistake
Draw-commands StartsWith and EndsWith are renamed to QAStartsWith and QAEndsWith.
The test script bug30536 was corrected.
2019-03-18 19:46:00 +03:00
abv
404504b234 0030544: Data Exchange - IGES import fails on specific file
Method IGESToBRep_BRepEntity::TransferEdge() is fixed to record result even if it is wire rather than edge.
This allows translation of EdgeLoop entities referring to CompositeCurve items in EdgeList entities.
Curves that fail to translate are recorded in result as Null shapes (rather than skipping them) to keep indexation of curves in EdgeList valid for remaining ones.

Method IGESToBRep_BRepEntity::TransferLoop() is improved to skip failed edges thus avoiding exception and allowing translation to complete for transferable entities.

Warning messages are corrected to be more meaningful.
Added test bugs iges bug30544
2019-03-18 19:45:07 +03:00
kgv
d65f9183fd 0030569: Foundation Classes - NCollection_Shared lacks inclusion of NCollection_DefineAlloc.hxx
Add missing includes.
2019-03-18 19:43:55 +03:00
kgv
6b121e2b48 0030584: Modeling Algorithms, BRepFill_OffsetWire - access violation on Face having no boundaries
Added missing NULL and empty result checks.
Updated test cases using offset_wire_092.brep shape containing all Edges
with TopAbs_INTERNAL orientation (hense no boundary to make offset).
2019-03-18 19:42:47 +03:00
kgv
437ef7713e 0030581: Modeling Data - Standard_OutOfRange within Geom_BSplineSurface::LocateV()
Geom2d_BSplineCurve::LocateU(),Geom_BSplineCurve::LocateU, Law_BSpline::LocateU()
Geom_BSplineSurface::LocateU() and Geom_BSplineSurface::LocateV()
have been corrected with missing range checks.
BSplCLib::Hunt() documentation has been corrected to reflect its actual implementation.
2019-03-18 19:41:40 +03:00
kgv
737e9a8da4 0030571: Visualization, TKOpenGl - mapped texture is ignored while drawing points
OpenGl_AspectsTextureSet now appends Sprite texture to the end of texture set.
OpenGl_Context::init() - fixed usage of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS on too old GL context.

Default sampler names occSampler0, occActiveSampler and occSamplerBaseColor
are now excluded from header with common declarations for build-in GLSL programs.

OpenGl_ShaderObject::LoadAndCompile() and OpenGl_ShaderProgram::Link()
now includes program Id within error log.

OpenGl_ShaderManager now supports mapping texture onto point primitive within built-in programs
(texture transformation is ignored).
2019-03-16 16:48:21 +03:00
oan
ad4b04291f 0030511: Mesh - too long meshing of assembly containing single solid (shared)
Added test case.
2019-03-16 16:46:53 +03:00
oan
e9fb0cba58 0030573: OSD_Parallel_TBB: limit number of execution threads using settings of OSD_ThreadPool::DefaultPool()
Add tbb::task_scheduler_init to OSD_Parallel::forEach().
2019-03-16 16:46:53 +03:00
kgv
f2b42160f4 0030575: Tests - v3d/materials unstable image screenshots of alpha-blending on GeForce with MSAA
testdiff now looks for "IMAGE_COLOR_TOLERANCE: Tol" statements in log
to execute diffimage with -toleranceOfColor Tol parameter.

Image difference is first performed with 0 tolerance and then optionally with non-zero tolerance,
so that the log always includes information that some images are different,
but with two different messages:
- "IMAGE differs" for images failed comparison;
- "IMAGE is similar" for images passed comparison only with non-zero tolerance.

v3d/materials - disabled MSAA and removed duplicate.
demo/samples/materials - compare screenshots with 0.8% color tolerance (2/255).
2019-03-16 16:46:52 +03:00
kgv
6072d5975a 0030580: Configuration, CMake - introduce BUILD_RELEASE_DISABLE_EXCEPTIONS option managing No_Exception macros 2019-03-16 16:46:51 +03:00
jgv
85c103d277 0030560: Modeling Algorithms - Improvement of the method BRepTools::DetectClosedness
1. Rewrite the method BRepTools::DetectClosedness.
2. Correct the method BRepOffset_Tool::EnLargeFace to process properly non-periodic but closed faces.
2019-03-16 16:46:50 +03:00
kgv
31fe1f8ec4 0030570: Visualization, TKOpenGl - OpenGl_AspectFace ignores texture revision on recompute
Added revision check to one more branch within OpenGl_AspectsTextureSet::build().
2019-03-15 19:11:45 +03:00
kgv
5716d13b43 0030564: Coding - math_Gauss uninitialized 'Singular' member variable
Removed unused class field Singular.
2019-03-13 16:39:43 +03:00
kgv
a7fd4b1bb0 0030562: Coding - TopOpeBRepBuild_Builder use of null pointer
TopOpeBRepBuild_Builder::Clear() - added NULL check.
2019-03-13 16:39:41 +03:00
mnv
226fce20f0 0030124: Visualization, AIS_InteractiveObject - clean up confusing Presentation invalidation logic
Removed excess mechanism for invalidating presentations AIS_InteractiveObject::myRecomputeEveryPrs.
PrsMgr_PresentableObject::Update() has been deprecated and replaced by PrsMgr_PresentableObject::UpdatePresentations()
recomputing only explicitly invalidated presentations.
2019-03-13 16:39:40 +03:00
kgv
ac8f17746b 0030554: Coding - ChFiDS_CommonPoint uninitialized member traarc
Added missing initialization to ChFiDS_CommonPoint constructor.
2019-03-13 11:00:23 +03:00
kgv
a98b97f5da 0030553: Coding - TopOpeBRepDS_Surface missing default initalizations
All class fields are now initialized within every TopOpeBRepDS_Surface constructor.
2019-03-13 11:00:22 +03:00
kgv
c3c2b331cd 0030545: Documentation - methods marked with Standard_DEPRECATED has ill-formed Doxygen output
Doxygen option PREDEFINED has been extended by Standard_DEPRECATED declaration.
2019-03-13 11:00:22 +03:00
kgv
af2fa459f1 0030547: Foundation Classes - NCollection_DoubleMap lacks Seek() method
Added Seek1() and Seek2() methods to NCollection_DoubleMap class.
2019-03-13 11:00:21 +03:00
oan
060fc60338 0030149: BRepMesh_Delaun: free triangle is left in the mesh after cleanup of auxiliary items
Remove free triangles connected to triangles over nodes of super triangle.
Modification of improved test case.
2019-03-07 18:11:43 +03:00
kgv
bf5f0ca20a 0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
Graphic3d_AspectFillArea3d, Graphic3d_AspectLine3d, Graphic3d_AspectMarker3d
and Graphic3d_AspectText3d have been merged into new class Graphic3d_Aspects.
The old classes are preserved as dummy sub-classes of Graphic3d_Aspects
preserving different per-aspect defaults.

Methods IsGroupPrimitivesAspectSet(), GroupPrimitivesAspect(), FillAreaAspect(),
LineAspect() and MarkerAspect() have been removed from Graphic3d_Group.
Instead, a new method Graphic3d_Group::ReplaceAspects() has been introduced
for replacing existing group aspects.

AIS_Shape now uses new method AIS_InteractiveObject::replaceAspects()
for updating computed groups with new aspects without presentation recomputation
in places where SynchronizeAspects() is not applicable.

OpenGl_AspectFace, OpenGl_AspectLine, OpenGl_AspectMarker
and OpenGl_AspectText have been merged into new class OpenGl_Aspects.

ViewerTest::parseColor() - fix uninitialized alpha component.
Graphic3d_AspectText3d/Prs3d_TextAspect - removed unused properties Space, ExpansionFactor, Angle.
Remove getters Values() deprecated since OCCT 7.1.0.
2019-03-07 18:08:36 +03:00
emv
e08a9b0302 0030470: Modeling Algorithms - Invalid result of offset operation in mode "Complete" with join type "Intersection"
The fix is intended to obtain the correct result of offset operation in which the result contained only the small inverse part of the shape, which clearly should not have been included in the result at all.

The fix adds treatment of the inverted edges while removing the inside faces (collapsed ones) - RemoveInsideFaces method:
- Removing the invalid hanging blocks containing the inverted edges.
- Considering the face containing the inverted edges as the invalid one.

Test cases for the issue.
2019-03-07 18:07:29 +03:00
Benjamin Bihler
55c8f0f7a4 0030523: Visualization - Highlighting does not work anymore
Added hints about ZLayer consideration and changing highlight colors to documentation
of AIS_InteractiveContext::SetHighlightStyle() method.

AIS_InteractiveContext::MoveTo() now checks if highlighting style does not use immediate layer
and performs full Redraw() instead of RedrawImmediate().

Improved parsing of ZLayer names within vdisplay, vzlayer and vselprops commands.
vreadpixel now reports syntax errors on wrong input.
2019-03-07 18:06:49 +03:00
vro
799318357c 0030535: Draw Harness - add size argument to vgrid command
vgrid command has been revised and extended with new argument -size.
2019-03-07 18:06:48 +03:00
anv
f522ce50b2 0030532: Visualization - Manipulator for dragging within a plane
Added dragging sectors to Manipulator presentation.
Test added.
2019-03-07 18:06:47 +03:00
emv
5d0038626b 0030490: Modeling Algorithms - Incomplete result of Cut operation
The problem is fixed by the fix for the issue #0027448, thus integrating the test case only.
2019-03-06 20:20:10 +03:00
kgv
88b12b7c05 0030182: Visualization, Image_AlienPixMap - support reading encoded image from memory buffer
Added two new Image_AlienPixMap::Load() methods, taking std::istream
and memory buffer (pointer, length) arguments.
This allows reading image from application memory or from file with non-zero offset.

Added Image_AlienPixMap::IsTopDownDefault() static property allowing to query rows order used by linked image library,
so that application might generate UV texture coordinates accordingly.

Added missing Release() to IWICImagingFactory instance.
2019-03-03 20:59:18 +03:00
ika
7b93ae3c5e 0030533: Data Exchange - Crash during STEP import.
Add Null checks to avoid crash during reading faces without bounds.
2019-03-03 20:58:37 +03:00
asl
6ef0d6f156 0024437: Visualization - silhouette edges based on OpenGL
Added new flag Graphic3d_AspectFillArea3d::ToDrawSilhouette() activating silhouette (outline) rendering.

The new feature can simulate fake HLR look-n-feel,
when combined with Aspect_IS_HIDDENLINE interior style (filling object with background color),
face boundary edges (with most continuity flag set to c2 or lower).

Silhouette GLSL program is very simple - it displaces model alongside vertex normal,
so that it is applicable only to smooth surfaces and closed volumes,
and produces visual artifacts at sharp corners, especially when face boundary is disabled.

OpenGl_SetOfShaderPrograms has been modified so that to reduce
dimensions of the grid of static size based on amount of program combinations.

OpenGl_PrimitiveArray no more allocates VBO resources if primitive array
is marked to be not drawn via interior style / line type / marker type.
2019-02-28 20:25:51 +03:00
nds
967d2f4f30 0030497: [REGRESSION] Mesh - wrong Poly_Polygon3D within local selection of located shape
The previous code has a condition to avoid processing the same faces if the face has a location.
The similar condition should be applied during the edges processing.
If not doing this, in the previous implementation, IMeshData_Edge instances are created for all edges(even located), but edges of faces located are not filled with curves.
As a result we had wrong local selection of edges.

Limit addition of edges to data model by ones with unique TShape and location using edges map already available in BRepMesh_ShapeVisitor.
2019-02-28 20:24:43 +03:00
pdn
4ec8ee66a0 0030356: Data Exchange - IGES model after importing into document has location issues 2019-02-28 20:23:35 +03:00
asl
0493ffd083 0029787: Visualization - Avoid in presentation edges of certain continuity class
A new flag Prs3d_Drawer::FaceBoundaryUpperContinuity() has been introduced
handled by StdPrs_ShadedShape::FillFaceBoundaries() method to exclude edges
of higher continuity class (e.g. to skip seam edges).

Draw Harness command vshowfaceboundary has been replaced by vaspects:
> vaspects -setFaceBoundaryDraw 1 -setFaceBoundaryColor RED -setFaceBoundaryType DASH.
2019-02-28 20:20:45 +03:00
Benjamin Bihler
0be7dbe183 0030448: Coding - add typo detection to derivation creation methods using Standard_NODISCARD attribute
Added macro Standard_NODISCARD equivalent to C++17 attribute [[nodiscard]] for compilers that support this.
Using Standard_NODISCARD macro for methods that create new object in gp, math, Geom, Bnd packages.
Marked equivalent operators with Standard_NODISCARD, if they are defined close to relevant methods.

Corrected code where warnings on unused result of calls to methods creating new objects are generated.
In most cases it looks like spelling errors (e.g. Normalised() instead of Normalise())
2019-02-27 19:59:07 +03:00
kgv
1c8fc6bee2 0030493: Draw, ViewerTest - minor improvement of vdisplay command
vdisplay no longer opens BREP file in case if Draw variable is not found.

Draw::Get() unused Complain argument has been removed from method definition.
Added Draw::GetExisting() and DBRep::GetExisting() commands never performing picking.
2019-02-27 19:55:32 +03:00
asl
d95f5ce102 0029810: Visualization - Tool for debugging shaders
A new tool for debugging shaders has been introduced.
The new method OpenGl_ShaderProgram::UpdateDebugDump() allows dynamically
dumping/restoring certain shader program (vertex and fragment shaders) to/from external file.

The file name is generated from the program's name with suffix ".vs" or ".fs" for shader type.
The environment variable CSF_ShadersDirectoryDump specifies the folder for dumps.

If the file does not exist (first frame), then it is automatically saved.
When the file date/time is changed in comparison with recent cached date,
then the file will be automatically loaded from external file,
thus this file can be modified in any editor.

OpenGl_ShaderManager now generates a human-readable resource ids for standard GLSL programs.

Draw Harness command vshader has been extended with arguments -list,-dump and -reload
for debugging shaders within OpenGl_Context.
2019-02-27 19:54:26 +03:00
kgv
1e756cb979 0030520: VIS - IVtkTools_ShapePicker::GetPickPosition() returns incorrect point
vmoveto and ivtkmoveto commands now print topmost picked 3D point.
2019-02-27 19:51:02 +03:00
abv
3bb61eb0fe 0029996: Porting to VC 2017: memory leak reported in visualisation
Tests for memory leaks on display / erase cycles are performed with VBO disabled to avoid false memory leaks reported on NVidia graphics
2019-02-26 15:23:18 +03:00
mnv
2a33274558 0029076: Visualization - implement element shrinking Shader
Aspect_IS_HOLLOW now an alias to Aspect_IS_EMPTY and Aspect_IS_HIDDENLINE does not implicitly enables mesh edges,
so that Graphic3d_AspectFillArea3d::SetDrawEdges() should be set independently.

OpenGl_ShaderManager now provides built-in GLSL programs for drawing mesh edges
in single pass (and on OpenGL ES which does not provide glPolygonMode()).

Graphic3d_RenderingParams::ToEnableAlphaToCoverage is now enabled by default
and properly handled at TKOpenGl level - enables coverage for Graphic3d_AlphaMode_Mask primitives.

OpenGl_PrimitiveArray now uses GLSL programs instead of glPolygonMode() by default,
which can be managed by OpenGl_Caps::usePolygonMode flag (desktop OpenGL only).
glPolygonMode() is also used as fallback regardless OpenGl_Caps::usePolygonMode flag
when GLSL programs are not supported (Geometry Shaders are required)
or stipple line style is required (not implemented within Face GLSL).

vaspects command has been extended by -setInterior -setDrawEdges -setEdgeColor -setEdgeType -setEdgeWidth
arguments replacing vsetinteriorstyle/vsetedgetype/vunsetedgetype commands.
vaspects now accepts arguments without "set" prefix.
ViewerTest::ParseColor() now parses RGBA color.

Redundant command BUC60738 has been removed.
AIS_ColorScale - fixed usage of uninitialized FillArea aspects.
2019-02-22 16:23:35 +03:00
jfa
4efe27fc4e 0030510: Application Framework - add missing NULL check within TDataStd_RealArray::ChangeArray() 2019-02-21 18:47:04 +03:00
kgv
ea298f59e4 0030384: Visualization - Won't display line with dot and dash style on Android
Fix misprint leading to double semicolon in GLSL code.
2019-02-21 18:44:37 +03:00
apn
78d5ea7a71 0030498: Warnings of building documentation
Fix warning 'Reached end of file while still insided a (nested) comment in Markdown' for old versions of doxygen
2019-02-18 14:59:32 +03:00
2566 changed files with 75158 additions and 37147 deletions

View File

@@ -86,6 +86,11 @@ if (BUILD_WITH_DEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
endif()
# option disabling OCCT exceptions in Release builds (No_Exception)
if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
endif()
# option to enable or disable use of precompiled headers
if (NOT DEFINED BUILD_USE_PCH)
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")
@@ -628,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}")

1
adm/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build-*

View File

@@ -3,5 +3,5 @@ ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

@@ -203,6 +203,7 @@ n Aspect
n DsgPrs
n Graphic3d
n Image
n Media
n MeshVS
n OpenGl
n D3DHost
@@ -438,3 +439,7 @@ n Geom2dEvaluator
t TKVCAF
n XCAFView
n XCAFNoteObjects
t TKRWMesh
n RWGltf
n RWMesh
n RWObj

View File

@@ -133,7 +133,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}}"))
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
@@ -181,9 +181,9 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
# set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}"))
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATHS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES bin win${COMPILER_BITNESS}/${COMPILER}/bin
NO_DEFAULT_PATH)
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}-NOTFOUND")

View File

@@ -65,6 +65,7 @@ if (WIN32)
set (CSF_shell32 "shell32.lib")
set (CSF_wsock32 "wsock32.lib")
set (CSF_psapi "psapi.lib")
set (CSF_winmm "winmm.lib")
set (CSF_d3d9 "D3D9.lib")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlLibs "libEGL libGLESv2")
@@ -72,28 +73,35 @@ if (WIN32)
set (CSF_OpenGlLibs "opengl32.lib")
endif()
else()
else()
if (APPLE)
set (CSF_objc "objc")
# frameworks
find_library (Appkit_LIB NAMES AppKit)
set (CSF_Appkit ${Appkit_LIB})
if (IOS)
find_library (Appkit_LIB NAMES UIKit)
set (CSF_Appkit ${Appkit_LIB})
else()
find_library (Appkit_LIB NAMES AppKit)
set (CSF_Appkit ${Appkit_LIB})
endif()
OCCT_CHECK_AND_UNSET (Appkit_LIB)
find_library (IOKit_LIB NAMES IOKit)
set (CSF_IOKit ${IOKit_LIB})
OCCT_CHECK_AND_UNSET (Appkit_LIB)
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (USE_GLX)
if (IOS)
find_library (OpenGlLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
elseif (USE_GLX)
set (CSF_OpenGlLibs GL)
set (CSF_XwLibs "X11 Xext Xmu Xi")
else()
find_library (OpenGlLibs_LIB NAMES OpenGL)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
@@ -109,5 +117,6 @@ if (WIN32)
endif()
set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_dl "dl")
set (CSF_fontconfig "fontconfig")
endif()
endif()

View File

@@ -143,5 +143,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
endif()
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
if (BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNo_Exception")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNo_Exception")
endif()

View File

@@ -163,13 +163,18 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
OCCT_MAKE_COMPILER_BITNESS()
string (TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME)
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
if ("${lower_PRODUCT_NAME}" STREQUAL "egl")
string (SUBSTRING "${lower_PRODUCT_NAME}" 1 -1 lower_PRODUCT_NAME)
list (APPEND SEARCH_TEMPLATES "[^gl]+${lower_PRODUCT_NAME}.*")
else()
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
endif()
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)

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

@@ -28,6 +28,11 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default).
These exceptions are always enabled in Debug builds, but disable in Release for better performance")
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
"Enable/Disable the floating point exceptions (FPE) during DRAW execution only.
Corresponding environment variable (CSF_FPE) can be changed manually
@@ -89,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 ")
@@ -156,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

@@ -30,10 +30,30 @@ set aRowIter 0
set aCheckRowIter 0
frame .myFrame -padx 5 -pady 5
pack .myFrame -fill both -expand 1
frame .myFrame.myPrjFrame
frame .myFrame.myVsFrame
frame .myFrame.myHxxChecks
frame .myFrame.myChecks
# project file format
set SYS_PRJFMT_LIST {}
set SYS_PRJNAME_LIST {}
if { "$::tcl_platform(platform)" == "windows" } {
lappend ::SYS_PRJFMT_LIST "vcxproj"
lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
}
if { "$tcl_platform(os)" == "Darwin" } {
lappend ::SYS_PRJFMT_LIST "xcd"
lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
}
lappend ::SYS_PRJFMT_LIST "cbp"
lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
lappend ::SYS_PRJFMT_LIST "pro"
lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
@@ -101,6 +121,7 @@ proc wokdep:gui:Close {} {
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
@@ -168,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
@@ -390,6 +414,8 @@ proc wokdep:gui:Show64Bitness { theRowIter } {
}
# Header
ttk::label .myFrame.myPrjFrame.myPrjLbl -text "Project format:" -padding {5 5 20 5}
ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
@@ -433,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
@@ -494,6 +523,10 @@ ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
# Create grid
# Header
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
incr aRowIter
if { "$tcl_platform(platform)" == "windows" } {
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
@@ -537,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
@@ -551,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" } {
@@ -561,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
@@ -592,6 +629,9 @@ grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
# Bind events
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}

View File

@@ -27,8 +27,10 @@ if { "$tcl_platform(platform)" == "unix" } {
set SYS_EXE_SUFFIX ""
if { "$tcl_platform(os)" == "Darwin" } {
set SYS_LIB_SUFFIX "dylib"
set PRJFMT "xcd"
} else {
set SYS_LIB_SUFFIX "so"
set PRJFMT "cbp"
}
set VCVER "gcc"
set VCVARS ""
@@ -39,6 +41,7 @@ if { "$tcl_platform(platform)" == "unix" } {
set SYS_EXE_SUFFIX ".exe"
set VCVER "vc10"
set VCVARS ""
set PRJFMT "vcxproj"
}
set SHORTCUT_HEADERS "ShortCut"
@@ -65,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})] } {
@@ -82,7 +85,7 @@ if { "$tcl_platform(platform)" != "windows" } {
set HAVE_D3D ""
set HAVE_RelWithDebInfo ""
}
foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT PRODUCTS_PATH} {
if { [info exists ::env(${anEnvIter})] } {
set ${anEnvIter} "$::env(${anEnvIter})"
}
@@ -855,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"
@@ -1118,15 +1140,33 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
return "$isFound"
}
# Returns OCCT version string from file Standard_Version.hxx (if available)
proc wokdep:DetectCasVersion {} {
set occt_ver 7.0.0
set aCasRoot [file normalize [file dirname [info script]]]
set filename "${aCasRoot}/src/Standard/Standard_Version.hxx"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
} else {
puts "Error: file '$filename' not found"
}
return $occt_ver
}
# Generate (override) custom environment file
proc wokdep:SaveCustom {} {
set aGenInfo "This environment file was generated by genconf.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
if { "$::tcl_platform(platform)" == "windows" } {
set aCustomFilePath "./custom.bat"
set aFile [open $aCustomFilePath "w"]
puts $aFile "@echo off"
puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
puts $aFile "rem $aGenInfo"
puts $aFile ""
puts $aFile "set PRJFMT=$::PRJFMT"
puts $aFile "set VCVER=$::VCVER"
puts $aFile "set ARCH=$::ARCH"
puts $aFile "set VCVARS=$::VCVARS"
@@ -1146,26 +1186,41 @@ proc wokdep:SaveCustom {} {
}
set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringInc [regsub -all "$::PRODUCTS_PATH" $aStringInc "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional headers search paths"
puts $aFile "set \"CSF_OPT_INC=$aStringInc\""
set aStringLib32 [join $::CSF_OPT_LIB32 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib32 [regsub -all "$::PRODUCTS_PATH" $aStringLib32 "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional libraries (32-bit) search paths"
puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib64 [regsub -all "$::PRODUCTS_PATH" $aStringLib64 "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional libraries (64-bit) search paths"
puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin32 [regsub -all "$::PRODUCTS_PATH" $aStringBin32 "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional (32-bit) search paths"
puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin64 [regsub -all "$::PRODUCTS_PATH" $aStringBin64 "%PRODUCTS_PATH%"]
}
puts $aFile ""
puts $aFile "rem Additional (64-bit) search paths"
puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
@@ -1175,9 +1230,10 @@ proc wokdep:SaveCustom {} {
set aCustomFilePath "./custom.sh"
set aFile [open $aCustomFilePath "w"]
puts $aFile "#!/bin/bash"
puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
puts $aFile "# $aGenInfo"
puts $aFile ""
puts $aFile "export PRJFMT=$::PRJFMT"
puts $aFile "export ARCH=$::ARCH"
puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
@@ -1195,22 +1251,88 @@ proc wokdep:SaveCustom {} {
}
set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringInc [regsub -all "$::PRODUCTS_PATH" $aStringInc "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional headers search paths"
puts $aFile "export CSF_OPT_INC=\"$aStringInc\""
set aStringLib$::ARCH [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
set aStringLib [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringLib [regsub -all "$::PRODUCTS_PATH" $aStringLib "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib$::ARCH]\""
puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib]\""
set aStringBin$::ARCH [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
set aStringBin [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
if { "$::PRODUCTS_PATH" != "" } {
set aStringBin [regsub -all "$::PRODUCTS_PATH" $aStringBin "\${PRODUCTS_PATH}"]
}
puts $aFile ""
puts $aFile "# Additional ($::ARCH-bit) search paths"
puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin$::ARCH]\""
puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin]\""
close $aFile
}
puts "Configuration saved to file '$aCustomFilePath'"
# generate custom.auto.pri
set toExportCustomPri 1
if { $toExportCustomPri == 1 } {
set aCasVer [wokdep:DetectCasVersion]
set aCustomFilePath "./adm/qmake/custom.auto.pri"
set aFile [open $aCustomFilePath "w"]
puts $aFile "# $aGenInfo"
puts $aFile ""
puts $aFile "VERSION=$aCasVer"
puts $aFile "PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
puts $aFile ""
puts $aFile "# Optional 3rd-parties switches"
foreach anEnvIter $::THE_ENV_VARIABLES {
set aName ${anEnvIter}
set aValue [set ::${anEnvIter}]
if { "$aValue" == "true" } {
puts $aFile "CONFIG += ${aName}"
} else {
#puts $aFile "CONFIG -= ${aName}"
}
}
puts $aFile ""
puts $aFile "# Additional headers search paths"
foreach anIncPath $::CSF_OPT_INC {
if { "$::PRODUCTS_PATH" != "" } {
set anIncPath [regsub -all "$::PRODUCTS_PATH" $anIncPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile "INCLUDEPATH += \"${anIncPath}\""
}
puts $aFile ""
puts $aFile "# Additional libraries search paths"
foreach aLibPath [set ::CSF_OPT_LIB$::ARCH] {
if { "$::PRODUCTS_PATH" != "" } {
set aLibPath [regsub -all "$::PRODUCTS_PATH" $aLibPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile "LIBS += -L\"${aLibPath}\""
}
if { "$::tcl_platform(platform)" == "windows" } {
puts $aFile ""
puts $aFile "# Additional DLLs search paths"
foreach aDllPath [set ::CSF_OPT_BIN$::ARCH] {
if { "$::PRODUCTS_PATH" != "" } {
set aDllPath [regsub -all "$::PRODUCTS_PATH" $aDllPath "\$\$\{PRODUCTS_PATH\}"]
}
puts $aFile "LIBS += -L\"${aDllPath}\""
}
}
puts $aFile ""
close $aFile
puts "Configuration saved to file '$aCustomFilePath'"
}
}

View File

@@ -256,7 +256,7 @@ proc genAllResources {} {
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -314,6 +314,7 @@ proc genproj {theFormat args} {
vc141 - Visual Studio 2017
cbp - CodeBlocks
xcd - XCode
pro - Qt Creator
Platform (optional):
wnt - Windows Desktop
@@ -395,9 +396,14 @@ proc genprojbat {theFormat thePlatform} {
"cbp" {
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat"
# Code::Blocks 16.01 does not create directory for import libs, help him
file mkdir "$::path/$thePlatform/cbp/lib"
file mkdir "$::path/$thePlatform/cbp/libd"
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
set aPlatformAndCompiler "${thePlatform}/clang"
}
file mkdir "$::path/${aPlatformAndCompiler}/lib"
file mkdir "$::path/${aPlatformAndCompiler}/libd"
}
"xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
}
@@ -472,15 +478,6 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
}
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
}
# create the out dir if it does not exist
if (![file isdirectory $path/inc]) {
puts "$path/inc folder does not exists and will be created"
@@ -491,6 +488,19 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
puts "Collecting required header files into $path/inc ..."
osutils:collectinc $aModules $path/inc
if { "$theFormat" == "pro" } {
return
}
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
}
# Generating project files for the selected format
switch -exact -- "$theFormat" {
"vc7" -
@@ -1349,6 +1359,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_opengl32) "opengl32"
set aLibsMap(CSF_wsock32) "wsock32"
set aLibsMap(CSF_netapi32) "netapi32"
set aLibsMap(CSF_winmm) "winmm"
set aLibsMap(CSF_OpenGlLibs) "opengl32"
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
@@ -1366,17 +1377,23 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
set aLibsMap(CSF_TBB) ""
} else {
set aLibsMap(CSF_dl) "dl"
if { "$theOS" == "mac" } {
if { "$theOS" == "mac" || "$theOS" == "ios" } {
set aLibsMap(CSF_objc) "objc"
set aFrmsMap(CSF_Appkit) "AppKit"
if { "$theOS" == "ios" } {
set aFrmsMap(CSF_Appkit) "UIKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGLES"
} else {
set aFrmsMap(CSF_Appkit) "AppKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
}
set aFrmsMap(CSF_IOKit) "IOKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
set aFrmsMap(CSF_TclLibs) "Tcl"
set aLibsMap(CSF_TclLibs) ""
set aFrmsMap(CSF_TclTkLibs) "Tk"
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"
@@ -2295,6 +2312,10 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
set aCmplFlagsDebug [list]
set toPassArgsByFile 0
set aLibPrefix "lib"
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
set aPlatformAndCompiler "${thePlatform}/clang"
}
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" || "$thePlatform" == "qnx" } {
set toPassArgsByFile 1
}
@@ -2351,17 +2372,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
# Release target configuration
puts $aFile "\t\t\t<Target title=\"Release\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bin/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/lib/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/obj\" />"
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/obj\" />"
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
@@ -2384,7 +2405,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
if { $toPassArgsByFile == 1 } {
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkFileName\" />"
}
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/lib\" />"
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/lib\" />"
if { "$thePlatform" == "mac" } {
if { [ lsearch $theLibsList X11 ] >= 0} {
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
@@ -2392,7 +2413,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
}
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch})\" />"
if { "$thePlatform" == "lin" } {
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/lib\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/lib\" />"
}
puts $aFile "\t\t\t\t</Linker>"
@@ -2401,17 +2422,17 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
# Debug target configuration
puts $aFile "\t\t\t<Target title=\"Debug\">"
if { "$theIsExe" == "true" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option type=\"1\" />"
} else {
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${thePlatform}/cbp/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/bind/${aLibPrefix}${theProjName}\" imp_lib=\"../../../${aPlatformAndCompiler}/libd/\$(TARGET_OUTPUT_BASENAME)\" prefix_auto=\"1\" extension_auto=\"1\" />"
} else {
puts $aFile "\t\t\t\t<Option output=\"../../../${thePlatform}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
puts $aFile "\t\t\t\t<Option output=\"../../../${aPlatformAndCompiler}/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
}
puts $aFile "\t\t\t\t<Option type=\"3\" />"
}
puts $aFile "\t\t\t\t<Option object_output=\"../../../${thePlatform}/cbp/objd\" />"
puts $aFile "\t\t\t\t<Option object_output=\"../../../${aPlatformAndCompiler}/objd\" />"
puts $aFile "\t\t\t\t<Option compiler=\"$aCmplCbp\" />"
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
if { "$thePlatform" == "wnt" || "$thePlatform" == "uwp" } {
@@ -2434,7 +2455,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
if { $toPassArgsByFile == 1 } {
puts $aFile "\t\t\t\t\t<Add option=\"\@$aLnkDebFileName\" />"
}
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${thePlatform}/cbp/libd\" />"
puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aPlatformAndCompiler}/libd\" />"
if { "$thePlatform" == "mac" } {
if { [ lsearch $theLibsList X11 ] >= 0} {
puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
@@ -2442,7 +2463,7 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
}
puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch}D)\" />"
if { "$thePlatform" == "lin" } {
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${thePlatform}/cbp/libd\" />"
puts $aFile "\t\t\t\t\t<Add option=\"-Wl,-rpath-link=../../../${aPlatformAndCompiler}/libd\" />"
}
puts $aFile "\t\t\t\t</Linker>"
@@ -2509,8 +2530,8 @@ proc osutils:cbp { theCmpl theOutDir theProjName thePlatform theSrcFiles theLibs
puts $aFile "\t\t\t<Option link=\"0\" />"
puts $aFile "\t\t</Unit>"
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/obj/src/"] $aSrcFile]]
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/$thePlatform/cbp/objd/src/"] $aSrcFile]]
set aFileObj [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/obj/src/"] $aSrcFile]]
set aFileObjd [string map {.cxx .o} [string map [list "/src/" "/${aPlatformAndCompiler}/objd/src/"] $aSrcFile]]
puts -nonewline $aFileLnkObj "$aFileObj "
puts -nonewline $aFileLnkObjd "$aFileObjd "
} else {
@@ -2655,7 +2676,7 @@ proc OS:xcodeproj { theModules theOutDir theGuidsMap theLibType thePlatform} {
}
# Generates dependencies section for Xcode project files.
proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection theDepsGuids theDepsRefGuids theIsStatic} {
proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection theDepsGuids theDepsRefGuids thePlatform theIsStatic} {
upvar $theGuidsMap aGuidsMap
upvar $theFileRefSection aFileRefSection
upvar $theDepsGuids aDepsGuids
@@ -2679,7 +2700,7 @@ proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection
}
}
osutils:usedOsLibs $theToolKit "mac" aLibs aFrameworks
osutils:usedOsLibs $theToolKit $thePlatform aLibs aFrameworks
set aUsedLibs [concat $aUsedLibs $aLibs]
set aUsedLibs [concat $aUsedLibs $aFrameworks]
foreach tkx $aUsedLibs {
@@ -2894,7 +2915,7 @@ proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {t
}
puts $aPbxprojFile [osutils:xcdtk:sources $theToolKit $theTargetType aSrcFileRefSection aGroupSection aPackagesGuids aSrcFileGuids aGuidsMap anIncPaths]
puts $aPbxprojFile [osutils:xcdtk:deps $theToolKit $theTargetType aGuidsMap aDepsFileRefSection aDepsGuids aDepsRefGuids $theIsStatic]
puts $aPbxprojFile [osutils:xcdtk:deps $theToolKit $theTargetType aGuidsMap aDepsFileRefSection aDepsGuids aDepsRefGuids $thePlatform $theIsStatic]
# End PBXBuildFile section
# Begin PBXFileReference section

5
adm/qmake/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
/*/*.pro
/*/*/*.pro
*.pro.user
custom.pri
custom.auto.pri

157
adm/qmake/OccCppConfig.pri Normal file
View File

@@ -0,0 +1,157 @@
# This is project defines C++ compilation rules for building an OCCT Toolkit.
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Disable some dummy Qt defaults
QT -= core gui
CONFIG -= qt app_bundle
CONFIG -= qml_debug
CONFIG -= debug_and_release
OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags
CONFIG += warn_on
QMAKE_CFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON = -Wall
win32 {
QMAKE_CFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
QMAKE_CXXFLAGS_STL_ON = /EHa
QMAKE_CXXFLAGS += -fp:precise
#QMAKE_CXXFLAGS -= -Zc:throwingNew
#QMAKE_CXXFLAGS -= -Zc:rvalueCast
QMAKE_LFLAGS += -INCREMENTAL:NO
CONFIG(debug, debug|release) {
QMAKE_CXXFLAGS += -Od
QMAKE_CXXFLAGS += -Ob1
}
DEFINES -= WIN32
DEFINES -= WIN64
DEFINES += _CRT_SECURE_NO_WARNINGS
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
DEFINES += _SCL_SECURE_NO_WARNINGS
} else {
CONFIG += c++11
QMAKE_CFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fvisibility=default
DEFINES += OCC_CONVERT_SIGNALS
mac {
iphoneos {
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
}
}
}
!CONFIG(debug, debug|release) {
# disable exceptions in Release builds
DEFINES += No_Exception
HAVE_RelWithDebInfo {
win32 {
CONFIG += force_debug_info
}
}
}
# Define output folder depending on compiler name
MY_BITNESS = 32
equals(QMAKE_TARGET.arch, x86_64) | equals(QMAKE_HOST.arch, x86_64) { MY_BITNESS = 64 }
equals(ANDROID_TARGET_ARCH, arm64-v8a) { MY_BITNESS = 64 }
has64Target = $$find(QMAKE_TARGET.arch, "x64")
count(has64Target, 1) { MY_BITNESS = 64 }
MY_PLATFORM = platform
CONFIG(iphonesimulator, iphoneos|iphonesimulator) { MY_PLATFORM = iphonesimulator
} else:CONFIG(iphoneos, iphoneos|iphonesimulator) { MY_PLATFORM = iphoneos
} else:android { MY_PLATFORM = android-$$ANDROID_TARGET_ARCH
} else:win32 { MY_PLATFORM = win$$MY_BITNESS
} else:mac { MY_PLATFORM = mac
} else:linux { MY_PLATFORM = lin
} else:unix { MY_PLATFORM = unix
} else { warning (Unknown platform. "$$MY_PLATFORM" is used) }
MY_COMPILER = compiler
MY_VC_VER = 0
android-g++ {
MY_COMPILER = gcc
} else:clang {
MY_COMPILER = clang
} else:gcc {
MY_COMPILER = gcc
} else:win32-msvc2010 {
MY_COMPILER = vc10
MY_VC_VER = 10
} else:win32-msvc2012 {
MY_COMPILER = vc11
MY_VC_VER = 11
} else:win32-msvc2013 {
MY_COMPILER = vc12
MY_VC_VER = 12
} else:win32-msvc2015 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc2017 {
MY_COMPILER = vc14
MY_VC_VER = 14
} else:win32-msvc {
MY_COMPILER = vc14
MY_VC_VER = 14
aMsvcVer = $$(VisualStudioVersion)
equals(aMsvcVer, 14.0){
# VS2015, vc140
} else:equals(aMsvcVer, 15.0){
# VS2015, vc141
} else:equals(aMsvcVer, 16.0){
# VS2019, vc142
} else {
warning (Unknown msvc version. "$$MY_COMPILER" is used)
}
} else {
warning (Unknown compiler. "$$MY_COMPILER" is used)
}
MY_PLATFORM_AND_COMPILER = $$MY_PLATFORM/$$MY_COMPILER
#warning (The platform is "$$MY_PLATFORM"; bitness is "$$MY_BITNESS"; compiler is "$$MY_COMPILER")
CONFIG(debug, debug|release) { MY_BUILDTYPE = d }
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/lib$${MY_BUILDTYPE}
win32 {
DESTDIR = $$OccGitRoot/win$${MY_BITNESS}/vc$${MY_VC_VER}/bin$${MY_BUILDTYPE}
aLibDest = $$DESTDIR/../lib$${MY_BUILDTYPE}
#DLLDESTDIR = $$DESTDIR/../bin$${MY_BUILDTYPE}
# dummy target creating lib/libd folder
occtkgen_libfolder.input = $$_PRO_FILE_PWD_/../../OcctDummy.in
occtkgen_libfolder.output = $$aLibDest/dummy.tmp
occtkgen_libfolder.config = verbatim
QMAKE_SUBSTITUTES += occtkgen_libfolder
LIBS += -L$$aLibDest
equals(TEMPLATE, lib) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.dll
QMAKE_CLEAN += $$aLibDest/$${TARGET}.lib
QMAKE_CLEAN += $$aLibDest/$${TARGET}.exp
} else {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.exe
}
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.pdb
QMAKE_LFLAGS += -PDB:"$$DESTDIR/$${TARGET}.pdb"
QMAKE_LFLAGS += -IMPLIB:"$$aLibDest/$${TARGET}.lib"
} else {
LIBS += -L$$DESTDIR
equals(TEMPLATE, app) {
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/bin$${MY_BUILDTYPE}
}
}
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}

36
adm/qmake/OccModule.pri Normal file
View File

@@ -0,0 +1,36 @@
# This is a project template file defining an OCCT Module.
# This project should be included with predefined OCC_MODULE_NAME variable.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
# Iterate over Toolkits within current Module and generate sub-project per Toolkit
aModuleList = $$cat(../MODULES, lines)
for (aModuleIter, aModuleList) {
#aTkList = $$list($$aModuleIter) - this doesn't work, qmake bug?
aModule = $$first($$list($$aModuleIter))
equals (aModule, $$OCC_MODULE_NAME) {
for (aToolKit, $$list($$aModuleIter)) {
toSkipToolkit = 0
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
eval(occtkgen_$${aToolKit}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aToolKit})
SUBDIRS += $${aToolKit}
aModExtList = $$cat(../../src/$${aToolKit}/EXTERNLIB, lines)
aTkDepends = $${aToolKit}.depends
for (aModExtIter, aModExtList) {
contains ($$list($$aModuleIter), $$aModExtIter) { eval ($${aTkDepends} += $$aModExtIter) }
}
#warning($$aToolKit depends on: $$reverse($${aTkDepends}))
}
}
}
}

View File

@@ -0,0 +1,2 @@
OCC_MODULE_NAME = \$\$TARGET
include(../OccModule.pri)

144
adm/qmake/OccToolkit.pri Normal file
View File

@@ -0,0 +1,144 @@
# This is a project template file defining an OCCT Toolkit.
# This project should be included with predefined OCC_TOOLKIT_NAME variable.
TEMPLATE = lib
!exists(../../src/$$OCC_TOOLKIT_NAME/PACKAGES) {
TEMPLATE = app
CONFIG += console
}
win32 {
# do not append version to DLL name
CONFIG += skip_target_version_ext
}
include(OccCppConfig.pri)
aSrcRoot = $$OccGitRoot/src
aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot
# CSF variables
CSF_FREETYPE = -lfreetype
CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
win32 {
CSF_kernel32 = -lkernel32
CSF_advapi32 = -ladvapi32
CSF_gdi32 = -lgdi32
CSF_user32 = -luser32 -lcomdlg32
CSF_shell32 = -lShell32
CSF_opengl32 = -lopengl32
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_psapi = -lPsapi
CSF_winmm = -lwinmm
CSF_d3d9 = -ld3d9
CSF_TclLibs = -ltcl86
CSF_TclTkLibs = -ltk86
CSF_TBB =
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
iphoneos {
CSF_Appkit = -framework UIKit
CSF_OpenGlLibs = -framework OpenGLES
} else {
CSF_Appkit = -framework AppKit
CSF_OpenGlLibs = -framework OpenGL
}
CSF_IOKit = -framework IOKit
CSF_TclLibs = -framework Tcl
CSF_TclTkLibs = -framework Tk
} else {
CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlLibs = -lGL
CSF_TclTkLibs = -lX11 -ltk8.6
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_MotifLibs = -lX11
CSF_fontconfig = -lfontconfig
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
# Define the list of standard OCCT file extensions
aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$
aPxxRegex = ^.*\.(pxx)$
aCxxRegex = ^.*\.(cxx|c)$
mac { aCxxRegex = ^.*\.(cxx|c|m|mm)$ }
# Auxiliary function for probing file extension
defineTest (occCheckExtension) {
aProbe = $$find(1, "$$2")
count(aProbe, 1) { return(true) } else { return(false) }
}
# Auxiliary function for probing compilable files
defineTest (occIsCxxFile) { occCheckExtension ($$1, $$aCxxRegex) { return(true) } else { return(false) } }
# Auxiliary function for probing header files
defineTest (occIsHxxFile) { occCheckExtension ($$1, $$aHxxRegex) { return(true) } else { return(false) } }
aTkFiles = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/FILES, lines)
aTkFiles += CMakeLists.txt
aPackages = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/PACKAGES, lines)
anExternLibs = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/EXTERNLIB, lines)
for (aTkFileIter, aTkFiles) { OTHER_FILES += $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aTkFileIter }
for (anExternLib, anExternLibs) {
hasCsf = $$find(anExternLib, CSF_)
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
} else {
LIBS += -l$$anExternLib
}
}
# Iterate over Packages and add compilable files into this project
isEmpty (aPackages) { aPackages = $$OCC_TOOLKIT_NAME }
for (aPackage, aPackages) {
aPackageFolder = $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aPackage
aPackageFiles = $$cat($$aSrcRoot/$$aPackage/FILES, lines)
for (aFileIter, aPackageFiles) {
occIsCxxFile($$aFileIter) {
SOURCES += $$aSrcRoot/$$aPackage/$$aFileIter
}
}
}
# extend clean with versioned .so files
!win32 {
aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else {
mac {
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else {
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}.$${aVerMic}
}
}
}

View File

@@ -0,0 +1,2 @@
OCC_TOOLKIT_NAME = \$\$TARGET
include(../../OccToolkit.pri)

41
adm/qmake/Occt.pro Normal file
View File

@@ -0,0 +1,41 @@
# This is an experimental Solution project for building entire OCCT framework using qmake.
# It can be also used for just source code navigation in Qt Creator without actually building OCCT.
# Note, as this is an experimental project, compiler flags might differ from official builds - use it on your own risk!
# Building OCCT using CMake is a preferred solution.
#
# This project GENERATES sub-projects (OCCT modules) dynamically, so to start using it:
# - Launch genconf, select Project Format "Qt Project" and configure dependencies; this will also generate "custom.auto.pri".
# - Launch genproj to fill in "inc" folder with links to header files.
# - Open project in Qt Creator, and call "Run qmake".
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
# - "Run qmake" and perform Build.
TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) }
OTHER_FILES += OccModule.pro.in \
OcctHeaderLink.hxx.in \
OccToolkit.pro.in \
OccCppConfig.pri \
OccModule.pri \
OccToolkit.pri \
custom.pri.template
# Iterate over Modules and generate sub-projects
aSolModuleList = $$cat(../MODULES, lines)
for (aSolModuleIter, aSolModuleList) {
aSolModule = $$first($$list($$aSolModuleIter))
eval(occtkgen_$${aSolModule}.input = $$_PRO_FILE_PWD_/OccModule.pro.in)
eval(occtkgen_$${aSolModule}.output = $$_PRO_FILE_PWD_/$${aSolModule}/$${aSolModule}.pro)
eval(occtkgen_$${aSolModule}.config = verbatim)
eval(QMAKE_SUBSTITUTES += occtkgen_$${aSolModule})
SUBDIRS += $${aSolModule}
}
# These dependencies are manually defined
ModelingData.depends = FoundationClasses
ModelingAlgorithms.depends = FoundationClasses ModelingData
Visualization.depends = FoundationClasses ModelingData ModelingAlgorithms
ApplicationFramework.depends = FoundationClasses ModelingData ModelingAlgorithms Visualization
DataExchange.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework
Draw.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework DataExchange Visualization

0
adm/qmake/OcctDummy.in Normal file
View File

View File

@@ -0,0 +1 @@
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"

View File

@@ -0,0 +1,17 @@
PRODUCTS_PATH = c:/3rdparty/vc14
#CONFIG += HAVE_FREEIMAGE
#CONFIG += HAVE_FFMPEG
#CONFIG += HAVE_TBB
#CONFIG += HAVE_GLES2
#CONFIG += HAVE_D3D
#CONFIG += HAVE_VTK
aFreeType = $$PRODUCTS_PATH/freetype-2.5.5-vc14-64
aTclTk = $$PRODUCTS_PATH/tcltk-86-64
INCLUDEPATH += $$aFreeType/include
LIBS += -L$$aFreeType/lib
INCLUDEPATH += $$aTclTk/include
LIBS += -L$$aTclTk/lib

View File

@@ -24,11 +24,13 @@ 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="
set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64="
set "CSF_DEFINES=%CSF_DEFINES_EXTRA%"
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"
@@ -162,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=;"

View File

@@ -6,7 +6,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath
# Reset values
export CASROOT="__CASROOT__"
export CASDEB=""
export TARGET="";
export PRJFMT="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_FREEIMAGE="false";
@@ -40,9 +40,9 @@ do
elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
export CASDEB="i"
elif [ "$i" == "cbp" ]; then
export TARGET="cbp";
export PRJFMT="cbp";
elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
export TARGET="xcd";
export PRJFMT="xcd";
fi
done
shopt -u nocasematch
@@ -64,28 +64,32 @@ else
fi
export CASBIN=""
if [ "${TARGET}" == "cbp" ]; then
export CASBIN="${WOKSTATION}/cbp"
elif [ "${TARGET}" == "xcd" ]; then
if [ "${PRJFMT}" == "xcd" ]; then
export CASBIN="adm/mac/xcd/build"
else
if [ "$aSystem" == "Darwin" ]; then
export CASBIN="${WOKSTATION}/clang"
else
export CASBIN="${WOKSTATION}/gcc"
fi
fi
export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
if [ "${TARGET}" == "cbp" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
elif [ "${TARGET}" == "xcd" ]; then
if [ "${PRJFMT}" == "xcd" ]; then
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
else
export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
fi
export CSF_OPT_CMPL=""
@@ -174,7 +178,7 @@ export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}"
export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
if [ "${TARGET}" == "xcd" ]; then
if [ "${PRJFMT}" == "xcd" ]; then
if [ "${CASDEB}" == "d" ]; then
export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
else

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

@@ -1091,7 +1091,7 @@ The following environment variables have become redundant:
* *CSF_UnitsLexicon* and *CSF_UnitsDefinition* are no more used. Units definition (*UnitsAPI/Lexi_Expr.dat* and *UnitsAPI/Units.dat*) is now embedded into source code.
* *CSF_XSMessage* and *CSF_XHMessage* are now optional.
English messages (XSMessage/*XSTEP.us* and SHMessage/*SHAPE.us*) are now embedded into source code
English messages (XSMessage/\*XSTEP.us* and SHMessage/\*SHAPE.us*) are now embedded into source code
and automatically loaded when environment variables are not set.
* *CSF_ShadersDirectory* is not required any more, though it still can be used to load custom shaders.
Mandatory GLSL resources are now embedded into source code.
@@ -1678,3 +1678,124 @@ Standard_Boolean meshing_new()
Some public methods of the class BRepFilletAPI_MakeChamfer are released from excess arguments:
- method Add for symmetric chamfer now takes only 2 arguments: distance and edge;
- method GetDistAngle now takes only 3 arguments: index of contour, distance and angle.
@subsection upgrade_740_aspects Aspects unification
Fill Area, Line and Marker aspects (classes *Graphic3d_AspectFillArea3d*, *Graphic3d_AspectLine3d*, *Graphic3d_AspectMarker3d* and *Graphic3d_AspectText3d*)
have been merged into new class *Graphic3d_Aspects* providing a single state for rendering primitives of any type.
The old per-primitive type aspect classes have been preserved as sub-classes of *Graphic3d_Aspects* with default values close to the previous behavior.
All aspects except Graphic3d_AspectFillArea3d define Graphic3d_TOSM_UNLIT shading model.
The previous approach with dedicated aspects per primitive type was handy in simplified case, but lead to confusion otherwise.
In fact, drawing points or lines with lighting applied is a valid use case, but only *Graphic3d_AspectFillArea3d* previously defined necessary material properties.
As aspects for different primitive types have been merged, Graphic3d_Group does no more provide per-type aspect properties.
Existing code relying on old behavior and putting interleaved per-type aspects into single Graphic3d_Group should be updated.
For example, the following pseudo-code will not work anymore, because all *SetGroupPrimitivesAspect* calls will setup the same property:
~~~~
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< overrides previous aspect
Handle(Graphic3d_ArrayOfSegments) aLines = new Graphic3d_ArrayOfSegments (2);
Handle(Graphic3d_ArrayOfTriangles) aTris = new Graphic3d_ArrayOfTriangles (3);
aGroup->AddPrimitiveArray (aLines); //!< both arrays will use the same aspect
aGroup->AddPrimitiveArray (aTris);
~~~~
To solve the problem, the code should be modified to either put primitives into dedicated groups (preferred approach), or using *SetPrimitivesAspect* in proper order:
~~~~
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
Handle(Graphic3d_ArrayOfTriangles) aTris = new Graphic3d_ArrayOfTriangles (3);
aGroup->AddPrimitiveArray (aTris);
Handle(Graphic3d_ArrayOfSegments) aLines = new Graphic3d_ArrayOfSegments (2);
aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array will use the new aspect
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):
1. *AIS_InteractiveObject::SetToUpdate()*, marking existing presentation for update.
This is main invalidation API, which is expected to be followed by *AIS_InteractiveContext::Update()* call.
2. *AIS_InteractiveObject::myToRecomputeModes* + *myRecomputeEveryPrs*.
This is auxiliary invalidation API, used internally by AIS_InteractiveContext::SetColor()/UnsetColor() and similar modification methods.
The latter one has been removed to avoid confusion and unexpected behavior.
In addition, two methods *AIS_InteractiveObject::Update()* have been deprecated in favor of new *AIS_InteractiveObject::UpdatePresentations()* recomputing only invalidated presentations.
Custom presentations implementing interface methods *AIS_InteractiveObject::SetColor()* and others should be revised to use *AIS_InteractiveObject::SetToUpdate()*
or updating presentation without recomputation (see *AIS_InteractiveObject::SynchronizeAspects()* and *AIS_InteractiveObject::replaceAspects()*).
@subsection upgrade_740_interiorstyles Interior styles
* *Aspect_IS_HOLLOW* is now an alias to *Aspect_IS_EMPTY* and does not implicitly enables drawing mesh edges anymore.
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_EMPTY) to get previous behavior of Aspect_IS_HOLLOW style.
* *Aspect_IS_HIDDENLINE* does not implicitly enables drawing mesh edges anymore.
Specify Graphic3d_AspectFillArea3d::SetDrawEdges(true) with Graphic3d_AspectFillArea3d::SetInteriorStyle(Aspect_IS_HIDDENLINE) to get previous behavior of Aspect_IS_HIDDENLINE style.
@subsection upgrade_740_modedprs PrsMgr and SelectMgr hierarchy clean up
Proxy classes *Prs3d_Presentation*, *PrsMgr_ModedPresentation* and *PrsMgr_Prs* have been removed.
Code iterating through the list of low-level structures AIS_InteractiveObject::Presentations() should be updated to access PrsMgr_Presentation directly.
Forward declarations of *Prs3d_Presentation* should be corrected, since it is now a typedef to *Graphic3d_Structure*.
Proxy classes *SelectBasics_SensitiveEntity* and *SelectBasics_EntityOwner* have been removed - *Select3D_SensitiveEntity* and *SelectMgr_EntityOwner* should be now used directly instead.
@subsection upgrade_740_geproj Custom defines within env.bat
*env.bat* produced by Visual Studio project generator *genproj.bat* has been modified so that *%CSF_DEFINES%* variable is reset to initial state.
Custom building environment relying on old behavior and setting extra macros within *%CSF_DEFINES%* before env.bat should be updated
to either modify custom.bat or setup new variable *%CSF_DEFINES_EXTRA%* instead.
@subsection upgrade_740_BVH_in_BOP Switching Boolean Operations algorithm to use BVH tree instead of UB tree
Since OCCT 7.4.0 Boolean Operations algorithm uses BVH tree instead of UBTree to find the pairs of entities with interfering bounding boxes.
The following API changes have been made:
* BOPTools_BoxBndTree and BOPTools_BoxBndTreeSelector have been removed. Use the BOPTools_BoxTree and BOPTools_BoxTreeSelector instead.
* BOPTools_BoxSelector::SetBox() method now accepts the BVH_Box instead of Bnd_Box.
* 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

@@ -23,7 +23,7 @@ WARNINGS = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = Standard_EXPORT Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC
PREDEFINED = Standard_EXPORT Standard_NODISCARD Standard_OVERRIDE:=override __Standard_API __Draw_API Handle(a):=Handle<a> DEFINE_STANDARD_ALLOC DEFINE_NCOLLECTION_ALLOC "Standard_DEPRECATED=//! @deprecated "
GENERATE_HTML = YES
GENERATE_LATEX = NO
SEARCH_INCLUDES = YES

View File

@@ -1,4 +1,4 @@
Draw Test Harness {#occt_user_guides__test_harness}
Draw Test Harness {#occt_user_guides__test_harness}
===============================
@tableofcontents
@@ -5593,8 +5593,9 @@ Draw provides command to create curves and surfaces by approximation.
* **2dapprox** fits a curve through 2d points;
* **appro** fits a curve through 3d points;
* **surfapp** and **grilapp** fit a surface through 3d points;
* **2dinterpolate** interpolates a curve.
* **surfapp** and **grilapp** fit a surface through 3d points by approximation;
* **surfint** fit a surface through 3d points by interpolation;
* **2dinterpole** interpolates a curve.
@subsubsection occt_draw_6_8_1 appro, dapprox
@@ -5614,17 +5615,28 @@ Let us pick points and they will be fitted
2dapprox c 10
~~~~~
@subsubsection occt_draw_6_8_2 surfapp, grilapp
@subsubsection occt_draw_6_8_2 surfapp, grilapp, surfint
Syntax:
~~~~~
surfapp name nbupoints nbvpoints x y z ....
or
surfapp name nbupoints nbvpoints surf [periodic_flag = 0]
grilapp name nbupoints nbvpoints xo dx yo dy z11 z12 ...
surfint name surf nbupoints nbvpoints [periodic_flag = 0]
~~~~~
* **surfapp** fits a surface through an array of u and v points, nbupoints*nbvpoints.
* **grilapp** has the same function, but the x,y coordinates of the points are on a grid starting at x0,y0 with steps dx,dy.
* **surfapp** can take array of points from other input surface, if alternative syntax
**surfapp** name nbupoints nbvpoints surf [periodic_flag = 0]
is used.
Both command use for fitting approximation algorithm.
**surfint** uses interpolation algorithm and can take array of point only from other input surface.
Optional parameter **periodic_flag** allows to get correct periodical surfaces in U direction.
U direction of result surface corresponds colums of initial array of points.
If **periodic_flag** = 1, algorithm uses first row of array as last row and builds periodical surface.
**Example:**
~~~~~

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

@@ -226,8 +226,6 @@ Selection is implemented as a combination of various algorithms divided among se
#### SelectBasics
*SelectBasics* package contains basic classes and interfaces for selection. The most notable are:
- *SelectBasics_SensitiveEntity* -- the base definition of a sensitive entity;
- *SelectBasics_EntityOwner* -- the base definition of the an entity owner -- the link between the sensitive entity and the object to be selected;
- *SelectBasics_PickResult* -- the structure for storing quantitative results of detection procedure, for example, depth and distance to the center of geometry;
- *SelectBasics_SelectingVolumeManager* -- the interface for interaction with the current selection frustum.
@@ -247,9 +245,11 @@ Each custom sensitive entity must inherit at least *SelectBasics_SensitiveEntity
- triangulation;
- wire.
Each basic sensitive entity inherits *Select3D_SensitiveEntity*, which is a child class of *SelectBasics_SensitiveEntity*.
Each basic sensitive entity inherits *Select3D_SensitiveEntity*.
The package also contains two auxiliary classes, *Select3D_SensitivePoly* and *Select3D_SensitiveSet*.
*Select3D_SensitiveEntity* -- the base definition of a sensitive entity.
*Select3D_SensitiveSet* -- a base class for all complex sensitive entities that require the third level BVH usage. It implements traverse of the tree and defines an interface for the methods that check sub-entities.
*Select3D_SensitivePoly* -- describes an arbitrary point set and implements basic functions for selection. It is important to know that this class does not perform any internal data checks. Hence, custom implementations of sensitive entity inherited from *Select3D_SensitivePoly* must satisfy the terms of Separating Axis Theorem to use standard OCCT overlap detection methods.
@@ -1793,12 +1793,11 @@ Create facet attributes.
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = new Graphic3d_AspectFillArea3d();
Graphic3d_MaterialAspect aBrassMaterial (Graphic3d_NOM_BRASS);
Graphic3d_MaterialAspect aGoldMaterial (Graphic3d_NOM_GOLD);
aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID);
aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID_WIREFRAME);
aFaceAspect->SetInteriorColor (aMyColor);
aFaceAspect->SetDistinguishOn ();
aFaceAspect->SetFrontMaterial (aGoldMaterial);
aFaceAspect->SetBackMaterial (aBrassMaterial);
aFaceAspect->SetEdgeOn();
~~~~~
Create text attributes.

10
genproj
View File

@@ -19,10 +19,6 @@ anOpt2=$2
anOpt3=$3
anOpt4=$4
anOpt5=$5
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
if [ ! -e "${aScriptPath}/custom.sh" ]; then
tclsh "${aScriptPath}/adm/genconf.tcl"
@@ -37,6 +33,12 @@ source "${aScriptPath}/custom.sh"
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
if [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
cd $aScriptPath
tclsh "./adm/start.tcl" genproj ${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5

View File

@@ -49,6 +49,10 @@ if "%aPlatform%" == "" (
)
)
set aPrjFmt=%PRJFMT%
if "%aPrjFmt%" == "" ( set "aPrjFmt=vcxproj" )
if "%aPrjFmt%" == "vcxproj" ( set "aPrjFmt=%VCFMT%" )
cd %~dp0
%TCL_EXEC% %~dp0adm/start.tcl genproj %VCFMT% %aPlatform% %3 %4 %5
%TCL_EXEC% %~dp0adm/start.tcl genproj %aPrjFmt% %aPlatform% %3 %4 %5
SET "PATH=%OLD_PATH%"

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

@@ -155,7 +155,6 @@ class ISession2D_InteractiveObject;
class V3d_Viewer;
class SelectMgr_SelectableObject;
class TCollection_AsciiString;
class SelectBasics_EntityOwner;
class gp_Pnt2d;
//{{AFX_INSERT_LOCATION}}

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

@@ -17,7 +17,8 @@ void ISession2D_Shape::Add(const TopoDS_Shape& aShape)
myListOfShape.Append(aShape);
myAlgo.Nullify();
myPolyAlgo.Nullify();
Update(); // protected method used to specify that the presentation are not up to date
SetToUpdate();
UpdatePresentations();
}
void ISession2D_Shape::Remove (const TopoDS_Shape& theShape)
@@ -42,23 +43,17 @@ void ISession2D_Shape::SetProjector (HLRAlgo_Projector& aProjector)
myProjector= aProjector;
myAlgo.Nullify();
myPolyAlgo.Nullify();
Update(); // protected method used to specify that the presentation are not up to date
SetToUpdate();
UpdatePresentations();
};
void ISession2D_Shape::SetNbIsos(Standard_Integer& aNbIsos)
{
myNbIsos= aNbIsos;
myAlgo.Nullify();
// declare the mode 100 to 110 as non valid
for (int i=100;i<=110;i++)
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
// declare the mode 1100 to 1110 as non valid
for (int i=1100;i<=1110;i++)
Update(i,Standard_False); // protected method used to specify that the presentation are not up to date
{
myNbIsos= aNbIsos;
myAlgo.Nullify();
SetToUpdate();
UpdatePresentations();
};
void ISession2D_Shape::BuildAlgo()

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

@@ -14,9 +14,9 @@ Requirements for building sample:
* Android NDK r9d or newer
* Apache Ant 1.9.4 or higher
* OCCT compiled under Android platform and placed in directories:
* occt/libs/armeabi-v7a/*.so and occt/inc/*.hxx (libraries and include files of OCCT install)
* android/assets/opencascade/shared/Shaders/* (Shaders folder of OCCT install: /share/opencascade/resources/Shaders)
* 3rdparty/include/freetype2/*, 3rdparty/include/FreeImage.h and 3rdparty/libs/armeabi-v7a/libFreeImage.so and 3rdparty/libs/armeabi-v7a/libfreetype.so
* occt/libs/armeabi-v7a/\*.so and occt/inc/\*.hxx (libraries and include files of OCCT install)
* android/assets/opencascade/shared/Shaders/\* (Shaders folder of OCCT install: /share/opencascade/resources/Shaders)
* 3rdparty/include/freetype2/\*, 3rdparty/include/FreeImage.h and 3rdparty/libs/armeabi-v7a/libFreeImage.so and 3rdparty/libs/armeabi-v7a/libfreetype.so
It is also possible to to correct OCCT.pri file an get resources from another tree of directories.

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 );

View File

@@ -264,11 +264,11 @@ bfuse _model _model t_s
explode _model e
# Make a weld at joint edges of platform and wedge
blend _model _model 2 _model_26
blend _model _model 2 _model_27
blend _model _model 2 _model_28
blend _model _model 2 _model_29
blend _model _model 2 _model_31
blend _model _model 2 _model_30
blend _model _model 2 _model_32
# Cylinder on wedge
blend result _model 2 _model_161
@@ -276,8 +276,7 @@ blend result _model 2 _model_161
# Show result
pload VISUALIZATION
vinit Driver1/Viewer1/View1
vsetcolorbg 200 200 255
vdisplay result
vbackground -color 0.784314 0.784314 1
vdisplay -dispMode 1 result
vfit
vsetdispmode 1
vshowfaceboundary result 1
vaspects result -setFaceBoundaryDraw 1 -mostContinuity c2

View File

@@ -262,8 +262,7 @@ unifysamedom result p_1
# Show result
pload VISUALIZATION
vinit Driver1/Viewer1/View1
vsetcolorbg 200 200 255
vdisplay result
vbackground -color 0.784314 0.784314 1
vdisplay -dispMode 1 result
vfit
vsetdispmode 1
vshowfaceboundary result 1
vaspects result -setFaceBoundaryDraw 1

View File

@@ -53,7 +53,7 @@ for {set i 1} {$i <= 1} {incr i} {
# prepare a view
vinit Penrose w=1024 h=512
vsetcolorbg 255 255 255
vbackground -color WHITE
vrenderparams -rayTrace -fsaa on -reflections off -shadows off
# set camera position and adjust lights

View File

@@ -57,9 +57,7 @@ bcommon res b9 c2
# show result
donly res
trotate res 0 0 0 0 0 1 90
vinit
vdisplay res
vsetdispmode 1
vshowfaceboundary res 1 255 255 255
vaspects -isoontriangulation 1
vinit View1
vdisplay -dispMode 1 res
vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE -isoontriangulation 1
vfit

View File

@@ -19,7 +19,7 @@ restore $aBotLoc b
vinit View1 w=768 h=768
vclear
vsetdispmode 0
vsetcolorbg 255 255 255
vbackground -color WHITE
vbottom
puts "Getting cut projection..."

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

@@ -51,7 +51,7 @@ proc drawObjects {theRow theColor} {
uplevel #0 box $aBox $aCtr $aCtr $aCtr $aSize $aSize $aSize
uplevel #0 ttranslate $aSph $x $y 0
uplevel #0 ttranslate $aBox [expr $x + 10] $y 0
uplevel #0 vdisplay -noredraw $aSph $aBox
uplevel #0 vdisplay -noredraw -dispMode 1 $aSph $aBox
uplevel #0 vsetmaterial -noredraw $aSph $aBox $aMatIter
if {$theColor != ""} {
uplevel #0 vsetcolor -noredraw $aSph $aBox $theColor
@@ -64,21 +64,19 @@ proc drawObjects {theRow theColor} {
# setup 3D viewer content
pload MODELING VISUALIZATION
catch { vclose View1 }
vinit View1 w=768 h=768
vclear
vclose ALL
vinit View1 w=768 h=768
vtop
vglinfo
vsetgradientbg 180 200 255 180 180 180 2
vbackground -gradient 0.705882 0.784314 1 0.705882 0.705882 0.705882 -gradientMode VERTICAL
vlight -change 0 -dir 0.577 -0.577 -0.577
vsetdispmode 1
vrenderparams -msaa 8
# adjust scene bounding box
box bnd 0 0 0 180 210 1
vdisplay -noredraw bnd
vsetdispmode bnd 0
vdisplay -noredraw -dispMode 0 bnd
vfit
vremove -noredraw bnd
@@ -88,5 +86,3 @@ drawObjects 0 ""
drawObjects 1 red
drawObjects 2 green
drawObjects 3 blue1
#vfit
vzfit

View File

@@ -59,7 +59,7 @@ XShow D
vfit
vsetdispmode 1
vrenderparams -msaa 8
vsetcolorbg 255 255 255
vbackground -color WHITE
#param write.iges.brep.mode 1
#WriteIges D d:/pencil3.igs

View File

@@ -30,7 +30,7 @@ vsettransparency glass 0.6
vlight new spot pos -100 -100 300
# set white background and fit view
vsetcolorbg 255 255 255
vbackground -color WHITE
vfit
# set ray tracing

View File

@@ -129,7 +129,7 @@ vrenderparams -msaa 8
vsetcolor snowflake 0 0 0
vsetcolor lines 0 0 0
vsetcolor text 0 0 0
vsetcolorbg 255 255 255
vbackground -color WHITE
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

@@ -14,10 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS.hxx>
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <AIS.hxx>
#include <Bnd_Box.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
@@ -783,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)
{
@@ -801,7 +802,6 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
{
aPlane = surf2->Plane();
aSurfType = AIS_KOS_Plane;
Offset = 0.;
Result = Standard_True;
}
@@ -817,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;
}
}
@@ -826,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)
{
@@ -839,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
{
@@ -899,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;
}
}
//=======================================================================

View File

@@ -17,73 +17,26 @@
#ifndef _AIS_HeaderFile
#define _AIS_HeaderFile
#include <AIS_KindOfSurface.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <AIS_KindOfSurface.hxx>
#include <Prs3d_Drawer.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
class gp_Pnt;
class TopoDS_Shape;
class gp_Lin;
class Geom_Curve;
class TopoDS_Edge;
class Geom_Plane;
class TopoDS_Vertex;
class TopoDS_Face;
class gp_Pln;
class Geom_Surface;
class gp_Dir;
class Bnd_Box;
class gp_Elips;
class Prs3d_Presentation;
class AIS_Triangulation;
class AIS_InteractiveContext;
class AIS_GraphicTool;
class AIS_GlobalStatus;
class AIS_InteractiveObject;
class AIS_Point;
class AIS_Axis;
class AIS_Trihedron;
class AIS_PlaneTrihedron;
class AIS_Line;
class AIS_Circle;
class AIS_Plane;
class AIS_Shape;
class AIS_ConnectedInteractive;
class AIS_MultipleConnectedInteractive;
class AIS_DimensionOwner;
class AIS_Relation;
class AIS_EllipseRadiusDimension;
class AIS_MaxRadiusDimension;
class AIS_MinRadiusDimension;
class AIS_Chamf2dDimension;
class AIS_Chamf3dDimension;
class AIS_OffsetDimension;
class AIS_FixRelation;
class AIS_PerpendicularRelation;
class AIS_ParallelRelation;
class AIS_TangentRelation;
class AIS_ConcentricRelation;
class AIS_IdenticRelation;
class AIS_SymmetricRelation;
class AIS_MidPointRelation;
class AIS_EqualRadiusRelation;
class AIS_EqualDistanceRelation;
class AIS_TypeFilter;
class AIS_SignatureFilter;
class AIS_ExclusionFilter;
class AIS_AttributeFilter;
class AIS_C0RegularityFilter;
class AIS_BadEdgeFilter;
class AIS_Selection;
class Geom_Curve;
class Geom_Plane;
class Geom_Surface;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Shape;
class TopoDS_Vertex;
//! Application Interactive Services provide the means to create links between an application GUI viewer and
//! the packages which are used to manage selection and presentation.

View File

@@ -168,7 +168,7 @@ void AIS_Animation::StartTimer (const Standard_Real theStartPts,
{
if (myTimer.IsNull())
{
myTimer = new AIS_AnimationTimer();
myTimer = new Media_Timer();
}
myTimer->Stop();
myTimer->Seek (theStartPts);

View File

@@ -191,7 +191,7 @@ protected:
protected:
Handle(AIS_AnimationTimer) myTimer;
Handle(Media_Timer) myTimer;
TCollection_AsciiString myName; //!< animation name
NCollection_Sequence<Handle(AIS_Animation)>

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

@@ -15,60 +15,7 @@
#ifndef _AIS_AnimationTimer_HeaderFile
#define _AIS_AnimationTimer_HeaderFile
#include <OSD_Timer.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
//! Auxiliary class defining the animation timer.
class AIS_AnimationTimer : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationTimer, Standard_Transient)
public:
//! Empty constructor.
AIS_AnimationTimer() : myTimerFrom (0.0), myTimerSpeed (1.0) {}
//! Return elapsed time in seconds.
Standard_Real ElapsedTime() const
{
return myTimerFrom + myTimer.ElapsedTime() * myTimerSpeed;
}
//! Return playback speed coefficient (1.0 means normal speed).
Standard_Real PlaybackSpeed() const { return myTimerSpeed; }
//! Setup playback speed coefficient.
Standard_EXPORT void SetPlaybackSpeed (const Standard_Real theSpeed);
//! Return true if timer has been started.
Standard_Boolean IsStarted() const
{
return myTimer.IsStarted();
}
//! Start the timer.
void Start()
{
myTimer.Start();
}
//! Pause the timer.
Standard_EXPORT void Pause();
//! Stop the timer.
Standard_EXPORT void Stop();
//! Seek the timer to specified position.
Standard_EXPORT void Seek (const Standard_Real theTime);
protected:
OSD_Timer myTimer;
Standard_Real myTimerFrom;
Standard_Real myTimerSpeed;
};
DEFINE_STANDARD_HANDLE(AIS_AnimationTimer, Standard_Transient)
#include <Media_Timer.hxx>
typedef Media_Timer AIS_AnimationTimer;
#endif // _AIS_AnimationTimer_HeaderFile

View File

@@ -34,10 +34,8 @@
#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_Curve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS.hxx>
@@ -81,7 +79,7 @@ myIsXYZAxis(Standard_True)
Standard_Real aLength;
try {
aLength = UnitsAPI::AnyToLS(100. ,"mm");
} catch (Standard_Failure) {
} catch (Standard_Failure const&) {
aLength = 0.1;
}
DA->SetAxisLength(aLength,aLength,aLength);
@@ -199,8 +197,7 @@ void AIS_Axis::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(G
void AIS_Axis::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer)
{
Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner(this);
eown -> SelectBasics_EntityOwner::Set(3);
Handle(SelectMgr_EntityOwner) eown = new SelectMgr_EntityOwner (this, 3);
Handle(Select3D_SensitiveSegment) seg = new Select3D_SensitiveSegment(eown,
myPfirst,
myPlast);
@@ -221,7 +218,7 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(aCol);
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(aCol);
DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(aCol);
SynchronizeAspects();
}
//=======================================================================
@@ -230,7 +227,6 @@ void AIS_Axis::SetColor(const Quantity_Color &aCol)
//=======================================================================
void AIS_Axis::SetWidth(const Standard_Real aValue)
{
if(aValue<0.0) return;
if(aValue==0) UnsetWidth();
@@ -240,6 +236,7 @@ void AIS_Axis::SetWidth(const Standard_Real aValue)
DA->LineAspect(Prs3d_DP_XAxis)->SetWidth(aValue);
DA->LineAspect(Prs3d_DP_YAxis)->SetWidth(aValue);
DA->LineAspect(Prs3d_DP_ZAxis)->SetWidth(aValue);
SynchronizeAspects();
}
@@ -324,14 +321,13 @@ AcceptDisplayMode(const Standard_Integer aMode) const
//=======================================================================
void AIS_Axis::UnsetColor()
{
myDrawer->LineAspect()->SetColor(Quantity_NOC_RED);
hasOwnColor=Standard_False;
hasOwnColor = Standard_False;
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_NOC_TURQUOISE);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_NOC_TURQUOISE);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_NOC_TURQUOISE);
SynchronizeAspects();
}
//=======================================================================
//function : UnsetWidth
@@ -340,10 +336,10 @@ void AIS_Axis::UnsetColor()
void AIS_Axis::UnsetWidth()
{
myOwnWidth = 0.0;
myOwnWidth = 0.0f;
myDrawer->LineAspect()->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_YAxis)->SetWidth(1.);
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_ZAxis)->SetWidth(1.);
SynchronizeAspects();
}

View File

@@ -90,6 +90,7 @@ void AIS_CameraFrustum::SetColor (const Quantity_Color& theColor)
AIS_InteractiveObject::SetColor (theColor);
myDrawer->ShadingAspect()->SetColor (theColor);
myDrawer->LineAspect()->SetColor (theColor);
SynchronizeAspects();
}
//=======================================================================
@@ -107,6 +108,7 @@ void AIS_CameraFrustum::UnsetColor()
myDrawer->ShadingAspect()->SetColor (THE_DEFAULT_COLOR);
myDrawer->LineAspect()->SetColor (THE_DEFAULT_COLOR);
SynchronizeAspects();
}
//=======================================================================
@@ -117,6 +119,7 @@ void AIS_CameraFrustum::UnsetTransparency()
{
myDrawer->ShadingAspect()->SetTransparency (0.0f);
myDrawer->SetTransparency (0.0f);
SynchronizeAspects();
}
//=======================================================================
@@ -236,17 +239,18 @@ void AIS_CameraFrustum::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
return;
}
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
switch (theMode)
{
case AIS_Shaded:
{
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroup->AddPrimitiveArray (myTriangles);
}
Standard_FALLTHROUGH
case AIS_WireFrame:
{
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aGroup->AddPrimitiveArray (myBorders);
break;

View File

@@ -17,29 +17,13 @@
#ifndef _AIS_Chamf2dDimension_HeaderFile
#define _AIS_Chamf2dDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Real.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <AIS_KindOfDimension.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
#include <AIS_Relation.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <gp_Dir.hxx>
class Geom_Plane;
class TCollection_ExtendedString;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_Chamf2dDimension;
DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
//! A framework to define display of 2D chamfers.
@@ -48,10 +32,9 @@ DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
//! chamfer, or the angle if it is not.
class AIS_Chamf2dDimension : public AIS_Relation
{
DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension, AIS_Relation)
public:
//! Constructs the display object for 2D chamfers.
//! This object is defined by the face aFShape, the
//! dimension aVal, the plane aPlane and the text aText.
@@ -79,18 +62,7 @@ public:
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
@@ -101,14 +73,8 @@ private:
gp_Pnt myPntAttach;
gp_Dir myDir;
};
#include <AIS_Chamf2dDimension.lxx>
#endif // _AIS_Chamf2dDimension_HeaderFile

View File

@@ -17,28 +17,11 @@
#ifndef _AIS_Chamf3dDimension_HeaderFile
#define _AIS_Chamf3dDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Real.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <AIS_KindOfDimension.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class TCollection_ExtendedString;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
#include <AIS_Relation.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <gp_Dir.hxx>
class AIS_Chamf3dDimension;
DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
//! A framework to define display of 3D chamfers.
@@ -47,10 +30,9 @@ DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
//! chamfer, or the angle if it is not.
class AIS_Chamf3dDimension : public AIS_Relation
{
DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension, AIS_Relation)
public:
//! Constructs a display object for 3D chamfers.
//! This object is defined by the shape aFShape, the
//! dimension aVal and the text aText.
@@ -78,19 +60,8 @@ public:
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -100,14 +71,8 @@ private:
gp_Pnt myPntAttach;
gp_Dir myDir;
};
#include <AIS_Chamf3dDimension.lxx>
#endif // _AIS_Chamf3dDimension_HeaderFile

View File

@@ -112,6 +112,29 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
}
//=======================================================================
//function : replaceWithNewLineAspect
//purpose :
//=======================================================================
void AIS_Circle::replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
{
if (!myDrawer->HasLink())
{
myDrawer->SetLineAspect (theAspect);
return;
}
const Handle(Graphic3d_AspectLine3d) anAspectOld = myDrawer->LineAspect()->Aspect();
const Handle(Graphic3d_AspectLine3d) anAspectNew = !theAspect.IsNull() ? theAspect->Aspect() : myDrawer->Link()->LineAspect()->Aspect();
if (anAspectNew != anAspectOld)
{
myDrawer->SetLineAspect (theAspect);
Graphic3d_MapOfAspectsToAspects aReplaceMap;
aReplaceMap.Bind (anAspectOld, anAspectNew);
replaceAspects (aReplaceMap);
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -122,34 +145,41 @@ void AIS_Circle::SetColor(const Quantity_Color &aCol)
hasOwnColor=Standard_True;
myDrawer->SetColor (aCol);
Standard_Real WW = HasWidth() ? myOwnWidth :
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
1.;
if (!myDrawer->HasOwnLineAspect ())
myDrawer->SetLineAspect (new Prs3d_LineAspect(aCol,Aspect_TOL_SOLID,WW));
if (!myDrawer->HasOwnLineAspect())
{
Standard_Real WW = HasWidth() ? myOwnWidth :
myDrawer->HasLink() ?
AIS_GraphicTool::GetLineWidth (myDrawer->Link(), AIS_TOA_Line) :
1.;
replaceWithNewLineAspect (new Prs3d_LineAspect (aCol, Aspect_TOL_SOLID, WW));
}
else
{
myDrawer->LineAspect()->SetColor(aCol);
SynchronizeAspects();
}
}
//=======================================================================
//function : SetWidth
//purpose :
//=======================================================================
void AIS_Circle::SetWidth(const Standard_Real aValue)
{
myOwnWidth=aValue;
myOwnWidth = (Standard_ShortReal )aValue;
if (!myDrawer->HasOwnLineAspect ()) {
if (!myDrawer->HasOwnLineAspect())
{
Quantity_Color CC = Quantity_NOC_YELLOW;
if( HasColor() ) CC = myDrawer->Color();
else if(myDrawer->HasLink()) AIS_GraphicTool::GetLineColor (myDrawer->Link(), AIS_TOA_Line, CC);
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
} else
replaceWithNewLineAspect (new Prs3d_LineAspect (CC, Aspect_TOL_SOLID, aValue));
}
else
{
myDrawer->LineAspect()->SetWidth(aValue);
SynchronizeAspects();
}
}
@@ -161,15 +191,18 @@ void AIS_Circle::UnsetColor()
{
hasOwnColor = Standard_False;
Handle(Prs3d_LineAspect) NullAsp;
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
else{
if (!HasWidth())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Quantity_Color CC = Quantity_NOC_YELLOW;;
if( HasColor() ) CC = myDrawer->Color();
else if (myDrawer->HasLink()) AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
myDrawer->LineAspect()->SetColor(CC);
myDrawer->SetColor (CC);
SynchronizeAspects();
}
}
@@ -179,11 +212,13 @@ void AIS_Circle::UnsetColor()
//=======================================================================
void AIS_Circle::UnsetWidth()
{
Handle(Prs3d_LineAspect) NullAsp;
if (!HasColor()) myDrawer->SetLineAspect(NullAsp);
else{
Standard_Real WW = myDrawer->HasLink() ? AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.;
if (!HasColor())
{
replaceWithNewLineAspect (Handle(Prs3d_LineAspect)());
}
else
{
Standard_ShortReal WW = myDrawer->HasLink() ? (Standard_ShortReal )AIS_GraphicTool::GetLineWidth(myDrawer->Link(),AIS_TOA_Line) : 1.0f;
myDrawer->LineAspect()->SetWidth(WW);
myOwnWidth = WW;
}

View File

@@ -115,6 +115,9 @@ private:
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
//! Replace aspects of already computed groups with the new value.
void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
private:
Handle(Geom_Circle) myComponent;

View File

@@ -26,6 +26,7 @@
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_GraphicDriver.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Text.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
@@ -78,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;
}
}
//=======================================================================
@@ -107,6 +133,10 @@ AIS_ColorScale::AIS_ColorScale()
myTextHeight (20)
{
SetDisplayMode (0);
myDrawer->SetupOwnShadingAspect();
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Opaque);
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (Quantity_NOC_WHITE);
}
//=======================================================================
@@ -343,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;
}
@@ -381,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;
}
@@ -458,15 +476,6 @@ void AIS_ColorScale::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
const Standard_Integer aBarTop = myYPos + myHeight - aTitleOffset - aBarYOffset;
const Standard_Integer aBarHeight = aBarTop - aBarBottom;
// draw title
if (!myTitle.IsEmpty())
{
drawText (Prs3d_Root::CurrentGroup (thePrs), myTitle,
myXPos + mySpacing,
aBarTop + aBarYOffset,
Graphic3d_VTA_BOTTOM);
}
TColStd_SequenceOfExtendedString aLabels;
if (myLabelType == Aspect_TOCSD_USER)
{
@@ -496,11 +505,27 @@ void AIS_ColorScale::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
aColorBreadth += aTextWidth;
}
// draw title
Handle(Graphic3d_Group) aLabelsGroup;
if (!myTitle.IsEmpty()
|| !aLabels.IsEmpty())
{
aLabelsGroup = thePrs->NewGroup();
aLabelsGroup->SetGroupPrimitivesAspect (myDrawer->TextAspect()->Aspect());
}
if (!myTitle.IsEmpty())
{
drawText (aLabelsGroup, myTitle,
myXPos + mySpacing,
aBarTop + aBarYOffset,
Graphic3d_VTA_BOTTOM);
}
// draw colors
drawColorBar (thePrs, aBarBottom, aBarHeight, aTextWidth, aColorBreadth);
// draw Labels
drawLabels (thePrs, aLabels, aBarBottom, aBarHeight, aTextWidth, aColorBreadth);
drawLabels (aLabelsGroup, aLabels, aBarBottom, aBarHeight, aTextWidth, aColorBreadth);
}
//=======================================================================
@@ -627,7 +652,8 @@ void AIS_ColorScale::drawColorBar (const Handle(Prs3d_Presentation)& thePrs,
}
}
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroup->AddPrimitiveArray (aTriangles);
const Quantity_Color aFgColor (hasOwnColor ? myDrawer->Color() : Quantity_NOC_WHITE);
@@ -642,7 +668,7 @@ void AIS_ColorScale::drawColorBar (const Handle(Prs3d_Presentation)& thePrs,
//function : drawLabels
//purpose :
//=======================================================================
void AIS_ColorScale::drawLabels (const Handle(Prs3d_Presentation)& thePrs,
void AIS_ColorScale::drawLabels (const Handle(Graphic3d_Group)& theGroup,
const TColStd_SequenceOfExtendedString& theLabels,
const Standard_Integer theBarBottom,
const Standard_Integer theBarHeight,
@@ -716,14 +742,14 @@ void AIS_ColorScale::drawLabels (const Handle(Prs3d_Presentation)& thePrs,
Standard_Integer aPos2 = aNbLabels - 1 - i2;
if (aFilter && !(aPos1 % aFilter))
{
drawText (Prs3d_Root::CurrentGroup (thePrs), theLabels.Value (i1 + 1),
drawText (theGroup, theLabels.Value (i1 + 1),
anXLeft, anYBottom + Standard_Integer(i1 * aStepY + anAscent),
Graphic3d_VTA_CENTER);
aLast1 = i1;
}
if (aFilter && !(aPos2 % aFilter))
{
drawText (Prs3d_Root::CurrentGroup (thePrs), theLabels.Value (i2 + 1),
drawText (theGroup, theLabels.Value (i2 + 1),
anXLeft, anYBottom + Standard_Integer(i2 * aStepY + anAscent),
Graphic3d_VTA_CENTER);
aLast2 = i2;
@@ -746,7 +772,7 @@ void AIS_ColorScale::drawLabels (const Handle(Prs3d_Presentation)& thePrs,
if (i0 != -1)
{
drawText (Prs3d_Root::CurrentGroup (thePrs), theLabels.Value (i0 + 1),
drawText (theGroup, theLabels.Value (i0 + 1),
anXLeft, anYBottom + Standard_Integer(i0 * aStepY + anAscent),
Graphic3d_VTA_CENTER);
}
@@ -769,8 +795,8 @@ void AIS_ColorScale::drawFrame (const Handle(Prs3d_Presentation)& thePrs,
aPrim->AddVertex (theX, theY, 0.0);
Handle(Graphic3d_AspectLine3d) anAspect = new Graphic3d_AspectLine3d (theColor, Aspect_TOL_SOLID, 1.0);
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
aGroup->SetPrimitivesAspect (anAspect);
Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
aGroup->SetGroupPrimitivesAspect (anAspect);
aGroup->AddPrimitiveArray (aPrim);
}
@@ -784,17 +810,14 @@ void AIS_ColorScale::drawText (const Handle(Graphic3d_Group)& theGroup,
const Graphic3d_VerticalTextAlignment theVertAlignment)
{
const Handle(Prs3d_TextAspect)& anAspect = myDrawer->TextAspect();
theGroup->SetPrimitivesAspect (anAspect->Aspect());
theGroup->Text (theText,
gp_Ax2 (gp_Pnt (theX, theY, 0.0), gp::DZ()),
anAspect->Height(),
anAspect->Angle(),
anAspect->Orientation(),
Graphic3d_HTA_LEFT,
theVertAlignment,
Standard_True,
Standard_False); // has own anchor
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 (aText);
}
//=======================================================================

View File

@@ -406,7 +406,7 @@ private:
Standard_Integer computeMaxLabelWidth (const TColStd_SequenceOfExtendedString& theLabels) const;
//! Draw labels.
void drawLabels (const Handle(Prs3d_Presentation)& thePrs,
void drawLabels (const Handle(Graphic3d_Group)& theGroup,
const TColStd_SequenceOfExtendedString& theLabels,
const Standard_Integer theBarBottom,
const Standard_Integer theBarHeight,

View File

@@ -124,8 +124,7 @@ Handle(AIS_ColoredDrawer) AIS_ColoredShape::CustomAspects (const TopoDS_Shape& t
{
aDrawer = new AIS_ColoredDrawer (myDrawer);
myShapeColors.Bind (theShape, aDrawer);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
SetToUpdate();
}
return aDrawer;
}
@@ -141,8 +140,7 @@ void AIS_ColoredShape::ClearCustomAspects()
return;
}
myShapeColors.Clear();
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
SetToUpdate();
}
//=======================================================================
@@ -157,8 +155,7 @@ void AIS_ColoredShape::UnsetCustomAspects (const TopoDS_Shape& theShape,
return;
}
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
SetToUpdate();
if (theToUnregister)
{
myShapeColors.UnBind (theShape);
@@ -183,8 +180,6 @@ void AIS_ColoredShape::SetCustomColor (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setColor (aDrawer, theColor);
aDrawer->SetOwnColor (theColor);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -202,8 +197,6 @@ void AIS_ColoredShape::SetCustomTransparency (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setTransparency (aDrawer, theTransparency);
aDrawer->SetOwnTransparency (theTransparency);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -221,8 +214,6 @@ void AIS_ColoredShape::SetCustomWidth (const TopoDS_Shape& theShape,
const Handle(AIS_ColoredDrawer)& aDrawer = CustomAspects (theShape);
setWidth (aDrawer, theLineWidth);
aDrawer->SetOwnWidth (theLineWidth);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
}
//=======================================================================
@@ -232,11 +223,6 @@ void AIS_ColoredShape::SetCustomWidth (const TopoDS_Shape& theShape,
void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
{
setColor (myDrawer, theColor);
myDrawer->SetColor (theColor);
hasOwnColor = Standard_True;
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
@@ -262,6 +248,7 @@ void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
aDrawer->FaceBoundaryAspect()->SetColor (theColor);
}
}
AIS_Shape::SetColor (theColor);
}
//=======================================================================
@@ -271,10 +258,6 @@ void AIS_ColoredShape::SetColor (const Quantity_Color& theColor)
void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
{
setWidth (myDrawer, theLineWidth);
myOwnWidth = theLineWidth;
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
@@ -296,6 +279,16 @@ void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
aDrawer->FaceBoundaryAspect()->SetWidth (theLineWidth);
}
}
AIS_Shape::SetWidth (theLineWidth);
}
//=======================================================================
//function : UnsetWidth
//purpose :
//=======================================================================
void AIS_ColoredShape::UnsetWidth()
{
SetWidth (1.0f);
}
//=======================================================================
@@ -305,10 +298,6 @@ void AIS_ColoredShape::SetWidth (const Standard_Real theLineWidth)
void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
{
setTransparency (myDrawer, theValue);
myDrawer->SetTransparency ((Standard_ShortReal )theValue);
LoadRecomputable (AIS_WireFrame);
LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
@@ -322,6 +311,7 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
aDrawer->ShadingAspect()->SetTransparency (theValue, myCurrentFacingModel);
}
}
AIS_Shape::SetTransparency (theValue);
}
//=======================================================================
@@ -330,27 +320,7 @@ void AIS_ColoredShape::SetTransparency (const Standard_Real theValue)
//=======================================================================
void AIS_ColoredShape::UnsetTransparency()
{
myDrawer->SetTransparency (0.0f);
if (myDrawer->HasOwnShadingAspect())
{
myDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
if (!HasColor()
&& !HasMaterial()
&& !myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
{
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
}
}
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(Prs3d_Drawer)& aDrawer = anIter.Value();
if (aDrawer->HasOwnShadingAspect())
{
aDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
}
}
SynchronizeAspects();
SetTransparency (0.0f);
}
//=======================================================================
@@ -360,10 +330,6 @@ void AIS_ColoredShape::UnsetTransparency()
void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
{
setMaterial (myDrawer, theMaterial, HasColor(), IsTransparent());
//myOwnMaterial = theMaterial;
hasOwnMaterial = Standard_True;
LoadRecomputable (AIS_Shaded);
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
@@ -373,6 +339,7 @@ void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), aDrawer->HasOwnTransparency());
}
}
AIS_Shape::SetMaterial (theMaterial);
}
//=======================================================================
@@ -545,8 +512,8 @@ void AIS_ColoredShape::ComputeSelection (const Handle(SelectMgr_Selection)& theS
Handle(SelectMgr_SelectableObject) aThis (this);
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (theSelection->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (aSelEntIter.Value()->BaseSensitive()->OwnerId());
anOwner->Set (aThis);
const Handle(SelectMgr_EntityOwner)& anOwner = aSelEntIter.Value()->BaseSensitive()->OwnerId();
anOwner->SetSelectable (aThis);
}
StdSelect_BRepSelectionTool::PreBuildBVH (theSelection);
@@ -610,7 +577,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
const DataMapOfDrawerCompd& theDrawerClosedFaces,
const Standard_Integer theMode)
{
Handle(Graphic3d_Group) anOpenGroup, aClosedGroup;
Handle(Graphic3d_Group) anOpenGroup, aClosedGroup, anEdgesGroup;
for (size_t aShType = 0; aShType <= (size_t )TopAbs_SHAPE; ++aShType)
{
const Standard_Boolean isClosed = aShType == TopAbs_SHAPE;
@@ -664,7 +631,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
{
if (aShadedGroup.IsNull())
{
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
aShadedGroup = thePrs->NewGroup();
aShadedGroup->SetClosed (isClosed);
}
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
@@ -673,18 +640,15 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
if (aDrawer->FaceBoundaryDraw())
{
Handle(Graphic3d_ArrayOfSegments) aBndSegments = StdPrs_ShadedShape::FillFaceBoundaries (aShapeDraw);
if (!aBndSegments.IsNull())
if (Handle(Graphic3d_ArrayOfSegments) aBndSegments = StdPrs_ShadedShape::FillFaceBoundaries (aShapeDraw, aDrawer->FaceBoundaryUpperContinuity()))
{
if (aShadedGroup.IsNull())
if (anEdgesGroup.IsNull())
{
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
aShadedGroup->SetClosed (isClosed);
anEdgesGroup = thePrs->NewGroup();
}
Handle(Graphic3d_AspectLine3d) aBoundaryAspect = aDrawer->FaceBoundaryAspect()->Aspect();
aShadedGroup->SetPrimitivesAspect (aBoundaryAspect);
aShadedGroup->AddPrimitiveArray (aBndSegments);
anEdgesGroup->SetPrimitivesAspect (aDrawer->FaceBoundaryAspect()->Aspect());
anEdgesGroup->AddPrimitiveArray (aBndSegments);
}
}
}

View File

@@ -81,11 +81,16 @@ public: //! @name global aspects
//! Sets transparency value.
Standard_EXPORT virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE;
//! Sets the material aspect.
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& theAspect) Standard_OVERRIDE;
public:
//! Removes the setting for transparency in the reconstructed compound shape.
Standard_EXPORT virtual void UnsetTransparency() Standard_OVERRIDE;
//! Sets the material aspect.
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& theAspect) Standard_OVERRIDE;
//! Setup line width of entire shape.
Standard_EXPORT virtual void UnsetWidth() Standard_OVERRIDE;
protected: //! @name override presentation computation

View File

@@ -17,24 +17,11 @@
#ifndef _AIS_ConcentricRelation_HeaderFile
#define _AIS_ConcentricRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Real.hxx>
#include <gp_Dir.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
#include <gp_Dir.hxx>
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_ConcentricRelation;
DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
//! A framework to define a constraint by a relation of
@@ -44,10 +31,9 @@ DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
//! relation of concentricity can be extended.
class AIS_ConcentricRelation : public AIS_Relation
{
DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation, AIS_Relation)
public:
//! Constructs the display object for concentric relations
//! between shapes.
//! This object is defined by the two shapes, aFShape
@@ -65,19 +51,8 @@ public:
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -95,13 +70,6 @@ private:
gp_Dir myDir;
gp_Pnt myPnt;
};
#endif // _AIS_ConcentricRelation_HeaderFile

View File

@@ -23,7 +23,6 @@
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Projector.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
@@ -92,12 +91,12 @@ void AIS_ConnectedInteractive::connect (const Handle(AIS_InteractiveObject)& the
void AIS_ConnectedInteractive::Disconnect()
{
for(Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
for (PrsMgr_Presentations::Iterator aPrsIter (myPresentations); aPrsIter.More(); aPrsIter.Next())
{
const Handle(PrsMgr_Presentation)& aPrs = myPresentations (aPrsIter).Presentation();
const Handle(PrsMgr_Presentation)& aPrs = aPrsIter.Value();
if (!aPrs.IsNull())
{
aPrs->Presentation()->DisconnectAll (Graphic3d_TOC_DESCENDANT);
aPrs->DisconnectAll (Graphic3d_TOC_DESCENDANT);
}
}
}
@@ -112,7 +111,7 @@ void AIS_ConnectedInteractive::Compute (const Handle(PrsMgr_PresentationManager3
if (HasConnection())
{
thePrs->Clear (Standard_False);
thePrs->RemoveAll();
thePrs->DisconnectAll (Graphic3d_TOC_DESCENDANT);
if (!myReference->HasInteractiveContext())
{
@@ -234,7 +233,7 @@ void AIS_ConnectedInteractive::ComputeSelection (const Handle(SelectMgr_Selectio
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (TheRefSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
if (Handle(Select3D_SensitiveEntity) aSensitive = Handle(Select3D_SensitiveEntity)::DownCast (aSelEntIter.Value()->BaseSensitive()))
if (const Handle(Select3D_SensitiveEntity)& aSensitive = aSelEntIter.Value()->BaseSensitive())
{
// Get the copy of SE3D
if (Handle(Select3D_SensitiveEntity) aNewSensitive = aSensitive->GetConnected())
@@ -272,7 +271,7 @@ void AIS_ConnectedInteractive::computeSubShapeSelection (const Handle(SelectMgr_
Shapes2EntitiesMap aShapes2EntitiesMap;
for (NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>::Iterator aSelEntIter (aRefSel->Entities()); aSelEntIter.More(); aSelEntIter.Next())
{
if (Handle(Select3D_SensitiveEntity) aSE = Handle(Select3D_SensitiveEntity)::DownCast (aSelEntIter.Value()->BaseSensitive()))
if (const Handle(Select3D_SensitiveEntity)& aSE = aSelEntIter.Value()->BaseSensitive())
{
if (Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast (aSE->OwnerId()))
{

View File

@@ -335,31 +335,31 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
if (myDrawer->DimensionAspect()->IsText3d())
{
// text width produced by BRepFont
Font_BRepFont aFont (aTextAspect->Aspect()->Font().ToCString(),
aTextAspect->Aspect()->GetTextFontAspect(),
aTextAspect->Height());
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
Font_BRepFont aFont;
if (aFont.FindAndInit (aTextAspect->Aspect()->Font(), aTextAspect->Aspect()->GetTextFontAspect(), aTextAspect->Height(), Font_StrictLevel_Any))
{
Standard_Utf32Char aCurrChar = *anIter;
Standard_Utf32Char aNextChar = *(++anIter);
theWidth += aFont.AdvanceX (aCurrChar, aNextChar);
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
{
Standard_Utf32Char aCurrChar = *anIter;
Standard_Utf32Char aNextChar = *(++anIter);
theWidth += aFont.AdvanceX (aCurrChar, aNextChar);
}
}
}
else
{
// Text width for 1:1 scale 2D case
Handle(Font_FTFont) aFont = new Font_FTFont();
aFont->Init (aTextAspect->Aspect()->Font().ToCString(),
aTextAspect->Aspect()->GetTextFontAspect(),
(const unsigned int)aTextAspect->Height(),
THE_2D_TEXT_RESOLUTION);
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
Font_FTFontParams aFontParams;
aFontParams.PointSize = (unsigned int )aTextAspect->Height();
aFontParams.Resolution = THE_2D_TEXT_RESOLUTION;
if (Handle(Font_FTFont) aFont = Font_FTFont::FindAndCreate (aTextAspect->Aspect()->Font(), aTextAspect->Aspect()->GetTextFontAspect(), aFontParams, Font_StrictLevel_Any))
{
Standard_Utf32Char aCurrChar = *anIter;
Standard_Utf32Char aNextChar = *(++anIter);
theWidth += (Standard_Real) aFont->AdvanceX (aCurrChar, aNextChar);
for (NCollection_Utf8Iter anIter = anUTFString.Iterator(); *anIter != 0; )
{
Standard_Utf32Char aCurrChar = *anIter;
Standard_Utf32Char aNextChar = *(++anIter);
theWidth += (Standard_Real) aFont->AdvanceX (aCurrChar, aNextChar);
}
}
}
@@ -431,6 +431,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
const TCollection_ExtendedString& theText,
const Standard_Integer theLabelPosition)
{
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
if (myDrawer->DimensionAspect()->IsText3d())
{
// getting font parameters
@@ -517,7 +518,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
aCenterOfLabel.Transform (aTextPlaneTrsf);
gp_Ax2 aFlippingAxes (aCenterOfLabel, GetPlane().Axis().Direction(), aTextDir);
Prs3d_Root::CurrentGroup (thePresentation)->SetFlippingOptions (Standard_True, aFlippingAxes);
aGroup->SetFlippingOptions (Standard_True, aFlippingAxes);
// draw text
if (myDrawer->DimensionAspect()->IsTextShaded())
@@ -546,11 +547,14 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
{
myDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (aColor, Aspect_TOL_SOLID, 1.0));
}
myDrawer->FreeBoundaryAspect()->Aspect()->SetColor (aColor);
// drawing text
StdPrs_WFShape::Add (thePresentation, aTextShape, myDrawer);
if (Handle(Graphic3d_ArrayOfPrimitives) anEdges = StdPrs_WFShape::AddAllEdges (aTextShape, myDrawer))
{
aGroup->SetGroupPrimitivesAspect (myDrawer->FreeBoundaryAspect()->Aspect());
aGroup->AddPrimitiveArray (anEdges);
}
}
Prs3d_Root::CurrentGroup (thePresentation)->SetFlippingOptions (Standard_False, gp_Ax2());
@@ -565,7 +569,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
// generate primitives for 2D text
myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
Prs3d_Text::Draw (Prs3d_Root::CurrentGroup (thePresentation),
Prs3d_Text::Draw (aGroup,
myDrawer->DimensionAspect()->TextAspect(),
theText,
theTextPos);
@@ -599,6 +603,7 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta
gp_Pnt aTextPos = ElCLib::Value (theExtensionSize, anExtensionLine);
gp_Dir aTextDir = theExtensionDir;
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
drawText (thePresentation,
aTextPos,
aTextDir,
@@ -630,16 +635,17 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta
aSensitiveCurve.Append (anExtStart);
aSensitiveCurve.Append (anExtEnd);
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
if (!myDrawer->DimensionAspect()->IsText3d() && theMode == ComputeMode_All)
{
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_True);
aGroup->SetStencilTestOptions (Standard_True);
}
Handle(Graphic3d_AspectLine3d) aDimensionLineStyle = myDrawer->DimensionAspect()->LineAspect()->Aspect();
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionLineStyle);
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (anExtPrimitive);
aGroup->SetPrimitivesAspect (aDimensionLineStyle);
aGroup->AddPrimitiveArray (anExtPrimitive);
if (!myDrawer->DimensionAspect()->IsText3d() && theMode == ComputeMode_All)
{
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_False);
aGroup->SetStencilTestOptions (Standard_False);
}
}
@@ -733,8 +739,6 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
case LabelPosition_HCenter:
{
// add label on dimension or extension line to presentation
Prs3d_Root::NewGroup (thePresentation);
gp_Pnt aTextPos = IsTextPositionCustom() ? myFixedTextPosition
: (aCenterLineBegin.XYZ() + aCenterLineEnd.XYZ()) * 0.5;
gp_Dir aTextDir = aDimensionLine.Direction();
@@ -742,6 +746,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
// add text primitives
if (theMode == ComputeMode_All || theMode == ComputeMode_Text)
{
thePresentation->NewGroup();
drawText (thePresentation,
aTextPos,
aTextDir,
@@ -799,24 +804,28 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
aDimensionAspect->TextAspect()->SetVerticalJustification (aTextJustificaton);
// main dimension line, short extension
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
{
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_True);
}
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
{
Prs3d_Root::CurrentGroup (thePresentation)->SetStencilTestOptions (Standard_False);
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
{
aGroup->SetStencilTestOptions (Standard_True);
}
aGroup->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
aGroup->AddPrimitiveArray (aPrimSegments);
if (!aDimensionAspect->IsText3d() && theMode == ComputeMode_All)
{
aGroup->SetStencilTestOptions (Standard_False);
}
}
// add arrows to presentation
Prs3d_Root::NewGroup (thePresentation);
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
if (!theIsOneSide)
{
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
if (!theIsOneSide)
{
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
}
}
if (!isArrowsExternal)
@@ -825,19 +834,18 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
}
// add arrow extension lines to presentation
Prs3d_Root::NewGroup (thePresentation);
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aFirstArrowEnd, aFirstExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
if (!theIsOneSide)
{
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aSecondArrowEnd, aSecondExtensionDir,
aFirstArrowEnd, aFirstExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
if (!theIsOneSide)
{
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aSecondArrowEnd, aSecondExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
}
}
}
break;
}
// ------------------------------------------------------------------------ //
@@ -847,45 +855,48 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
case LabelPosition_Left:
{
// add label on dimension or extension line to presentation
Prs3d_Root::NewGroup (thePresentation);
// Left extension with the text
DrawExtension (thePresentation, anExtensionSize,
isArrowsExternal
? aFirstArrowEnd
: aFirstArrowBegin,
aFirstExtensionDir,
aLabelString,
aLabelWidth,
theMode,
aLabelPosition);
{
// Left extension with the text
DrawExtension (thePresentation, anExtensionSize,
isArrowsExternal
? aFirstArrowEnd
: aFirstArrowBegin,
aFirstExtensionDir,
aLabelString,
aLabelWidth,
theMode,
aLabelPosition);
}
// add dimension line primitives
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
{
// add central dimension line
Prs3d_Root::NewGroup (thePresentation);
{
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
// add graphical primitives
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
aPrimSegments->AddVertex (aCenterLineBegin);
aPrimSegments->AddVertex (aCenterLineEnd);
// add graphical primitives
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
aPrimSegments->AddVertex (aCenterLineBegin);
aPrimSegments->AddVertex (aCenterLineEnd);
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
aGroup->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
aGroup->AddPrimitiveArray (aPrimSegments);
// add selection primitives
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
aSensitiveCurve.Append (aCenterLineBegin);
aSensitiveCurve.Append (aCenterLineEnd);
// add selection primitives
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
aSensitiveCurve.Append (aCenterLineBegin);
aSensitiveCurve.Append (aCenterLineEnd);
}
// add arrows to presentation
Prs3d_Root::NewGroup (thePresentation);
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
if (!theIsOneSide)
{
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
if (!theIsOneSide)
{
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
}
}
if (!isArrowsExternal || theIsOneSide)
@@ -894,11 +905,11 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
}
// add extension lines for external arrows
Prs3d_Root::NewGroup (thePresentation);
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aSecondArrowEnd, aSecondExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
{
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aSecondArrowEnd, aSecondExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
}
}
break;
@@ -910,7 +921,6 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
case LabelPosition_Right:
{
// add label on dimension or extension line to presentation
Prs3d_Root::NewGroup (thePresentation);
// Right extension with text
DrawExtension (thePresentation, anExtensionSize,
@@ -925,27 +935,30 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
{
// add central dimension line
Prs3d_Root::NewGroup (thePresentation);
{
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
// add graphical primitives
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
aPrimSegments->AddVertex (aCenterLineBegin);
aPrimSegments->AddVertex (aCenterLineEnd);
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
// add graphical primitives
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments (2);
aPrimSegments->AddVertex (aCenterLineBegin);
aPrimSegments->AddVertex (aCenterLineEnd);
aGroup->SetGroupPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
aGroup->AddPrimitiveArray (aPrimSegments);
// add selection primitives
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
aSensitiveCurve.Append (aCenterLineBegin);
aSensitiveCurve.Append (aCenterLineEnd);
// add selection primitives
SelectionGeometry::Curve& aSensitiveCurve = mySelectionGeom.NewCurve();
aSensitiveCurve.Append (aCenterLineBegin);
aSensitiveCurve.Append (aCenterLineEnd);
}
// add arrows to presentation
Prs3d_Root::NewGroup (thePresentation);
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
if (!theIsOneSide)
{
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
thePresentation->NewGroup();
DrawArrow (thePresentation, aSecondArrowBegin, aSecondArrowDir);
if (!theIsOneSide)
{
DrawArrow (thePresentation, aFirstArrowBegin, aFirstArrowDir);
}
}
if (!isArrowsExternal || theIsOneSide)
@@ -954,11 +967,11 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
}
// add extension lines for external arrows
Prs3d_Root::NewGroup (thePresentation);
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aFirstArrowEnd, aFirstExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
{
DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(),
aFirstArrowEnd, aFirstExtensionDir,
THE_EMPTY_LABEL, 0.0, theMode, LabelPosition_None);
}
}
break;
@@ -968,7 +981,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
// add flyout lines to presentation
if (theMode == ComputeMode_All)
{
Prs3d_Root::NewGroup (thePresentation);
Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup();
Handle(Graphic3d_ArrayOfSegments) aPrimSegments = new Graphic3d_ArrayOfSegments(4);
aPrimSegments->AddVertex (theFirstPoint);
@@ -977,8 +990,8 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
aPrimSegments->AddVertex (theSecondPoint);
aPrimSegments->AddVertex (aLineEndPoint);
Prs3d_Root::CurrentGroup (thePresentation)->SetPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
aGroup->SetGroupPrimitivesAspect (aDimensionAspect->LineAspect()->Aspect());
aGroup->AddPrimitiveArray (aPrimSegments);
}
mySelectionGeom.IsComputed = Standard_True;

View File

@@ -1,5 +1,4 @@
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
// Copyright (c) 2018-2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -12,14 +11,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// math_Gauss.lxx
// lpa, le 28/01/92
#ifndef _AIS_DragAction_HeaderFile
#define _AIS_DragAction_HeaderFile
inline Standard_Boolean math_Gauss::IsDone() const { return Done; }
inline Standard_OStream& operator<<(Standard_OStream& o, const math_Gauss& mG)
//! Dragging action.
enum AIS_DragAction
{
mG.Dump(o);
return o;
}
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)
};
#endif // _AIS_DragAction_HeaderFile

View File

@@ -17,32 +17,12 @@
#ifndef _AIS_EqualDistanceRelation_HeaderFile
#define _AIS_EqualDistanceRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
#include <Prs3d_Drawer.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <AIS_TypeOfDist.hxx>
class TopoDS_Shape;
#include <DsgPrs_ArrowSide.hxx>
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class TopoDS_Edge;
class Bnd_Box;
class gp_Pnt;
class TopoDS_Vertex;
class AIS_EqualDistanceRelation;
DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
//! A framework to display equivalent distances between
@@ -52,10 +32,9 @@ DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
//! These distances are used to compare shapes by this vector alone.
class AIS_EqualDistanceRelation : public AIS_Relation
{
DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
public:
//! Constructs a framework to display equivalent
//! distances between the shapes aShape1, aShape2,
//! aShape3, aShape4 and the plane aPlane.
@@ -105,19 +84,8 @@ public:
//! a line or a circle.
Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -135,14 +103,8 @@ private:
gp_Pnt myPoint3;
gp_Pnt myPoint4;
};
#include <AIS_EqualDistanceRelation.lxx>
#endif // _AIS_EqualDistanceRelation_HeaderFile

View File

@@ -17,31 +17,17 @@
#ifndef _AIS_EqualRadiusRelation_HeaderFile
#define _AIS_EqualRadiusRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Edge;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_EqualRadiusRelation;
DEFINE_STANDARD_HANDLE(AIS_EqualRadiusRelation, AIS_Relation)
class AIS_EqualRadiusRelation : public AIS_Relation
{
DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation, AIS_Relation)
public:
//! Creates equal relation of two arc's radiuses.
//! If one of edges is not in the given plane,
//! the presentation method projects it onto the plane.
@@ -56,19 +42,8 @@ public:
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
@@ -82,13 +57,6 @@ private:
gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint;
};
#endif // _AIS_EqualRadiusRelation_HeaderFile

View File

@@ -17,32 +17,11 @@
#ifndef _AIS_FixRelation_HeaderFile
#define _AIS_FixRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Wire.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class Geom_Plane;
class TopoDS_Wire;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class TopoDS_Vertex;
class Geom_Curve;
class TopoDS_Edge;
class gp_Lin;
class gp_Circ;
class AIS_FixRelation;
DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
//! Constructs and manages a constraint by a fixed
@@ -55,9 +34,8 @@ DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
//! object.
class AIS_FixRelation : public AIS_Relation
{
DEFINE_STANDARD_RTTIEXT(AIS_FixRelation, AIS_Relation)
public:
//! initializes the vertex aShape, the
//! plane aPlane and the wire aWire, which connects
@@ -98,16 +76,6 @@ public:
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_FixRelation,AIS_Relation)
protected:
private:
@@ -141,11 +109,6 @@ private:
};
#include <AIS_FixRelation.lxx>
#endif // _AIS_FixRelation_HeaderFile

View File

@@ -17,21 +17,14 @@
#ifndef _AIS_IdenticRelation_HeaderFile
#define _AIS_IdenticRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <gp_Pnt.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_Real.hxx>
#include <TColStd_ListOfTransient.hxx>
class TopoDS_Shape;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class Geom_Line;
class gp_Pnt;
class Geom_Circle;
@@ -40,8 +33,6 @@ class TopoDS_Wire;
class TopoDS_Vertex;
class gp_Dir;
class AIS_IdenticRelation;
DEFINE_STANDARD_HANDLE(AIS_IdenticRelation, AIS_Relation)
//! Constructs a constraint by a relation of identity

View File

@@ -37,7 +37,6 @@
#include <Prs3d_PlaneAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_PresentableObject.hxx>
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
@@ -107,7 +106,6 @@ AIS_InteractiveContext::AIS_InteractiveContext(const Handle(V3d_Viewer)& MainVie
myMainPM(new PrsMgr_PresentationManager3d(MainViewer->StructureManager())),
myMainVwr(MainViewer),
myMainSel(new StdSelect_ViewerSelector3d()),
myWasLastMain(Standard_False),
myToHilightSelected(Standard_True),
mySelection(new AIS_Selection()),
myFilters(new SelectMgr_OrFilter()),
@@ -189,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 :
@@ -426,8 +447,7 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
setContextToObject (theIObj);
if (!myObjects.IsBound (theIObj))
{
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
myObjects.Bind (theIObj, aStatus);
setObjectStatus (theIObj, AIS_DS_Displayed, theDispMode, theSelectionMode);
myMainVwr->StructureManager()->RegisterObject (theIObj);
myMainPM->Display(theIObj, theDispMode);
if (theSelectionMode != -1)
@@ -504,8 +524,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
{
Standard_Integer aDispMode, aHiMod, aSelModeDef;
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
myObjects.Bind (theIObj, aStatus);
setObjectStatus (theIObj, AIS_DS_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
myMainVwr->StructureManager()->RegisterObject (theIObj);
}
@@ -756,7 +775,9 @@ Standard_Boolean AIS_InteractiveContext::IsHilighted (const Handle(SelectMgr_Ent
return myObjects (anObj)->IsHilighted();
}
return theOwner->IsSelected();
const Handle(Prs3d_Drawer)& aStyle = getSelStyle (anObj, theOwner);
const Standard_Integer aHiMode = getHilightMode (anObj, aStyle, -1);
return theOwner->IsHilighted (myMainPM, aHiMode);
}
//=======================================================================
@@ -952,7 +973,8 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
return;
}
theIObj->Update (theAllModes);
theIObj->SetToUpdate();
theIObj->UpdatePresentations (theAllModes);
if (!theToUpdateViewer)
{
return;
@@ -1006,13 +1028,7 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
return;
}
TColStd_ListOfInteger aPrsModes;
theIObj->ToBeUpdated (aPrsModes);
for (TColStd_ListIteratorOfListOfInteger aPrsModesIt (aPrsModes); aPrsModesIt.More(); aPrsModesIt.Next())
{
theIObj->Update (aPrsModesIt.Value(), Standard_False);
}
theIObj->UpdatePresentations();
mgrSelector->Update(theIObj);
if (theUpdateViewer)
@@ -1369,63 +1385,6 @@ void AIS_InteractiveContext::SetCurrentFacingModel (const Handle(AIS_Interactive
}
}
//=======================================================================
//function : redisplayPrsRecModes
//purpose :
//=======================================================================
void AIS_InteractiveContext::redisplayPrsRecModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer)
{
if (theIObj->RecomputeEveryPrs())
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
for (TColStd_ListIteratorOfListOfInteger aModes (theIObj->ListOfRecomputeModes()); aModes.More(); aModes.Next())
{
theIObj->Update (aModes.Value(), Standard_False);
}
theIObj->UpdateSelection();
theIObj->SetRecomputeOk();
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
//function : redisplayPrsModes
//purpose :
//=======================================================================
void AIS_InteractiveContext::redisplayPrsModes (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer)
{
if (theIObj->RecomputeEveryPrs())
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
TColStd_ListOfInteger aModes;
theIObj->ToBeUpdated (aModes);
for (TColStd_ListIteratorOfListOfInteger aModeIter (aModes); aModeIter.More(); aModeIter.Next())
{
theIObj->Update (aModeIter.Value(), Standard_False);
}
theIObj->SetRecomputeOk();
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
//function : SetColor
//purpose :
@@ -1441,7 +1400,11 @@ void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theI
setContextToObject (theIObj);
theIObj->SetColor (theColor);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1486,7 +1449,11 @@ void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_Interacti
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnDeviationCoefficient (theCoefficient);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1516,7 +1483,11 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_Intera
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnHLRDeviationCoefficient (theCoefficient);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1545,7 +1516,11 @@ void AIS_InteractiveContext::SetDeviationAngle (const Handle(AIS_InteractiveObje
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnDeviationAngle (theAngle);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1574,15 +1549,10 @@ void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveO
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetAngleAndDeviation (theAngle);
if (theIObj->RecomputeEveryPrs())
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
theIObj->Update (Standard_True);
theIObj->UpdateSelection();
}
else
{
Update (theIObj, theToUpdateViewer);
UpdateCurrentViewer();
}
}
@@ -1611,7 +1581,11 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_Interacti
}
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetHLRAngleAndDeviation (theAngle);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1639,7 +1613,11 @@ void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveO
}
Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj);
aShape->SetOwnHLRDeviationAngle (theAngle);
redisplayPrsModes (theIObj, theToUpdateViewer);
aShape->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1655,7 +1633,11 @@ void AIS_InteractiveContext::UnsetColor (const Handle(AIS_InteractiveObject)& th
}
theIObj->UnsetColor();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1701,23 +1683,27 @@ void AIS_InteractiveContext::SetWidth (const Handle(AIS_InteractiveObject)& theI
setContextToObject (theIObj);
theIObj->SetWidth (theWidth);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
if (!myLastinMain.IsNull() && myLastinMain->IsSameSelectable (theIObj))
theIObj->UpdatePresentations();
if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable (theIObj))
{
if (myLastinMain->IsAutoHilight())
if (myLastPicked->IsAutoHilight())
{
const Standard_Integer aHiMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
myLastinMain->HilightWithColor (myMainPM,
myLastinMain->IsSelected() ? getSelStyle (theIObj, myLastinMain) : getHiStyle (theIObj, myLastinMain),
myLastPicked->HilightWithColor (myMainPM,
myLastPicked->IsSelected() ? getSelStyle (theIObj, myLastPicked) : getHiStyle (theIObj, myLastPicked),
aHiMode);
}
else
{
theIObj->HilightOwnerWithColor (myMainPM,
myLastinMain->IsSelected() ? getSelStyle (theIObj, myLastinMain) : getHiStyle (theIObj, myLastinMain),
myLastinMain);
myLastPicked->IsSelected() ? getSelStyle (theIObj, myLastPicked) : getHiStyle (theIObj, myLastPicked),
myLastPicked);
}
}
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1733,7 +1719,11 @@ void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& th
}
theIObj->UnsetWidth();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1751,7 +1741,11 @@ void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& t
setContextToObject (theIObj);
theIObj->SetMaterial (theMaterial);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1766,7 +1760,11 @@ void AIS_InteractiveContext::UnsetMaterial (const Handle(AIS_InteractiveObject)&
return;
}
theIObj->UnsetMaterial();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1796,7 +1794,11 @@ void AIS_InteractiveContext::SetTransparency (const Handle(AIS_InteractiveObject
}
theIObj->SetTransparency (theValue);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1812,7 +1814,11 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
}
theIObj->UnsetTransparency();
redisplayPrsRecModes (theIObj, theToUpdateViewer);
theIObj->UpdatePresentations();
if (theToUpdateViewer)
{
UpdateCurrentViewer();
}
}
//=======================================================================
@@ -1822,6 +1828,7 @@ void AIS_InteractiveContext::UnsetTransparency (const Handle(AIS_InteractiveObje
void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)& theAspect,
const Standard_Boolean theToUpdateViewer)
{
Standard_DISABLE_DEPRECATION_WARNINGS
Standard_Boolean isFound = Standard_False;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
@@ -1829,6 +1836,7 @@ void AIS_InteractiveContext::SetSelectedAspect (const Handle(Prs3d_BasicAspect)&
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (aSelIter.Value()->Selectable());
anObj->SetAspect (theAspect);
}
Standard_ENABLE_DEPRECATION_WARNINGS
if (isFound && theToUpdateViewer)
{
@@ -1951,42 +1959,18 @@ void AIS_InteractiveContext::GetDefModes (const Handle(AIS_InteractiveObject)& t
void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateviewer)
{
Handle(AIS_GlobalStatus) aStatus;
if (theIObj.IsNull()
|| !myObjects.IsBound (theIObj))
|| !myObjects.Find (theIObj, aStatus)
|| aStatus->GraphicStatus() == AIS_DS_Erased)
{
return;
}
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
if (aStatus->GraphicStatus() == AIS_DS_Erased)
{
return;
}
if (aStatus->IsHilighted())
{
Standard_DISABLE_DEPRECATION_WARNINGS
if (IsCurrent (theIObj))
{
AddOrRemoveCurrentObject (theIObj, Standard_False);
}
else if (myMainPM->IsHighlighted (theIObj, aStatus->DisplayMode()))
{
unhighlightGlobal (theIObj);
}
Standard_ENABLE_DEPRECATION_WARNINGS
}
unhighlightOwners (theIObj);
myMainPM->SetVisibility (theIObj, aStatus->DisplayMode(), Standard_False);
if (aStatus->IsHilighted()
&& theIObj->HasHilightMode())
{
unhighlightGlobal (theIObj);
}
if (!myLastPicked.IsNull()
&& myLastPicked->IsSameSelectable (theIObj))
{
@@ -2042,8 +2026,9 @@ void AIS_InteractiveContext::unhighlightOwners (const Handle(AIS_InteractiveObje
void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateviewer)
{
Handle(AIS_GlobalStatus) aStatus;
if (theIObj.IsNull()
|| !myObjects.IsBound (theIObj))
|| !myObjects.Find (theIObj, aStatus))
{
// for cases when reference shape of connected interactives was not displayed
// but its selection primitives were calculated
@@ -2052,7 +2037,6 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
return;
}
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
unhighlightOwners (theIObj);
myMainPM->Erase (theIObj, -1);
@@ -2093,7 +2077,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
const Handle(SelectMgr_SelectableObject)& anObj = theIObj; // to avoid ambiguity
mgrSelector->Remove (anObj);
myObjects.UnBind (theIObj);
setObjectStatus (theIObj, AIS_DS_None, -1, -1);
myMainVwr->StructureManager()->UnregisterObject (theIObj);
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
@@ -2101,13 +2085,11 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
aDefViewIter.Value()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
if (!myLastinMain.IsNull())
if (!myLastPicked.IsNull())
{
if (myLastinMain->IsSameSelectable (theIObj)
|| myLastPicked->IsSameSelectable(theIObj))
if (myLastPicked->IsSameSelectable (theIObj))
{
clearDynamicHighlight();
myLastinMain.Nullify();
myLastPicked.Nullify();
}
}
@@ -2161,15 +2143,12 @@ Standard_Boolean AIS_InteractiveContext::ClearDetected (Standard_Boolean theToRe
myCurDetected = 0;
myCurHighlighted = 0;
myDetectedSeq.Clear();
myLastPicked = myLastinMain;
myWasLastMain = Standard_True;
Standard_Boolean toUpdate = Standard_False;
if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
{
toUpdate = Standard_True;
clearDynamicHighlight();
}
myLastinMain.Nullify();
myLastPicked.Nullify();
myMainSel->ClearPicked();
if (toUpdate && theToRedrawImmediate)
@@ -2460,6 +2439,13 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
{
Handle(AIS_MultipleConnectedInteractive) theObj (Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly));
theObj->Disconnect (theObjToDisconnect);
if (!myObjects.IsBound (theObjToDisconnect))
{
// connected presentation might contain displayed presentations
myMainPM->Erase (theObjToDisconnect, -1);
theObjToDisconnect->ErasePresentations (true);
}
const Handle(SelectMgr_SelectableObject)& anObj = theObjToDisconnect; // to avoid ambiguity
mgrSelector->Remove (anObj);
}
@@ -2484,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;
@@ -2528,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);
}
}
//=======================================================================
@@ -2559,3 +2553,38 @@ 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 :
//=======================================================================
void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
const AIS_DisplayStatus theStatus,
const Standard_Integer theDispMode,
const Standard_Integer theSelectionMode)
{
if (theStatus != AIS_DS_None)
{
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
myObjects.Bind (theIObj, aStatus);
}
else
myObjects.UnBind (theIObj);
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theIObj->Children()); aPrsIter.More(); aPrsIter.Next())
{
Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
if (aChild.IsNull())
continue;
setObjectStatus (aChild, theStatus, theDispMode, theSelectionMode);
}
}

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