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

Compare commits

..

94 Commits

Author SHA1 Message Date
kgv
850d0c5d90 # Use float sRGB values for finding a color name 2019-09-21 15:04:59 +03:00
kgv
dd8e065f5f # update test cases 2019-09-21 15:04:16 +03:00
kgv
dcf2a3737e 0030991: Draw Harness - ViewerTest::ParseColors() defines out-of-range alpha component 2019-09-21 11:41:40 +03:00
kgv
8541e78cde #Quantity_Color::Name() - look for nearest sRGB color rather than nearest linear RGB color. 2019-09-20 22:34:58 +03:00
kgv
e67b461e6c Test cases have been updated to new sRGB rendered results. 2019-09-20 15:46:57 +03:00
kgv
341e87e4ae 0029528: Visualization, TKOpenGl - allow defining sRGB textures
Quantity_Color definition has been modified to store RGB components
in linear color space within Quantity_TOC_RGB type.
Standard colors defined by Quantity_NameOfColor enumeration has been updated accordingly.
New Quantity_TOC_sRGB type has been introduced to handle RGB components in non-linear sRGB color space.

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

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

vreadpixel - added argument -sRGB printing color in sRGB color space.
2019-09-20 13:19:39 +03:00
kgv
8f7b001d68 0030952: Draw Harness, ViewerTest - add command showing on-screen GUI for configuring material properties 2019-09-20 13:19:39 +03:00
kgv
7103ac61c3 0029902: Data Exchange, XCAF - provide extended Material definition for visualization purposes
Introduced new attribute XCAFDoc_VisMaterial storing visualization material definition.
2019-09-20 13:19:39 +03:00
kgv
f2f06fbc45 0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.

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

Quantity_Color::ColorToHex() now rounds-up float values to closest integer.
Quantity_ColorRGBA::ColorToHex() - added method formatting color into hex with alpha component.

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

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

Draw Harness command AISColor has been corrected to take color name instead of enumeration index.

vdrawtext command now uses ViewerTest::ParseColor() for parsing color argument, so that it accepts hex.
vreadpixel command now has been extended with -hex argument for printing color in hex format.
XSetColor command has been extended to accept color names and hex.
2019-09-20 13:19:36 +03:00
gka
5859be3886 0030302: XCAF - Typo in XCAFDoc_GeomTolerance
Typo in the XCAFDoc_GeomTolerance.cxx where Loc is used instead of aPnt was corrected.
2019-09-14 11:45:37 +03:00
gka
d45b7860a5 0030113: Data Exchange - STL file in text format with "Facet" keywords can't be imported
Case-sensitive method strncmp used in the REStl_Reader cosidered register of letter was replaced on the method _strnicmp for Windows and strncasecmp for Linux and MacOs
Test script for case 0030113
2019-09-14 11:45:36 +03:00
agv
0cdaa8a4a5 0030831: ShapeFix algorithm (creation of seam edge) takes too long time with thin faces
In class ShapeFix_ComposeShell the U- and V-closedness of input face is taken immediately avoiding the error when the face is small in any of these dimensions.
Test case for bug 0030831
2019-09-14 11:45:36 +03:00
abv
3b80dc166a 0030948: Configuration, CMake - problem building with CMake 3.15.2
Minor corrections in CMake procedures and include statements
2019-09-14 11:45:35 +03:00
mzernova
fdae2107d9 0030946: Visualization - Image_AlienPixMap ignores 1-bit pixelformat when using FreeImage
Convert 1-bit image to 8-bit one during its loading because only greyscale images are supported by visualization
2019-09-14 11:45:35 +03:00
kgv
44b80414d3 0030775: Foundation Classes - Preserve application-defined top-level exception filter
New overload for method OSD::SetSignal() is added accepting argument specifying how to set or unset handlers.
New enum OSD_SignalMode describes different modes of signal handlers setting used in extended version of OSD::SetSignal().
Method OSD::SignalMode() returns mode set by the last call to SetSignal().
Method OSD::IsFloatingSignalSet() is changed to return value based on actual floating point exception flags (rather than on variable set by previous call to SetSignal()).

Added new method OSD::SetThreadLocalSignal() intended to setup thread-specific handlers (e.g. _set_se_translator() on Windows) and FPE settings.
OSD_ThreadPool and Media_PlayerContext now use new method instead of OSD::SetSignal(), to avoid overriding global handlers.

dsetsignal syntax has been extended to support choice of signal handling mode.

DRAW command OCC30775 is added allowing to test signal handling in multithreaded process.
2019-09-14 11:45:34 +03:00
mzernova
b1492cb30f 0022777: Visualization - Unsafe way to get attribute values from MeshVS_Drawer
Set default values for local variables used for storing values that are obtained by MeshVS_Drawer::Get****() methods
2019-09-14 10:49:50 +03:00
iko
5c225e8e07 0030963: Visualization, TKOpenGl - texture unit error during FFP global texture's parameters processing
The texture units used in FFP texture functions are correct now.
2019-09-14 10:49:49 +03:00
oan
3068c3bb65 0030959: OSD_Parallel_TBB: number of execution threads is strictly limited by the root scope
Do not limit number of available threads by number of items processed within the root scope due to possibility of spawning of an additional threads within the subscopes.
2019-09-14 10:49:48 +03:00
tma
ac293bde7f 0030957: Data Exchange - Assembly item Id should not start with '/' symbol
Fix test case: added parsing of the output of the dump note command
2019-09-11 18:48:14 +03:00
jgv
a53d3975c9 0023380: BRepOffsetAPI_MakeFilling fails and leaves boundary faces with high tolerance
Avoid exception: use BRep_Builder for building wire instead of using BRepLib_MakeWire.
2019-09-09 19:27:59 +03:00
aml
94beb42a68 0029858: Modeling Data - Regression in GeomAPI_ExtremaCurveCurve
Fix Newton's minimum projection algorithm onto boundaries in case of conditional optimization.
Add possibility to detect several optimal points at initialization of the math_GlobOptMin.
2019-09-09 19:26:39 +03:00
bugmaster
5a7808160e Increment OCCT version up to 7.4.0beta 2019-09-06 19:24:56 +03:00
drazmyslovich
9063f1e089 0030870: Data Exchange - Add the support for empty draughting models and empty presentation layer assignments for step import
Protections to avoid exception in the methods  RWStepVisual_RWDraughtingModel::ReadStep and RWStepVisual_RWPresentationLayerAssignment::ReadStep for case when assigned items are absent were added
2019-09-06 19:24:56 +03:00
abv
fa68c1e116 0029979: Data Exchange - Crash by reading STEP file
Added work-around against specific problem of ORIENTED_EDGE referring to another ORIENTED_EDGE instead of EDGE_CURVE.
Added handling of edges with null EDGE_CURVE, to allow passing the translation further instead of exception.

Off-topic: text of warning message is corrected in genproj

Added test bugs step bug29979
2019-09-06 19:23:19 +03:00
emv
ba165db3d3 0030880: Modeling Algorithms - Bug in BRepExtrema_ExtCF
Use the BRepTopAdaptor_FClass2d instead of BRepClass_FaceClassifier in BRepExtrema_ExtCF for classification of the found intersection points.
2019-09-06 19:23:19 +03:00
vro
f2c862db07 0030704: Modeling Data, Bnd_OBB - Oriented bounding box gives a wrong result if a box is added to a void box
Added protection on a void box to methods Bnd_OBB::Add() to escape taking into account "heap trash" coordinates of a void box.
2019-09-06 19:23:18 +03:00
drazmyslovich
a90dd15e6b 0030876: Data Exchange - StepToTopoDS edge translation should be resistant to malformed parameter values
Corrected misprint in the method CheckPCurves of the class StepToTopoDS_TranslateEdgeLoop for case when higher bound of the range of pcurve on the edge greater then last parameter of the pcurve.
Added check on the not periodic flag for pcurve when range pcurve on the edge is adjusted to parameters pcurve.
2019-09-06 19:23:17 +03:00
gka
f9c58d7c4e 0029269: Improvement for thread safety of the STEP translator - cleanup
Removal of unused stuff and some protections implemented within #29269
2019-09-06 18:26:44 +03:00
msv
ce64c9ad5e 0030778: [Regression to 7.3.0] Extrema raises exception StdFail_InfiniteSolutions
The exception StdFail_InfiniteSolutions has been suppressed in all Points() methods.
2019-09-06 18:26:44 +03:00
ifv
dec7af167b 0030196: [REGRESSION] Modeling Algorithms - Crash in BRepBuilderAPI_GTransform
Test case is added
2019-09-06 18:26:43 +03:00
kgv
14c7f553a9 0030942: Draw Harness, ViewerTest - command vdefaults should abort script on unknown argument 2019-09-06 18:26:42 +03:00
aml
7a74087601 0027534: [Regression to 6.9.1]: Infinite loop in Curve on Surface projection algorithm
Add test case.
2019-09-06 18:26:42 +03:00
kgv
9eefb360a7 0030846: Foundation Classes - StorageInfo violates the C++ One Definition Rule
Local definitions have been put into anonymouse namespace within files
OSD_MAllocHook.cxx and NCollection_BaseAllocator.cxx.
2019-09-06 18:26:41 +03:00
drazmyslovich
3f50e94e33 0029717: Shape Healing - ShapeFix_Face::FixSmallAreaWire delivers a face with wrong-oriented wires + 1 small crash-fix
- Fix FixSmallAreaWire for the reversed faces.

- Add nullptr check for FixOrient...

- Test bugs heal bug25923 is corrected to avoid relying on wrong orientation of face after fixing small wire
2019-09-06 18:26:41 +03:00
kgv
bbd8ce1008 0030721: Visualization - Arrows in dimensions are drawn behind some other lines after applying 30716
AIS_Dimension::DrawArrow() now disables polygon offsets for drawing 2D arrow,
so that it is expected to be drawn at the same depth as dimension line.
2019-09-05 18:01:39 +03:00
abv
30870f51f4 Test for 0023979: Performance problem of STEP export for large files 2019-09-04 18:34:07 +03:00
nds
741c4f3ecc 0030728: Visualization - using one implementation of highlight/unhighlight in context 2019-09-04 18:05:55 +03:00
kgv
611684187d 0029516: Visualization - eliminate redundant property Graphic3d_MaterialAspect::ReflectionMode()
Decomposition of Ambient, Diffuse, Specular and Emissive properties has been eliminated within *Graphic3d_MaterialAspect* definition,
so that following methods of *Graphic3d_MaterialAspect* class have been removed:
SetReflectionMode(), SetReflectionModeOn(), Ambient(), Diffuse(), Emissive(), Specular(), SetAmbient(), SetDiffuse(), SetSpecular(), SetEmissive().

Graphic3d_NOM_NEON_GNC non-physical material definition has been corrected
and define WHITE emission color coefficient instead of YELLOW.

Added method Graphic3d_ClipPlane::SetCappingColor() for more straight-forward modification of Capping color in case of non-physical material.
Prs3d_ShadingAspect::Color() has been fixed to return InteriorColor instead of material color coefficient in case of non-physical material.
2019-09-04 15:13:18 +03:00
abv
c8428cb3e4 0030938: Configuration, genproj - Support building with VS 2019
Commands genproj and genconf are updated to support generation of projects for VS 2019, toolset v142
2019-09-04 15:08:14 +03:00
kgv
1202160b57 0030931: Visualization, TKOpenGl - do not render into GL_FRONT within "GDI Generic" renderer
OpenGl_Workspace now disables at initialization time
OpenGl_View::SetImmediateModeDrawToFront() property in case of "GDI Generic" OpenGL implementation.

OpenGl_View::redrawImmediate() - fixed no buffer swap in case of
myTransientDrawToFront without offscreen FBO.
2019-09-02 19:18:36 +03:00
kgv
59ee34efc0 0030930: Draw Harness, ViewerTest - add commands vlistcolors and vlistmaterials listing standard Colors and Materials
Introduced two new commands vlistcolors listing named colors and vlistmaterials listing standard materials.
These commands also can generate HTML table listing colors/materials with their properties.
vlistmaterials can generate OBJ model for comparing OCCT materials in different viewers.
New test cases use these commands for generating HTML tables.

Graphic3d_MaterialAspect::MaterialType() - added missing getter.
Corrected name of unlit shading model within vaspects and vrenderparams commands.
2019-09-02 19:17:23 +03:00
abv
7185019ae6 0028242: [Regression] HLR Poly Algo has broken edges
Added test hlr poly_hlr bug28242
2019-09-02 19:16:38 +03:00
abv
090ef04012 0029334: Simple offsets complicate geometry
Method BRepOffset::Surface() is used in simple offset algorithm to create offset surface, instead of direct and unconditional construction of new Geom_OffsetSurface instance.

Added test bugs modalg_7 bug29334
2019-09-02 08:08:37 +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
2041 changed files with 29025 additions and 23296 deletions

View File

@@ -274,7 +274,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
# emit warnings if there is unprocessed headers
# emit warnings if there are unprocessed headers
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
@@ -307,8 +307,8 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
# collect header files with name that does not contain its package one
string (FIND "${OCCT_FILE_NAME}" "${OCCT_PACKAGE}_" FOUND_INDEX)
if (NOT ${FOUND_INDEX} EQUAL 0)
string (REGEX MATCH "^${OCCT_PACKAGE}[_.]" IS_HEADER_MATHCING_PACKAGE "${OCCT_FILE_NAME}")
if (NOT IS_HEADER_MATHCING_PACKAGE)
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
endif()
endif()
@@ -355,12 +355,12 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not presented in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not present in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
else()
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is presented in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is present in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()

View File

@@ -58,7 +58,7 @@ set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
# detect installed Visual Studio 2017 instances by running vswhere.exe
# detect installed Visual Studio 2017+ instances by running vswhere.exe
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
@@ -69,6 +69,16 @@ if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Micr
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
if { [info exists ::env(VS140COMNTOOLS)] } {

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" "pro"}
set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
@@ -312,6 +312,7 @@ proc genproj {theFormat args} {
vc12 - Visual Studio 2013
vc14 - Visual Studio 2015
vc141 - Visual Studio 2017
vc142 - Visual Studio 2019
cbp - CodeBlocks
xcd - XCode
pro - Qt Creator
@@ -510,7 +511,8 @@ proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
"vc11" -
"vc12" -
"vc14" -
"vc141" { OS:MKVC $anOutDir $aModules $anAllSolution $theFormat $isUWP}
"vc141" -
"vc142" { OS:MKVC $anOutDir $aModules $anAllSolution $theFormat $isUWP}
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $thePlatform $theCmpl }
"xcd" {
set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
@@ -934,7 +936,7 @@ proc osutils:collectinc {theModules theIncPath} {
set anIncFiles [glob -tails -nocomplain -dir ${anIncPath} "*"]
foreach anIncFile ${anIncFiles} {
if { [lsearch -exact ${allHeaderFiles} ${anIncFile}] == -1 } {
puts "Warning: file ${anIncPath}/${anIncFile} is not presented in the sources and will be removed from ${theIncPath}!"
puts "Warning: file ${anIncPath}/${anIncFile} is not present in the sources and will be removed from ${theIncPath}"
file delete -force "${theIncPath}/${anIncFile}"
}
}
@@ -965,7 +967,7 @@ proc osutils:vcsolution:header { vcversion } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 2013\n"
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141"} {
} elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" || "$vcversion" == "vc142" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
@@ -1203,6 +1205,9 @@ proc osutils:vcproj:readtemplate {theVcVer isUWP isExec} {
if { $theVcVer == "vc141" } {
set aVCRTVer "vc14"
set aToolset "v141"
} elseif { $theVcVer == "vc142" } {
set aVCRTVer "vc14"
set aToolset "v142"
}
set what "$theVcVer"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -1716,6 +1716,75 @@ aGroup->SetPrimitivesAspect (myDrawer->LineAspect()->Aspect()); //!< next array
aGroup->AddPrimitiveArray (aLines);
~~~~
@subsection upgrade_740_materials Material definition
Decomposition of Ambient, Diffuse, Specular and Emissive properties has been eliminated within *Graphic3d_MaterialAspect* definition.
As result, the following methods of *Graphic3d_MaterialAspect* class have been removed: SetReflectionMode(), SetReflectionModeOn(), Ambient(), Diffuse(), Emissive(), Specular(), SetAmbient(), SetDiffuse(), SetSpecular(), SetEmissive().
Previously, computation of final value required the following code:
~~~~
Graphic3d_MaterialAspect theMaterial; Quantity_Color theInteriorColor;
Graphic3d_Vec3 anAmbient (0.0f);
if (theMaterial.ReflectionMode (Graphic3d_TOR_AMBIENT))
{
anAmbient = theMaterial.MaterialType (Graphic3d_MATERIAL_ASPECT)
? (Graphic3d_Vec3 )theInteriorColor * theMaterial.Ambient()
: (Graphic3d_Vec3 )theMaterial.AmbientColor() * theMaterial.Ambient();
}
~~~~
New code looks like this:
~~~~
Graphic3d_MaterialAspect theMaterial; Quantity_Color theInteriorColor;
Graphic3d_Vec3 anAmbient = theMaterial.AmbientColor();
if (theMaterial.MaterialType (Graphic3d_MATERIAL_ASPECT)) { anAmbient *= (Graphic3d_Vec3 )theInteriorColor; }
~~~~
Existing code should be updated to:
- Replace Graphic3d_MaterialAspect::SetReflectionModeOff() with setting black color; SetReflectionModeOn() calls can be simply removed.
R.g. theMaterial.SetAmbientColor(Quantity_NOC_BLACK).
- Replace Graphic3d_MaterialAspect::Ambient(), SetAmbient(), Diffuse(), SetDiffuse(), Specular(), SetSpecular(), Emissive(), SetEmissive() with methods working with pre-multiplied color.
E.g. theMaterial.SetAmbientColor(Graphic3d_Vec3 (1.0f, 0.0f, 0.0f) * 0.2f).
- Avoid using Graphic3d_MaterialAspect::Color() and SetColor() with non-physical materials (Graphic3d_MATERIAL_ASPECT).
These materials do not include color definition, because it is taken from Graphic3d_Aspects::InteriorColor() - this has not been changed.
However, previously it was possible storing the color with SetColor() call and then fetching it with Color() by application code (the rendering ignored this value);
now SetColor() explicitly ignores call for Graphic3d_MATERIAL_ASPECT materials and Color() returns DiffuseColor() multiplication coefficients.
@subsection upgrade_740_text Changes in Graphic3d_Text and OpenGl_Text API
Parameters of *Text* in *Graphic3d_Group* are moved into a new *Graphic3d_Text* class. *AddText* of *Graphic3d_Group* should be used instead of the previous *Text*.
The previous code:
~~~~
Standard_Real x, y, z;
theAttachmentPoint.Coord(x,y,z);
theGroup->Text (theText,
Graphic3d_Vertex(x,y,z),
theAspect->Height(),
theAspect->Angle(),
theAspect->Orientation(),
theAspect->HorizontalJustification(),
theAspect->VerticalJustification());
~~~~
should be replaced by the new code:
~~~~
Handle(Graphic3d_Text) aText = new Graphic3d_Text (theAspect->Height());
aText->SetText (theText.ToExtString());
aText->SetPosition (theAttachmentPoint);
aText->SetHorizontalAlignment (theAspect->HorizontalJustification());
aText->SetVerticalAlignment (theAspect->VerticalJustification());
theGroup->AddText (aText);
~~~~
*OpenGl_Text* contains *Graphic3d_Text* field.
*OpenGl_TextParam* struct is removed. Constructor and *Init* of *OpenGl_Text* with *OpenGl_TextParam* are also removed.
Instead of using them, change *OpenGl_Text*.
Please, note, that after modifying *OpenGl_Text*, *Reset* of *OpenGl_Text* should be called.
*FormatParams* of *OpenGl_Text* is replaced by *Text*.
@subsection upgrade_740_prsupdate Presentation invalidation
Historically AIS_InteractiveObject provided two independent mechanisms invalidating presentation (asking presentation manager to recompute specific display mode or all modes):
@@ -1761,3 +1830,29 @@ The following API changes have been made:
* Methods BOPTools_BoxSelector::Reject and BOPTools_BoxSelector::Accept have been removed as unused.
* The RunParallel flag has been removed from the list of parameters of BOPAlgo_Tools::IntersectVertices method. Earlier, it performed selection from the UB tree in parallel mode. Now all interfering pairs are found in one pass, using pair traverse of the same BVH tree.
@subsection upgrade_740_stdnamespace Standard_Stream.hxx no more has "using std::" statements
*Standard_Stream.hxx* header, commonly included by other OCCT header files, does no more add entities from *std namespace* related to streams (like *std::cout*, *std::istream* and others) into global namespace.
The application code relying on this matter should be updated to either specify std namespace explicitly (like std::cout) or add "using std::" statements locally.
@section upgrade_occt750 Upgrade to OCCT 7.5.0
@subsection upgrade_750_srgb_color RGB color definition
OCCT 3D Viewer has been improved to properly perform lighting using in linear RGB color space and then convert result into non-linear gamma-shifted sRGB color space before displaying on display.
This change affects texture mapping, material definition and color definition.
Previously *Quantity_Color* definition was provided with unspecified RGB color space.
In practice, mixed color spaces have been actually used, with non-linear sRGB prevailing in general.
Since OCCT 7.5.0, *Quantity_Color* now specifies that components are defined in linear RGB color space.
This change affects following parts:
* Standard colors defined by *Quantity_NameOfColor* enumeration have been converted into linear RGB values within Quantity_Color construction.
* Application may use new enumeration value *Quantity_TOC_sRGB* for passing/fetching colors in sRGB color space,
which can be useful for interoperation with color picking widgets (returning 8-bit integer values within [0..255] range)
or for porting colors constants within old application code without manual conversion.
* *Graphic3d_MaterialAspect* color components are now expected in linear RGB color space,
and standard OCCT materials within *Graphic3d_NameOfMaterial* enumeration have been updated accordingly.
* Texture mapping now handles new *Graphic3d_TextureRoot::IsColorMap()* for interpreting content in linear RGB or sRGB color space.
It is responsibility of user specifying this flag correctly. The flag value is TRUE by default.
* Method *Image_PixMap::PixelColor()* has been extended with a new Boolean flag for performing linearization of non-linear sRGB.
This flag is FALSE by default; application should consider passing TRUE instead for further handling *Quantity_Color* properly as linear RGB values.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -79,10 +79,10 @@ case 6: //color
Handle(Graphic3d_Group) mygroup = Prs3d_Root::CurrentGroup(aPresentation);
myAspect = (new Prs3d_ShadingAspect())->Aspect();
Graphic3d_MaterialAspect material = myAspect->FrontMaterial();
material.SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
material.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
material.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
material.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
material.SetAmbientColor (Quantity_NOC_BLACK);
material.SetDiffuseColor (Quantity_NOC_BLACK);
material.SetSpecularColor(Quantity_NOC_BLACK);
material.SetEmissiveColor(Quantity_NOC_BLACK);
myAspect->SetFrontMaterial(material);
mygroup->SetPrimitivesAspect(myAspect);
@@ -129,7 +129,7 @@ case 6: //color
// This triangulation is computed with the deflection myDeflection.
#ifdef DEBUG
cout <<"Deflection = " << myDeflection << "\n" << endl;
std::cout <<"Deflection = " << myDeflection << "\n" << std::endl;
#endif
Standard_Integer NumFace;
@@ -145,7 +145,7 @@ case 6: //color
TopLoc_Location myLocation = myFace.Location();
#ifdef DEBUG
cout << "J\'explore actuellement la face " << NumFace << "\n" << endl;
std::cout << "J\'explore actuellement la face " << NumFace << "\n" << std::endl;
#endif
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, myLocation);
// Returns the Triangulation of the face. It is a null handle if there is no triangulation.
@@ -153,7 +153,7 @@ case 6: //color
if (myT.IsNull())
{
#ifdef DEBUG
// cout << "Triangulation of the face "<< i <<" is null \n"<< endl;
// std::cout << "Triangulation of the face "<< i <<" is null \n"<< std::endl;
#endif
return;
}
@@ -200,7 +200,7 @@ case 6: //color
TopLoc_Location myLocation = myFace.Location();
#ifdef DEBUG
cout << "J\'explore actuellement la face " << NumFace << "\n" << endl;
std::cout << "J\'explore actuellement la face " << NumFace << "\n" << std::endl;
#endif
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, myLocation);
// Returns the Triangulation of the face. It is a null handle if there is no triangulation.
@@ -208,7 +208,7 @@ case 6: //color
if (myT.IsNull())
{
#ifdef DEBUG
//cout << "Triangulation of the face "<< i <<" is null \n"<< endl;
//std::cout << "Triangulation of the face "<< i <<" is null \n"<< std::endl;
#endif
return;
}
@@ -255,7 +255,7 @@ case 6: //color
for (nt = 1; nt <= nnn; nt++)
{
#ifdef DEBUG
cout << "On traite actuellement le triangle : "<< nt <<"\n";
std::cout << "On traite actuellement le triangle : "<< nt <<"\n";
#endif
if (myFace.Orientation() == TopAbs_REVERSED) // si la face est "reversed"
triangles(nt).Get(n1,n3,n2); // le triangle est n1,n3,n2

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -276,7 +276,7 @@ blend result _model 2 _model_161
# Show result
pload VISUALIZATION
vinit Driver1/Viewer1/View1
vbackground -color 0.784314 0.784314 1
vbackground -color C8C8FF
vdisplay -dispMode 1 result
vfit
vaspects result -setFaceBoundaryDraw 1 -mostContinuity c2

View File

@@ -262,7 +262,7 @@ unifysamedom result p_1
# Show result
pload VISUALIZATION
vinit Driver1/Viewer1/View1
vbackground -color 0.784314 0.784314 1
vbackground -color C8C8FF
vdisplay -dispMode 1 result
vfit
vaspects result -setFaceBoundaryDraw 1

View File

@@ -68,18 +68,18 @@ vlight add directional direction 0 -10 0 head 1 color white
vdisplay b1 b2 b3 b4 b5 b6 b7 b8 b9 b10
# set colors like in boxes of on OCC logo
vsetcolor b1 0.8671875 0 0.16015625
vsetcolor b2 0.96484375 0.8671875 0
vsetcolor b3 0.609375 0.97734375 0.09375
vsetcolor b4 0.90234375 0 0.48046875
vsetcolor b5 0 0.48046875 0.73828125
vsetcolor b6 0.578125 0 0.48046875
vsetcolor b7 0.93359375 0.609375 0
vsetcolor b8 0 0.70703125 0.9296875
vsetcolor b9 0 0.64453125 0.48046875
vsetcolor b10 0 0.48046875 0.73828125
vsetcolor b1 DD0029
vsetcolor b2 F6DD00
vsetcolor b3 98F918
vsetcolor b4 E9007A
vsetcolor b5 007ABC
vsetcolor b6 93007A
vsetcolor b7 EE9800
vsetcolor b8 00B489
vsetcolor b9 00A47A
vsetcolor b10 007ABC
# set material to plastic for better look
for {set i 1} {$i <= 10} {incr i} {vsetmaterial b$i plastic}
vdrawtext label "Which\nbox\nis\ncloser\nto\nyou?" -pos 0 -6 -2 -color 0 0 0 -halign left -valign bottom -angle 0 -zoom 0 -height 40
vdrawtext label "Which\nbox\nis\ncloser\nto\nyou?" -pos 0 -6 -2 -color BLACK -halign left -valign bottom -angle 0 -zoom 0 -height 40

View File

@@ -255,27 +255,27 @@ if [info exists i7_show_3dview] {
vlight add directional direction 1 -1 -2 head 1
vdisplay case
vsetcolor case 0.7 0.7 0.7
vsetcolor case GRAY70
vdisplay title
vsetcolor title 0.1 0.1 0.1
vsetcolor title GRAY10
# board is mostly yellow (edges, triangle markers)
foreach f [explode board f] { vdisplay $f; vsetcolor $f 0.7 0.5 0.3 }
foreach f [explode board f] { vdisplay $f; vsetcolor $f B3803D }
# top and bottom faces are light-green (outside) and dark-green (inside)
vsetcolor board_4 0 0.6 0.55
vsetcolor board_5 0 0.6 0.55
vsetcolor board_12 0 0.3 0.33
vsetcolor board_14 0 0.3 0.33
vsetcolor board_4 00998C
vsetcolor board_5 00998C
vsetcolor board_12 004D54
vsetcolor board_14 004D54
vdisplay rpads
vsetcolor rpads 0.7 0.6 0.4
vsetcolor rpads B39966
vdisplay bpads
vsetcolor bpads 0.7 0.6 0.4
vsetcolor bpads B39966
vdisplay brpk
vsetcolor brpk 0.5 0.4 0.3
vsetcolor brpk 80664D
donly board case rpads brpk; fit
}
@@ -287,17 +287,17 @@ pload OCAF XDE
NewDocument D MDTV-XCAF
SetName D [XAddShape D board 0] "Board"
foreach f [explode board f] { XSetColor D $f 0.7 0.5 0.3 }
XSetColor D board_4 0 0.6 0.55
XSetColor D board_5 0 0.6 0.55
XSetColor D board_12 0 0.3 0.33
XSetColor D board_14 0 0.3 0.33
foreach f [explode board f] { XSetColor D $f B3803D }
XSetColor D board_4 00998C
XSetColor D board_5 00998C
XSetColor D board_12 004D54
XSetColor D board_14 004D54
SetName D [XAddShape D case 0] "Case"
XSetColor D case 0.7 0.7 0.7
XSetColor D case GRAY70
SetName D [XAddShape D title 0] "Case title"
XSetColor D title 0.1 0.1 0.1
XSetColor D title GRAY10
SetName D [XAddShape D rpads 1] "Top side contact pads"
SetName D [XAddShape D bpads 1] "Bottom contact pads"
@@ -306,17 +306,17 @@ SetName D [XFindShape D rpad] "Round pad"
SetName D [XFindShape D Rpad] "Big round pad"
SetName D [XFindShape D spad_1] "Square pad 1"
SetName D [XFindShape D spad_2] "Square pad 2"
XSetColor D rpad 0.7 0.6 0.4
XSetColor D Rpad 0.7 0.6 0.4
XSetColor D bpad 0.7 0.6 0.4
XSetColor D spad_1 0.7 0.6 0.4
XSetColor D spad_2 0.7 0.6 0.4
XSetColor D rpad B39966
XSetColor D Rpad B39966
XSetColor D bpad B39966
XSetColor D spad_1 B39966
XSetColor D spad_2 B39966
SetName D [XAddShape D brpk 1] "Bottom packages"
SetName D [XFindShape D rpk] "Bottom package"
XSetColor D rpk1 0.7 0.7 0.7
XSetColor D rpk2 0.5 0.4 0.3
XSetColor D rpk3 0.7 0.7 0.7
XSetColor D rpk1 GRAY70
XSetColor D rpk2 80664D
XSetColor D rpk3 GRAY70
XShow D
vlight clear

View File

@@ -36,9 +36,7 @@ set anArrAngle [expr 3.14 * 12.0 / 180.0]
# Form dimension names list to set parameters with vdimparam command
set aList {rd_1 rd_2 ad_1 ad_2 ad_3}
for {set i 1} {$i <= 10} {incr i} {
lappend aList ld_$i
}
for {set i 1} {$i <= 10} {incr i} { lappend aList ld_$i }
puts "Creating dimensions..."
vdimension ld_1 -length -shapes bs_27 -plane xoy -color black -flyout -15
@@ -67,29 +65,14 @@ foreach i $aList {
vfit
puts "Displaying exported shapes..."
vdisplay a b
vsetdispmode a 1
vsetdispmode b 1
vdisplay -dispMode 1 a b
vaspects a -setmaterial steel
vaspects b -setmaterial bronze
puts "Clipping shapes for better view..."
vclipplane create pa
vclipplane change pa equation 0 0 1 0
vclipplane change pa capping on
vclipplane change pa capping color 0.9 0.9 0.9
vclipplane set pa object a
vclipplane create pb
vclipplane change pb equation 0 0 1 0
vclipplane change pb capping on
vclipplane change pb capping color 1.0 0.8 0.0
vclipplane set pb object b
vclipplane change pa capping texname $aHatch
vclipplane change pa capping texscale 0.05 -0.05
vclipplane change pb capping texname $aHatch
vclipplane change pb capping texscale 0.05 0.05
vclipplane pa -set a -equation 0 0 1 0 -capping on -color GRAY90 -texName $aHatch -texScale 0.05 -0.05
vclipplane pb -set b -equation 0 0 1 0 -capping on -color GOLD -texName $aHatch -texScale 0.05 -0.05
vbottom
vrotate -0.3 -0.3 0

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

@@ -0,0 +1,89 @@
# 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 FF3652
XSetColor D tp 00AADA
XSetColor D rs 0073B0
# display
vinit View1
vbackground -color WHITE
XDisplay -dispMode 1 D
vtop
vfit

View File

@@ -56,7 +56,7 @@ for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
set aRow [expr $aMarkerType - 7]
set aCol 5
set aName [lindex $aMarkerTypeNames $aMarkerType]
vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 0.5 1.0 1.0 -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font $aLabelFont -noupdate
vdrawtext "$aName" "$aName" -pos 0 [expr $aRow + 0.5] 0 -color 7FFFFF -halign center -valign center -angle 000 -zoom 0 -height 12 -aspect bold -font $aLabelFont -noupdate
vdisplay -top -noupdate "$aName"
if { $aMarkerType == 13 } {
vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1

View File

@@ -4,36 +4,22 @@
#Title: Material properties in viewer
set THE_MATERIALS {brass bronze copper gold jade neon_phc pewter obsidian plaster plastic satin silver steel stone chrome aluminium water glass diamond charcoal}
set THE_COLORS {default red green blue1}
set THE_COLORS {default red green blue}
set THE_ROW_DIST 35
proc drawLabels {} {
set x 20
set y 15
set r 0.098
set g 0.098
set b 0.098
foreach aMatIter $::THE_MATERIALS {
vdrawtext "$aMatIter" "$aMatIter" -pos $x $y 0 -color $r $g $b -halign right -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
vdrawtext "$aMatIter" "$aMatIter" -pos $x $y 0 -color GRAY10 -halign right -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
incr y 10
}
set x 40
set y 5
foreach aColIter $::THE_COLORS {
if { $aColIter == "red" } {
set r 1.0
set g 0.0
set b 0
} elseif { $aColIter == "green" } {
set r 0.0
set g 1.0
set b 0.0
} elseif { $aColIter == "blue1" } {
set r 0.0
set g 0.0
set b 1.0
}
vdrawtext "$aColIter" "$aColIter" -pos $x $y 0 -color $r $g $b -halign center -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
set aLabColor "$aColIter"
if { "$aColIter" == "default" } { set aLabColor BLACK }
vdrawtext "$aColIter" "$aColIter" -pos $x $y 0 -color "$aLabColor" -halign center -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
incr x $::THE_ROW_DIST
}
}
@@ -69,7 +55,7 @@ vclose ALL
vinit View1 w=768 h=768
vtop
vglinfo
vbackground -gradient 0.705882 0.784314 1 0.705882 0.705882 0.705882 -gradientMode VERTICAL
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
vlight -change 0 -dir 0.577 -0.577 -0.577
vrenderparams -msaa 8
@@ -86,3 +72,4 @@ drawObjects 0 ""
drawObjects 1 red
drawObjects 2 green
drawObjects 3 blue1
vrepaint

View File

@@ -75,4 +75,4 @@ vrenderparams -ray -gi -rayDepth 10
puts "Make several path tracing iterations to refine the picture, please wait..."
vfps 100
puts "Done. To improve the image further, or after view manipulations, give command:"
puts "vfps \[nb_iteratons\]"
puts "vfps \[nb_iteratons\] or vrepaint -continuous"

View File

@@ -85,4 +85,4 @@ vrenderparams -ray -gi -rayDepth 8
puts "Make several path tracing iterations to refine the picture, please wait..."
vfps 100
puts "Done. To improve the image further, or after view manipulations, give command:"
puts "vfps \[nb_iteratons\]"
puts "vfps \[nb_iteratons\] or vrepaint -continuous"

View File

@@ -223,4 +223,4 @@ vrenderparams -ray -gi -rayDepth 10
puts "Make several path tracing iterations to refine the picture, please wait..."
vfps 512
puts "Done. To improve the image further, or after view manipulations, give command:"
puts "vfps \[nb_iteratons\]"
puts "vfps \[nb_iteratons\] or vrepaint -continuous"

View File

@@ -46,18 +46,17 @@ NewDocument D
XAddShape D body_1
XAddShape D core_1
#XSetColor D body_1 0. 0. 1.
for {set i 1} {$i <= 26} {incr i} {XSetColor D body_1_$i 0. 0. 1.}
XSetColor D body_1_1 0.9 0.5 0.4
XSetColor D body_1_9 0.9 0.5 0.4
for {set i 10} {$i <= 22} {incr i} {XSetColor D body_1_$i 0.6 0.7 0.0}
XSetColor D core_1 0.1 0.1 1.
foreach ff [explode core_1 f] { XSetColor D $ff 0.1 0.1 1. ; puts "set color $ff" }
XShow D
for {set i 1} {$i <= 26} {incr i} {XSetColor D body_1_$i BLUE}
XSetColor D body_1_1 E68066
XSetColor D body_1_9 E68066
for {set i 10} {$i <= 22} {incr i} {XSetColor D body_1_$i 99B300}
XSetColor D core_1 1A1AFF
foreach ff [explode core_1 f] { XSetColor D $ff 1A1AFF ; puts "set color $ff" }
vclear
vinit View1
XDisplay -dispMode 1 D -explore
vfit
vsetdispmode 1
vrenderparams -msaa 8
vbackground -color WHITE

View File

@@ -28,19 +28,20 @@ SetName D [XFindShape D link]:2 "Nut instance 1"
SetName D [XFindShape D link]:3 "Nut instance 2"
puts "- Pin will be white"
XSetColor D [XFindShape D pin] 1 1 1
XSetColor D [XFindShape D pin] WHITE
puts "- Nut itself will be dark gray"
XSetColor D [XFindShape D nut] 0.1 0.1 0.1
XSetColor D [XFindShape D nut] GRAY10
puts "- Nut instance #1 will be red"
XSetColor D [XFindShape D link]:2 1 0 0
XSetColor D [XFindShape D link]:2 RED
puts "- Nut instance #2 will be green"
XSetColor D [XFindShape D link]:3 0 1 0
XSetColor D [XFindShape D link]:3 GREEN
puts "Starting DF browser..."
DFBrowse D
puts "Expand the document tree to see its structure and assigned names"
puts "Showing assembly in 3d view..."
XShow D
vclear
vinit View1
XDisplay -dispMode 1 D -explore
vfit
vsetdispmode 1

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

@@ -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

@@ -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;
}
}
//=======================================================================
@@ -347,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;
}
@@ -385,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;
}
@@ -796,16 +810,14 @@ void AIS_ColorScale::drawText (const Handle(Graphic3d_Group)& theGroup,
const Graphic3d_VerticalTextAlignment theVertAlignment)
{
const Handle(Prs3d_TextAspect)& anAspect = myDrawer->TextAspect();
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

@@ -26,6 +26,7 @@ public:
//! Default constructor.
AIS_ColoredDrawer (const Handle(Prs3d_Drawer)& theLink)
: myIsHidden (false),
myHasOwnMaterial(false),
myHasOwnColor (false),
myHasOwnTransp(false),
myHasOwnWidth (false)
@@ -36,6 +37,10 @@ public:
bool IsHidden() const { return myIsHidden; }
void SetHidden (const bool theToHide) { myIsHidden = theToHide;}
bool HasOwnMaterial() const { return myHasOwnMaterial; }
void UnsetOwnMaterial() { myHasOwnMaterial = false; }
void SetOwnMaterial() { myHasOwnMaterial = true; }
bool HasOwnColor() const { return myHasOwnColor; }
void UnsetOwnColor() { myHasOwnColor = false; }
void SetOwnColor (const Quantity_Color& /*theColor*/) { myHasOwnColor = true; }
@@ -51,6 +56,7 @@ public:
public: //! @name list of overridden properties
bool myIsHidden;
bool myHasOwnMaterial;
bool myHasOwnColor;
bool myHasOwnTransp;
bool myHasOwnWidth;

View File

@@ -333,7 +333,11 @@ void AIS_ColoredShape::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
{
const Handle(AIS_ColoredDrawer)& aDrawer = anIter.Value();
//if (aDrawer->HasOwnMaterial()) continue;
if (aDrawer->HasOwnMaterial())
{
continue;
}
if (aDrawer->HasOwnShadingAspect())
{
setMaterial (aDrawer, theMaterial, aDrawer->HasOwnColor(), aDrawer->HasOwnTransparency());
@@ -633,9 +637,6 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
{
aShadedGroup = thePrs->NewGroup();
aShadedGroup->SetClosed (isClosed);
if (isClosed
&& !myCappingStyle.IsNull())
aShadedGroup->SetGroupPrimitivesAspect (myCappingStyle);
}
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
aShadedGroup->AddPrimitiveArray (aTriangles);

View File

@@ -403,16 +403,17 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation
anArrow->AddVertex (aRightPoint);
// Set aspect for arrow triangles
Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT);
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
Handle(Prs3d_ShadingAspect) aShadingStyle = new Prs3d_ShadingAspect();
Graphic3d_PolygonOffset aPolOffset;
aPolOffset.Mode = Aspect_POM_Off;
aPolOffset.Factor = 0.0f;
aPolOffset.Units = 0.0f;
Handle(Graphic3d_AspectFillArea3d) aShadingStyle = new Graphic3d_AspectFillArea3d();
aShadingStyle->SetInteriorStyle (Aspect_IS_SOLID);
aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color());
aShadingStyle->SetMaterial (aShadeMat);
aShadingStyle->SetShadingModel (Graphic3d_TOSM_UNLIT);
aShadingStyle->SetPolygonOffset (aPolOffset);
aGroup->SetPrimitivesAspect (aShadingStyle->Aspect());
aGroup->SetPrimitivesAspect (aShadingStyle);
aGroup->AddPrimitiveArray (anArrow);
}
@@ -530,9 +531,9 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
}
Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT);
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
aShadeMat.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
aShadeMat.SetAmbientColor (Quantity_NOC_BLACK);
aShadeMat.SetDiffuseColor (Quantity_NOC_BLACK);
aShadeMat.SetSpecularColor(Quantity_NOC_BLACK);
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (aColor);
myDrawer->ShadingAspect()->Aspect()->SetBackInteriorColor (aColor);
myDrawer->ShadingAspect()->SetMaterial (aShadeMat);

View File

@@ -187,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 :
@@ -1945,7 +1968,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
}
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
unhighlightOwners (theIObj);
unselectOwners (theIObj);
myMainPM->SetVisibility (theIObj, aStatus->DisplayMode(), Standard_False);
if (!myLastPicked.IsNull()
@@ -1977,10 +2000,10 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
}
//=======================================================================
//function : unhighlightOwners
//function : unselectOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject)
void AIS_InteractiveContext::unselectOwners (const Handle(AIS_InteractiveObject)& theObject)
{
SelectMgr_SequenceOfOwner aSeq;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
@@ -2014,7 +2037,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
return;
}
unhighlightOwners (theIObj);
unselectOwners (theIObj);
myMainPM->Erase (theIObj, -1);
theIObj->ErasePresentations (true); // make sure highlighting presentations are properly erased
@@ -2447,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;
@@ -2491,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);
}
}
//=======================================================================

View File

@@ -370,6 +370,9 @@ public: //! @name mouse picking logic (detection and dynamic highlighting of ent
const Standard_Integer theMode,
const Standard_Integer theNewSensitivity);
//! Returns last active View (argument of MoveTo()/Select() methods).
Standard_EXPORT Handle(V3d_View) LastActiveView() const;
//! Relays mouse position in pixels theXPix and theYPix to the interactive context selectors.
//! This is done by the view theView passing this position to the main viewer and updating it.
//! If theToRedrawOnUpdate is set to false, callee should call RedrawImmediate() to highlight detected object.
@@ -505,6 +508,9 @@ public: //! @name Selection management
const Handle(V3d_View)& theView,
const Standard_Boolean theToUpdateViewer);
//! Returns bounding box of selected objects.
Standard_EXPORT Bnd_Box BoundingBoxOfSelection() const;
//! Fits the view correspondingly to the bounds of selected objects.
//! Infinite objects are ignored if infinite state of AIS_InteractiveObject is set to true.
Standard_EXPORT void FitSelected (const Handle(V3d_View)& theView,
@@ -1203,6 +1209,13 @@ public: //! @name sub-intensity management (deprecated)
Standard_EXPORT void SubIntensityOff (const Handle(AIS_InteractiveObject)& theIObj,
const Standard_Boolean theToUpdateViewer);
//! Returns selection instance
const Handle(AIS_Selection)& Selection() const { return mySelection; }
//! Sets selection instance to manipulate a container of selected owners
//! @param theSelection an instance of the selection
void SetSelection (const Handle(AIS_Selection)& theSelection) { mySelection = theSelection; }
protected: //! @name internal methods
Standard_EXPORT void GetDefModes (const Handle(AIS_InteractiveObject)& anIobj, Standard_Integer& Dmode, Standard_Integer& HiMod, Standard_Integer& SelMode) const;
@@ -1222,7 +1235,7 @@ protected: //! @name internal methods
Standard_EXPORT Standard_Integer PurgeViewer (const Handle(V3d_Viewer)& Vwr);
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
Standard_EXPORT void unhighlightOwners (const Handle(AIS_InteractiveObject)& theObject);
Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);
//! Helper function that highlights the owner given with <theStyle> without
//! performing AutoHighlight checks, e.g. is used for dynamic highlight.
@@ -1233,12 +1246,16 @@ protected: //! @name internal methods
//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner);
//! Helper function that highlights the owners with check
//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void highlightOwners (const AIS_NListOfEntityOwner& theOwners);
//! Helper function that highlights global owner of the object given with <theStyle> with check
//! for AutoHighlight, e.g. is used for selection.
//! If global owner is null, it simply highlights the whole object
Standard_EXPORT void highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theDispMode) const;
const Standard_Integer theDispMode);
//! Helper function that unhighlights all owners that are stored in current AIS_Selection.
//! The function updates global status and selection state of owner and interactive object.
@@ -1246,9 +1263,14 @@ protected: //! @name internal methods
//! switched on in AIS_GlobalStatus will be highlighted with context's sub-intensity color.
Standard_EXPORT void unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
//! Helper function that unhighlights the owners with check
//! for AutoHighlight, e.g. is used for selection.
Standard_EXPORT void unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
const Standard_Boolean theIsToHilightSubIntensity = Standard_False);
//! Helper function that unhighlights global selection owner of given interactive.
//! The function does not perform any updates of global or owner status
Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj) const;
Standard_EXPORT void unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj);
//! Helper function that turns on sub-intensity in global status and highlights
//! given objects with sub-intensity color
@@ -1379,6 +1401,7 @@ protected: //! @name internal fields
Handle(PrsMgr_PresentationManager3d) myMainPM;
Handle(V3d_Viewer) myMainVwr;
Handle(StdSelect_ViewerSelector3d) myMainSel;
V3d_View* myLastActiveView;
Handle(SelectMgr_EntityOwner) myLastPicked;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;

View File

@@ -85,6 +85,7 @@ void AIS_InteractiveContext::highlightWithColor (const Handle(SelectMgr_EntityOw
//=======================================================================
void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwner)& theOwner)
{
AIS_NListOfEntityOwner anOwners;
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
if (anObj.IsNull())
{
@@ -98,17 +99,15 @@ void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwn
{
if (aSelIter.Value()->IsSameSelectable (anObj))
{
aSeq.Append (aSelIter.Value());
anOwners.Append (aSelIter.Value());
}
}
anObj->HilightSelected (myMainPM, aSeq);
}
else
{
const Handle(Prs3d_Drawer)& aStyle = getSelStyle (anObj, theOwner);
const Standard_Integer aHiMode = getHilightMode (anObj, aStyle, -1);
theOwner->HilightWithColor (myMainPM, aStyle, aHiMode);
anOwners.Append (theOwner);
}
highlightOwners (anOwners);
}
//=======================================================================
@@ -117,7 +116,7 @@ void AIS_InteractiveContext::highlightSelected (const Handle(SelectMgr_EntityOwn
//=======================================================================
void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject)& theObj,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theDispMode) const
const Standard_Integer theDispMode)
{
if (theObj.IsNull())
{
@@ -133,6 +132,7 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
return;
}
AIS_NListOfEntityOwner anOwners;
if (!aGlobOwner->IsAutoHilight())
{
SelectMgr_SequenceOfOwner aSeq;
@@ -140,15 +140,15 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
{
if (aSelIter.Value()->IsSameSelectable (theObj))
{
aSeq.Append (aSelIter.Value());
anOwners.Append (aSelIter.Value());
}
}
theObj->HilightSelected (myMainPM, aSeq);
}
else
{
aGlobOwner->HilightWithColor (myMainPM, theStyle, aHiMode);
anOwners.Append (aGlobOwner);
}
highlightOwners (anOwners);
}
//=======================================================================
@@ -156,9 +156,19 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightSelected (const Standard_Boolean theIsToHilightSubIntensity)
{
unhighlightOwners (mySelection->Objects(), theIsToHilightSubIntensity);
}
//=======================================================================
//function : unhighlightOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& theOwners,
const Standard_Boolean theIsToHilightSubIntensity)
{
NCollection_IndexedMap<Handle(AIS_InteractiveObject)> anObjToClear;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
@@ -186,7 +196,7 @@ void AIS_InteractiveContext::unhighlightSelected (const Standard_Boolean theIsTo
}
if (anOwner == anInteractive->GlobalSelOwner())
{
myObjects.ChangeFind (anInteractive)->SetHilightStatus (Standard_False);
aStatus->SetHilightStatus (Standard_False);
}
}
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
@@ -201,7 +211,7 @@ void AIS_InteractiveContext::unhighlightSelected (const Standard_Boolean theIsTo
//function : unhighlightGlobal
//purpose :
//=======================================================================
void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj) const
void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObject)& theObj)
{
if (theObj.IsNull())
{
@@ -215,15 +225,9 @@ void AIS_InteractiveContext::unhighlightGlobal (const Handle(AIS_InteractiveObje
return;
}
if (aGlobOwner->IsAutoHilight())
{
aGlobOwner->Unhilight (myMainPM);
}
else
{
myMainPM->Unhighlight (theObj);
theObj->ClearSelected();
}
AIS_NListOfEntityOwner anOwners;
anOwners.Append (aGlobOwner);
unhighlightOwners (anOwners);
}
//=======================================================================
@@ -325,6 +329,7 @@ AIS_StatusOfDetection AIS_InteractiveContext::MoveTo (const Standard_Integer th
myCurDetected = 0;
myCurHighlighted = 0;
myDetectedSeq.Clear();
myLastActiveView = theView.get();
// preliminaires
AIS_StatusOfDetection aStatus = AIS_SOD_Nothing;
@@ -495,6 +500,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Integer theXPMi
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (theXPMin, theYPMin, theXPMax, theYPMax, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
@@ -534,6 +540,7 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const TColgp_Array1OfPnt2d& the
// all objects detected by the selector are taken, previous current objects are emptied,
// new objects are put...
ClearSelected (Standard_False);
myLastActiveView = theView.get();
myMainSel->Pick (thePolyline, theView);
for (Standard_Integer aPickIter = 1; aPickIter <= myMainSel->NbPicked(); ++aPickIter)
{
@@ -565,6 +572,17 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const Standard_Boolean toUpdate
{
if (!myLastPicked.IsNull())
{
Graphic3d_Vec2i aMousePos (-1, -1);
if (myMainSel->GetManager().GetActiveSelectionType() == SelectBasics_SelectingVolumeManager::Point)
{
aMousePos.SetValues ((Standard_Integer )myMainSel->GetManager().GetMousePosition().X(),
(Standard_Integer )myMainSel->GetManager().GetMousePosition().Y());
}
if (myLastPicked->HandleMouseClick (aMousePos, Aspect_VKeyMouse_LeftButton, Aspect_VKeyFlags_NONE, false))
{
return AIS_SOP_NothingSelected;
}
if (myAutoHilight)
{
clearDynamicHighlight();
@@ -630,6 +648,7 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const Standard_Integer the
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
}
myLastActiveView = theView.get();
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
@@ -670,6 +689,7 @@ AIS_StatusOfPick AIS_InteractiveContext::ShiftSelect (const TColgp_Array1OfPnt2d
throw Standard_ProgramError ("AIS_InteractiveContext::ShiftSelect() - invalid argument");
}
myLastActiveView = theView.get();
if (myAutoHilight)
{
UnhilightSelected (Standard_False);
@@ -704,11 +724,27 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
{
// In case of selection without using local context
clearDynamicHighlight();
highlightOwners (mySelection->Objects());
if (theToUpdateViewer)
UpdateCurrentViewer();
}
//=======================================================================
//function : highlightOwners
//purpose :
//=======================================================================
void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theOwners)
{
AIS_MapOfObjSelectedOwners anObjOwnerMap;
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
for (AIS_NListOfEntityOwner::Iterator aSelIter (theOwners); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anObj.IsNull())
continue;
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
if (anOwner == anObj->GlobalSelOwner())
@@ -745,9 +781,6 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
}
anObjOwnerMap.Clear();
}
if (theToUpdateViewer)
UpdateCurrentViewer();
}
//=======================================================================
@@ -756,17 +789,7 @@ void AIS_InteractiveContext::HilightSelected (const Standard_Boolean theToUpdate
//=======================================================================
void AIS_InteractiveContext::UnhilightSelected (const Standard_Boolean theToUpdateViewer)
{
for (AIS_NListOfEntityOwner::Iterator aSelIter (mySelection->Objects()); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
if (anOwner == anObj->GlobalSelOwner())
{
myObjects.ChangeFind (anObj)->SetHilightStatus (Standard_False);
}
anOwner->Unhilight (myMainPM);
}
unhighlightSelected();
if (theToUpdateViewer)
UpdateCurrentViewer();
@@ -921,13 +944,6 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
}
}
if (myAutoHilight && theOwner == anObject->GlobalSelOwner())
{
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind (anObject);
aState->SetHilightStatus (Standard_True);
aState->SetHilightStyle (anObjSelStyle);
}
if (theToUpdateViewer)
UpdateCurrentViewer();
}
@@ -974,28 +990,17 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
const Standard_Boolean isGlobal = anObj->GlobalSelOwner() == theOwner;
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
if (theOwner->IsSelected())
{
highlightSelected (theOwner);
if (isGlobal)
{
aStatus->SetHilightStatus (Standard_True);
aStatus->SetHilightStyle (getSelStyle (anObj, theOwner));
}
}
else
{
if (theOwner->IsAutoHilight())
{
theOwner->Unhilight (myMainPM);
}
else
{
anObj->ClearSelected();
}
aStatus->SetHilightStatus (Standard_False);
AIS_NListOfEntityOwner anOwners;
anOwners.Append (theOwner);
unhighlightOwners (anOwners);
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
}
}

View File

@@ -18,7 +18,6 @@
#include <AIS_InteractiveContext.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectFillCapping.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
@@ -84,37 +83,6 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
}
}
//=======================================================================
//function : SetCappingStyle
//purpose :
//=======================================================================
void AIS_InteractiveObject::SetCappingStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle)
{
myCappingStyle = theStyle;
// Modify existing presentations
for (Standard_Integer aPrsIter = 1, n = myPresentations.Length(); aPrsIter <= n; ++aPrsIter)
{
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter);
if (!aPrs3d.IsNull())
{
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
if (!aStruct.IsNull())
{
const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
{
Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
if (aGrp.IsNull())
continue;
aGrp->SetGroupPrimitivesAspect (theStyle);
}
}
}
}
}
//=======================================================================
//function : HasPresentation
//purpose :

View File

@@ -104,12 +104,6 @@ public:
void ClearOwner() { myOwner.Nullify(); }
public:
//! Set style of filling capping section created by clipping planes.
Standard_EXPORT virtual void SetCappingStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle);
//! Returns style for filling capping section created by clipping planes.
const Handle(Graphic3d_AspectFillCapping)& CappingStyle() const { return myCappingStyle; }
//! Returns the context pointer to the interactive context.
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
@@ -134,7 +128,6 @@ protected:
AIS_InteractiveContext* myCTXPtr; //!< pointer to Interactive Context, where object is currently displayed; @sa SetContext()
Handle(Standard_Transient) myOwner; //!< application-specific owner object
Handle(Graphic3d_AspectFillCapping) myCappingStyle;
};

View File

@@ -132,7 +132,7 @@ void AIS_Manipulator::init()
myAxes[2] = Axis (gp::OZ(), Quantity_NOC_BLUE1);
Graphic3d_MaterialAspect aShadingMaterial;
aShadingMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
aShadingMaterial.SetSpecularColor(Quantity_NOC_BLACK);
aShadingMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
@@ -142,10 +142,10 @@ void AIS_Manipulator::init()
Graphic3d_MaterialAspect aHilightMaterial;
aHilightMaterial.SetColor (Quantity_NOC_AZURE);
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
aHilightMaterial.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
aHilightMaterial.SetAmbientColor (Quantity_NOC_BLACK);
aHilightMaterial.SetDiffuseColor (Quantity_NOC_BLACK);
aHilightMaterial.SetSpecularColor(Quantity_NOC_BLACK);
aHilightMaterial.SetEmissiveColor(Quantity_NOC_BLACK);
aHilightMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
myHighlightAspect = new Prs3d_ShadingAspect();
@@ -153,11 +153,10 @@ void AIS_Manipulator::init()
myHighlightAspect->SetMaterial (aHilightMaterial);
Graphic3d_MaterialAspect aDraggerMaterial;
aDraggerMaterial.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
aDraggerMaterial.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
aDraggerMaterial.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
aDraggerMaterial.SetAmbientColor (Quantity_NOC_BLACK);
aDraggerMaterial.SetDiffuseColor (Quantity_NOC_BLACK);
aDraggerMaterial.SetSpecularColor(Quantity_NOC_BLACK);
aDraggerMaterial.SetMaterialType(Graphic3d_MATERIAL_ASPECT);
aDraggerMaterial.SetAmbient(1.0);
myDraggerHighlight = new Prs3d_ShadingAspect();
myDraggerHighlight->Aspect()->SetInteriorStyle(Aspect_IS_SOLID);

View File

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

View File

@@ -32,18 +32,18 @@ public:
Standard_EXPORT AIS_Selection();
//! removes all the object of the selection.
Standard_EXPORT void Clear();
Standard_EXPORT virtual void Clear();
//! if the object is not yet in the selection, it will be added.
//! if the object is already in the selection, it will be removed.
Standard_EXPORT AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
//! the object is always add int the selection.
//! faster when the number of objects selected is great.
Standard_EXPORT AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
Standard_EXPORT virtual AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
//! clears the selection and adds the object in the selection.
void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
{
Clear();
Select (theObject);

View File

@@ -180,7 +180,10 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
try
{
OCC_CATCH_SIGNALS
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer, myCappingStyle);
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer,
myDrawer->ShadingAspect()->Aspect()->ToMapTexture()
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
myUVOrigin, myUVRepeat, myUVScale);
}
catch (Standard_Failure const& anException)
{
@@ -634,7 +637,7 @@ void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
const Standard_Boolean theToKeepColor,
const Standard_Boolean theToKeepTransp) const
{
const Quantity_Color aColor = theDrawer->ShadingAspect()->Material (myCurrentFacingModel).Color();
const Quantity_Color aColor = theDrawer->ShadingAspect()->Color (myCurrentFacingModel);
const Standard_Real aTransp = theDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
theDrawer->SetupOwnShadingAspect();
theDrawer->ShadingAspect()->SetMaterial (theMaterial, myCurrentFacingModel);
@@ -790,7 +793,7 @@ const Bnd_Box& AIS_Shape::BoundingBox()
}
if(myCompBB) {
BRepBndLib::AddClose(myshape, myBB);
BRepBndLib::Add (myshape, myBB, false);
myCompBB = Standard_False;
}
return myBB;

View File

@@ -137,7 +137,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
Standard_Integer i;
Standard_Integer j;
Standard_Real ambient = aspect->FrontMaterial().Ambient();
const Standard_Real ambient = 0.2;
if (hasVNormals)
{
const TShort_Array1OfShortReal& normals = myTriangulation->Normals();

View File

@@ -13,6 +13,7 @@
#include "AIS_ViewController.hxx"
#include <AIS_AnimationCamera.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Manipulator.hxx>
#include <AIS_Point.hxx>
@@ -47,12 +48,15 @@ AIS_ViewController::AIS_ViewController()
myToAllowZFocus (true),
myToAllowHighlight (true),
myToAllowDragging (true),
myToStickToRayOnZoom (true),
myToStickToRayOnRotation (true),
//
myWalkSpeedAbsolute (1.5f),
myWalkSpeedRelative (0.1f),
myThrustSpeed (0.0f),
myHasThrust (false),
//
myViewAnimation (new AIS_AnimationCamera ("AIS_ViewController_ViewAnimation", Handle(V3d_View)())),
myPrevMoveTo (-1, -1),
myHasHlrOnBeforeRotation (false),
//
@@ -1224,6 +1228,20 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys (Standard_Real theCrouchRa
return aWalk;
}
// =======================================================================
// function : AbortViewAnimation
// purpose :
// =======================================================================
void AIS_ViewController::AbortViewAnimation()
{
if (!myViewAnimation.IsNull()
&& !myViewAnimation->IsStopped())
{
myViewAnimation->Stop();
myViewAnimation->SetView (Handle(V3d_View)());
}
}
// =======================================================================
// function : handlePanning
// purpose :
@@ -1236,6 +1254,8 @@ void AIS_ViewController::handlePanning (const Handle(V3d_View)& theView)
return;
}
AbortViewAnimation();
const Handle(Graphic3d_Camera)& aCam = theView->Camera();
if (aCam->IsOrthographic()
|| !hasPanningAnchorPoint())
@@ -1276,6 +1296,8 @@ void AIS_ViewController::handleZRotate (const Handle(V3d_View)& theView)
return;
}
AbortViewAnimation();
Graphic3d_Vec2i aViewPort;
theView->Window()->Size (aViewPort.x(), aViewPort.y());
Graphic3d_Vec2d aRotPnt (0.99 * aViewPort.x(),
@@ -1299,6 +1321,8 @@ void AIS_ViewController::handleZoom (const Handle(V3d_View)& theView,
return;
}
AbortViewAnimation();
const Handle(Graphic3d_Camera)& aCam = theView->Camera();
if (thePnt != NULL)
{
@@ -1371,9 +1395,9 @@ void AIS_ViewController::handleZoom (const Handle(V3d_View)& theView,
Graphic3d_Vec2i aWinSize;
theView->Window()->Size (aWinSize.x(), aWinSize.y());
const Graphic3d_Vec2d aPanFromCenterPx (double(theParams.Point.x()) - 0.5 * double(aWinSize.x()),
double(theParams.Point.y()) - 0.5 * double(aWinSize.y()));
double(aWinSize.y() - theParams.Point.y() - 1) - 0.5 * double(aWinSize.y()));
aDxy.x() += -aViewDims1.X() * aPanFromCenterPx.x() / double(aWinSize.x());
aDxy.y() += aViewDims1.X() * aPanFromCenterPx.y() / double(aWinSize.x());
aDxy.y() += -aViewDims1.Y() * aPanFromCenterPx.y() / double(aWinSize.y());
}
//theView->Translate (aCam, aDxy.x(), aDxy.y());
@@ -1429,6 +1453,7 @@ void AIS_ViewController::handleOrbitRotation (const Handle(V3d_View)& theView,
myRotatePnt3d = thePnt;
myCamStartOpUp = aCam->Up();
myCamStartOpDir = aCam->Direction();
myCamStartOpEye = aCam->Eye();
myCamStartOpCenter = aCam->Center();
@@ -1450,6 +1475,7 @@ void AIS_ViewController::handleOrbitRotation (const Handle(V3d_View)& theView,
return;
}
AbortViewAnimation();
if (theToLockZUp)
{
// amend camera to exclude roll angle (put camera Up vector to plane containing global Z and view direction)
@@ -1468,8 +1494,9 @@ void AIS_ViewController::handleOrbitRotation (const Handle(V3d_View)& theView,
const gp_Dir aNewUp = gp::DZ().Transformed (aTrsfRot);
aCam->SetUp (aNewUp);
aCam->SetCenter(myRotatePnt3d.XYZ() + myCamStartOpToCenter.Transformed (aTrsfRot).XYZ());
aCam->SetEye (myRotatePnt3d.XYZ() + myCamStartOpToEye .Transformed (aTrsfRot).XYZ());
aCam->SetEyeAndCenter (myRotatePnt3d.XYZ() + myCamStartOpToEye .Transformed (aTrsfRot).XYZ(),
myRotatePnt3d.XYZ() + myCamStartOpToCenter.Transformed (aTrsfRot).XYZ());
aCam->OrthogonalizeUp();
}
else
@@ -1479,9 +1506,9 @@ void AIS_ViewController::handleOrbitRotation (const Handle(V3d_View)& theView,
//theView->Rotate (aDX, aDY, aDZ, myRotatePnt3d.X(), myRotatePnt3d.Y(), myRotatePnt3d.Z(), false);
// restore previous camera state
aCam->SetUp (myCamStartOpUp);
aCam->SetEye (myCamStartOpEye);
aCam->SetCenter (myCamStartOpCenter);
aCam->SetEyeAndCenter (myCamStartOpEye, myCamStartOpCenter);
aCam->SetUp (myCamStartOpUp);
aCam->SetDirectionFromEye (myCamStartOpDir);
Graphic3d_Vec2d aWinXY;
theView->Size (aWinXY.x(), aWinXY.y());
@@ -1561,6 +1588,8 @@ void AIS_ViewController::handleViewRotation (const Handle(V3d_View)& theView,
return;
}
AbortViewAnimation();
Graphic3d_Vec2i aWinXY;
theView->Window()->Size (aWinXY.x(), aWinXY.y());
double aYawAngleDelta = ((myGL.ViewRotation.PointStart.x() - myGL.ViewRotation.PointTo.x()) / double (aWinXY.x())) * (M_PI * 0.5);
@@ -1572,11 +1601,10 @@ void AIS_ViewController::handleViewRotation (const Handle(V3d_View)& theView,
gp_Trsf aTrsfRot;
aTrsfRot.SetRotation (aRot);
const double aDist = aCam->Distance();
const gp_Dir aNewUp = gp::DZ().Transformed (aTrsfRot);
const gp_Dir aNewDir = gp::DX().Transformed (aTrsfRot);
aCam->SetUp (aNewUp);
aCam->SetCenter (aCam->Eye().Translated (gp_Vec (aNewDir) * aDist));
aCam->SetUp (aNewUp);
aCam->SetDirectionFromEye (aNewDir);
aCam->OrthogonalizeUp();
theView->Invalidate();
}
@@ -1636,7 +1664,7 @@ gp_Pnt AIS_ViewController::GravityPoint (const Handle(AIS_InteractiveContext)& t
}
gp_Pnt aPnt;
if (PickPoint (aPnt, theCtx, theView, aCursor, false))
if (PickPoint (aPnt, theCtx, theView, aCursor, myToStickToRayOnRotation))
{
return aPnt;
}
@@ -1857,12 +1885,9 @@ void AIS_ViewController::handleCameraActions (const Handle(AIS_InteractiveContex
if (!theView->Camera()->IsOrthographic())
{
// what is more natural to user - point on ray or point exactly on geometry in corner cases?
const bool toStickToRay = false; // true;
gp_Pnt aPnt;
if (aZoomParams.HasPoint()
&& PickPoint (aPnt, theCtx, theView, aZoomParams.Point, toStickToRay))
&& PickPoint (aPnt, theCtx, theView, aZoomParams.Point, myToStickToRayOnZoom))
{
handleZoom (theView, aZoomParams, &aPnt);
continue;
@@ -1870,7 +1895,7 @@ void AIS_ViewController::handleCameraActions (const Handle(AIS_InteractiveContex
Graphic3d_Vec2i aWinSize;
theView->Window()->Size (aWinSize.x(), aWinSize.y());
if (PickPoint (aPnt, theCtx, theView, aWinSize / 2, toStickToRay))
if (PickPoint (aPnt, theCtx, theView, aWinSize / 2, myToStickToRayOnZoom))
{
aZoomParams.ResetPoint(); // do not pretend to zoom at 'nothing'
handleZoom (theView, aZoomParams, &aPnt);
@@ -2035,11 +2060,6 @@ void AIS_ViewController::handleSelectionPick (const Handle(AIS_InteractiveContex
{
for (NCollection_Sequence<Graphic3d_Vec2i>::Iterator aPntIter (myGL.Selection.Points); aPntIter.More(); aPntIter.Next())
{
if (!myGL.Selection.IsXOR)
{
theCtx->ClearSelected (false);
}
const bool hadPrevMoveTo = HasPreviousMoveTo();
contextLazyMoveTo (theCtx, theView, aPntIter.Value());
if (!hadPrevMoveTo)
@@ -2274,6 +2294,15 @@ void AIS_ViewController::handleMoveTo (const Handle(AIS_InteractiveContext)& the
void AIS_ViewController::handleViewRedraw (const Handle(AIS_InteractiveContext)& ,
const Handle(V3d_View)& theView)
{
// manage animation state
if (!myViewAnimation.IsNull()
&& !myViewAnimation->IsStopped())
{
myViewAnimation->UpdateTimer();
ResetPreviousMoveTo();
setAskNextFrame();
}
for (V3d_ListOfViewIterator aViewIter (theView->Viewer()->ActiveViewIterator()); aViewIter.More(); aViewIter.Next())
{
const Handle(V3d_View)& aView = aViewIter.Value();

View File

@@ -30,6 +30,7 @@
#include <Precision.hxx>
#include <Standard_Mutex.hxx>
class AIS_AnimationCamera;
class AIS_InteractiveObject;
class AIS_InteractiveContext;
class AIS_Point;
@@ -56,6 +57,15 @@ public:
//! Return input buffer.
AIS_ViewInputBuffer& ChangeInputBuffer (AIS_ViewInputBufferType theType) { return theType == AIS_ViewInputBufferType_UI ? myUI : myGL; }
//! Return view animation; empty (but not NULL) animation by default.
const Handle(AIS_AnimationCamera)& ViewAnimation() const { return myViewAnimation; }
//! Set view animation to be handled within handleViewRedraw().
void SetViewAnimation (const Handle(AIS_AnimationCamera)& theAnimation) { myViewAnimation = theAnimation; }
//! Interrupt active view animation.
Standard_EXPORT void AbortViewAnimation();
public: //! @name global parameters
//! Return camera rotation mode, AIS_RotationMode_BndBoxActive by default.
@@ -142,6 +152,18 @@ public: //! @name global parameters
//! Set if dynamic highlight on mouse move is allowed.
void SetAllowDragging (bool theToEnable) { myToAllowDragging = theToEnable; }
//! Return TRUE if picked point should be projected to picking ray on zooming at point; TRUE by default.
bool ToStickToRayOnZoom() const { return myToStickToRayOnZoom; }
//! Set if picked point should be projected to picking ray on zooming at point.
void SetStickToRayOnZoom (bool theToEnable) { myToStickToRayOnZoom = theToEnable; }
//! Return TRUE if picked point should be projected to picking ray on rotating around point; TRUE by default.
bool ToStickToRayOnRotation() const { return myToStickToRayOnRotation; }
//! Set if picked point should be projected to picking ray on rotating around point.
void SetStickToRayOnRotation (bool theToEnable) { myToStickToRayOnRotation = theToEnable; }
//! Return TRUE if pitch direction should be inverted while processing Aspect_VKey_NavLookUp/Aspect_VKey_NavLookDown; FALSE by default.
bool ToInvertPitch() const { return myToInvertPitch; }
@@ -590,12 +612,15 @@ protected:
Standard_Boolean myToAllowZFocus; //!< enable ZFocus change; TRUE by default
Standard_Boolean myToAllowHighlight; //!< enable dynamic highlight on mouse move; TRUE by default
Standard_Boolean myToAllowDragging; //!< enable dragging object; TRUE by default
Standard_Boolean myToStickToRayOnZoom; //!< project picked point to ray while zooming at point, TRUE by default
Standard_Boolean myToStickToRayOnRotation; //!< project picked point to ray while rotating around point; TRUE by default
Standard_ShortReal myWalkSpeedAbsolute; //!< normal walking speed, in m/s; 1.5 by default
Standard_ShortReal myWalkSpeedRelative; //!< walking speed relative to scene bounding box; 0.1 by default
Standard_ShortReal myThrustSpeed; //!< active thrust value
Standard_Boolean myHasThrust; //!< flag indicating active thrust
Handle(AIS_AnimationCamera) myViewAnimation; //!< view animation
Handle(AIS_RubberBand) myRubberBand; //!< Rubber-band presentation
Handle(AIS_InteractiveObject) myDragObject; //!< currently dragged object
Graphic3d_Vec2i myPrevMoveTo; //!< previous position of MoveTo event in 3D viewer
@@ -647,6 +672,7 @@ protected: //! @name rotation/panning transient state variables
gp_Pnt myPanPnt3d; //!< active panning anchor point
gp_Pnt myRotatePnt3d; //!< active rotation center of gravity
gp_Dir myCamStartOpUp; //!< camera Up direction at the beginning of rotation
gp_Dir myCamStartOpDir; //!< camera View direction at the beginning of rotation
gp_Pnt myCamStartOpEye; //!< camera Eye position at the beginning of rotation
gp_Pnt myCamStartOpCenter; //!< camera Center position at the beginning of rotation
gp_Vec myCamStartOpToCenter; //!< vector from rotation gravity point to camera Center at the beginning of rotation

1034
src/AIS/AIS_ViewCube.cxx Normal file

File diff suppressed because it is too large Load Diff

686
src/AIS/AIS_ViewCube.hxx Normal file
View File

@@ -0,0 +1,686 @@
// Created on: 2017-07-25
// Created by: Anastasia BOBYLEVA
// Copyright (c) 2017-2019 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _AIS_ViewCube_HeaderFile
#define _AIS_ViewCube_HeaderFile
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_Camera.hxx>
#include <Graphic3d_Vec2.hxx>
#include <Prs3d_DatumParts.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_TextAspect.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <V3d_TypeOfOrientation.hxx>
class AIS_AnimationCamera;
class AIS_ViewCubeOwner;
class Graphic3d_ArrayOfTriangles;
class V3d_View;
//! Interactive object for displaying the view manipulation cube.
//!
//! View cube consists of several parts that are responsible for different camera manipulations:
//! @li Cube sides represent main views: top, bottom, left, right, front and back.
//! @li Edges represent rotation of one of main views on 45 degrees.
//! @li Vertices represent rotation of one of man views in two directions.
//!
//! The object is expected to behave like a trihedron in the view corner,
//! therefore its position should be defined using transformation persistence flags:
//! @code SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_TriedronPers, Aspect_TOTP_LEFT_LOWER, Graphic3d_Vec2i (100, 100)); @endcode
//!
//! View Cube parts are sensitive to detection, or dynamic highlighting (but not selection),
//! and every its owner AIS_ViewCubeOwner corresponds to camera transformation.
//! @code
//! for (aViewCube->StartAnimation (aDetectedOwner); aViewCube->HasAnimation(); )
//! {
//! aViewCube->UpdateAnimation();
//! ... // updating of application window
//! }
//! @endcode
//! or
//! @code aViewCube->HandleClick (aDetectedOwner); @endcode
//! that includes transformation loop.
//! This loop allows external actions like application updating. For this purpose AIS_ViewCube has virtual interface onAfterAnimation(),
//! that is to be redefined on application level.
class AIS_ViewCube : public AIS_InteractiveObject
{
DEFINE_STANDARD_RTTIEXT(AIS_ViewCube, AIS_InteractiveObject)
public:
//! Return TRUE if specified orientation belongs to box side.
Standard_EXPORT static bool IsBoxSide (V3d_TypeOfOrientation theOrient);
//! Return TRUE if specified orientation belongs to box edge.
Standard_EXPORT static bool IsBoxEdge (V3d_TypeOfOrientation theOrient);
//! Return TRUE if specified orientation belongs to box corner (vertex).
Standard_EXPORT static bool IsBoxCorner (V3d_TypeOfOrientation theOrient);
public:
//! Empty constructor.
Standard_EXPORT AIS_ViewCube();
//! Return view animation.
const Handle(AIS_AnimationCamera)& ViewAnimation() const { return myViewAnimation; }
//! Set view animation.
void SetViewAnimation (const Handle(AIS_AnimationCamera)& theAnimation) { myViewAnimation = theAnimation; }
//! Return TRUE if automatic camera transformation on selection (highlighting) is enabled; TRUE by default.
Standard_Boolean ToAutoStartAnimation() const { return myToAutoStartAnim; }
//! Enable/disable automatic camera transformation on selection (highlighting).
//! The automatic logic can be disabled if application wants performing action manually
//! basing on picking results (AIS_ViewCubeOwner).
void SetAutoStartAnimation (bool theToEnable) { myToAutoStartAnim = theToEnable; }
//! Return TRUE if camera animation should be done in uninterruptible loop; TRUE by default.
Standard_Boolean IsFixedAnimationLoop() const { return myIsFixedAnimation; }
//! Set if camera animation should be done in uninterruptible loop.
void SetFixedAnimationLoop (bool theToEnable) { myIsFixedAnimation = theToEnable; }
//! Reset all size and style parameters to default.
//! @warning It doesn't reset position of View Cube
Standard_EXPORT void ResetStyles();
protected:
//! Set default visual attributes
Standard_EXPORT void setDefaultAttributes();
//! Set default dynamic highlight properties
Standard_EXPORT void setDefaultHighlightAttributes();
public: //! @name Geometry management API
//! @return size (width and height) of View cube sides; 100 by default.
Standard_Real Size() const { return mySize; }
//! Sets size (width and height) of View cube sides.
//! @param theToAdaptAnother if TRUE, then other parameters will be adapted to specified size
Standard_EXPORT void SetSize (Standard_Real theValue,
Standard_Boolean theToAdaptAnother = true);
//! Return box facet extension to edge/corner facet split; 10 by default.
Standard_Real BoxFacetExtension() const { return myBoxFacetExtension; }
//! Set new value of box facet extension.
void SetBoxFacetExtension (Standard_Real theValue)
{
if (Abs (myBoxFacetExtension - theValue) > Precision::Confusion())
{
myBoxFacetExtension = theValue;
SetToUpdate();
}
}
//! Return padding between axes and 3D part (box); 10 by default.
Standard_Real AxesPadding() const { return myAxesPadding; }
//! Set new value of padding between axes and 3D part (box).
void SetAxesPadding (Standard_Real theValue)
{
if (Abs (myAxesPadding - theValue) > Precision::Confusion())
{
myAxesPadding = theValue;
SetToUpdate();
}
}
//! Return gap between box edges and box sides; 0 by default.
Standard_Real BoxEdgeGap() const { return myBoxEdgeGap; }
//! Set new value of box edges gap.
void SetBoxEdgeGap (Standard_Real theValue)
{
if (Abs (myBoxEdgeGap - theValue) > Precision::Confusion())
{
myBoxEdgeGap = theValue;
SetToUpdate();
}
}
//! Return minimal size of box edge; 2 by default.
Standard_Real BoxEdgeMinSize() const { return myBoxEdgeMinSize; }
//! Set new value of box edge minimal size.
void SetBoxEdgeMinSize (Standard_Real theValue)
{
if (Abs (myBoxEdgeMinSize - theValue) > Precision::Confusion())
{
myBoxEdgeMinSize = theValue;
SetToUpdate();
}
}
//! Return minimal size of box corner; 2 by default.
Standard_Real BoxCornerMinSize() const { return myCornerMinSize; }
//! Set new value of box corner minimal size.
void SetBoxCornerMinSize (Standard_Real theValue)
{
if (Abs (myCornerMinSize - theValue) > Precision::Confusion())
{
myCornerMinSize = theValue;
SetToUpdate();
}
}
//! Return relative radius of side corners (round rectangle); 0.0 by default.
//! The value in within [0, 0.5] range meaning absolute radius = RoundRadius() / Size().
Standard_Real RoundRadius() const { return myRoundRadius; }
//! Set relative radius of View Cube sides corners (round rectangle).
//! The value should be within [0, 0.5] range.
Standard_EXPORT void SetRoundRadius (const Standard_Real theValue);
//! @return TRUE if trihedron is drawn; TRUE by default.
Standard_Boolean ToDrawAxes() const { return myToDisplayAxes; }
//! Enable/disable drawing of trihedron.
void SetDrawAxes (Standard_Boolean theValue)
{
if (myToDisplayAxes != theValue)
{
myToDisplayAxes = theValue;
SetToUpdate();
}
}
//! @return TRUE if edges of View Cube is drawn; TRUE by default.
Standard_Boolean ToDrawEdges() const { return myToDisplayEdges; }
//! Enable/disable drawing of edges of View Cube.
void SetDrawEdges (Standard_Boolean theValue)
{
if (myToDisplayEdges != theValue)
{
myToDisplayEdges = theValue;
SetToUpdate();
}
}
//! Return TRUE if vertices (vertex) of View Cube is drawn; TRUE by default.
Standard_Boolean ToDrawVertices() const { return myToDisplayVertices; }
//! Enable/disable drawing of vertices (corners) of View Cube.
void SetDrawVertices (Standard_Boolean theValue)
{
if (myToDisplayVertices != theValue)
{
myToDisplayVertices = theValue;
SetToUpdate();
}
}
//! Return TRUE if application expects Y-up viewer orientation instead of Z-up; FALSE by default.
Standard_Boolean IsYup() const { return myIsYup; }
//! Set if application expects Y-up viewer orientation instead of Z-up.
Standard_EXPORT void SetYup (Standard_Boolean theIsYup,
Standard_Boolean theToUpdateLabels = Standard_True);
public: //! @name Style management API
//! Return shading style of box sides.
const Handle(Prs3d_ShadingAspect)& BoxSideStyle() const { return myDrawer->ShadingAspect(); }
//! Return shading style of box edges.
const Handle(Prs3d_ShadingAspect)& BoxEdgeStyle() const { return myBoxEdgeAspect; }
//! Return shading style of box corners.
const Handle(Prs3d_ShadingAspect)& BoxCornerStyle() const { return myBoxCornerAspect; }
//! Return value of front color for the 3D part of object.
const Quantity_Color& BoxColor() const { return myDrawer->ShadingAspect()->Color(); }
//! Set new value of front color for the 3D part of object.
//! @param theColor [in] input color value.
void SetBoxColor (const Quantity_Color& theColor)
{
if (!myDrawer->ShadingAspect()->Color().IsEqual (theColor)
|| !myBoxEdgeAspect ->Color().IsEqual (theColor)
|| !myBoxCornerAspect->Color().IsEqual (theColor))
{
myDrawer->ShadingAspect()->SetColor (theColor);
myBoxEdgeAspect->SetColor (theColor);
myBoxCornerAspect->SetColor (theColor);
SynchronizeAspects();
}
}
//! Return transparency for 3D part of object.
Standard_Real BoxTransparency() const { return myDrawer->ShadingAspect()->Transparency(); }
//! Set new value of transparency for 3D part of object.
//! @param theValue [in] input transparency value
void SetBoxTransparency (Standard_Real theValue)
{
if (Abs (myDrawer->ShadingAspect()->Transparency() - theValue) > Precision::Confusion()
|| Abs (myBoxEdgeAspect ->Transparency() - theValue) > Precision::Confusion()
|| Abs (myBoxCornerAspect->Transparency() - theValue) > Precision::Confusion())
{
myDrawer->ShadingAspect()->SetTransparency (theValue);
myBoxEdgeAspect->SetTransparency (theValue);
myBoxCornerAspect->SetTransparency (theValue);
SynchronizeAspects();
}
}
//! Return color of sides back material.
const Quantity_Color& InnerColor() const { return myDrawer->ShadingAspect()->Color (Aspect_TOFM_BACK_SIDE); }
//! Set color of sides back material. Alias for:
//! @code Attributes()->ShadingAspect()->Aspect()->ChangeBackMaterial().SetColor() @endcode
void SetInnerColor (const Quantity_Color& theColor)
{
myDrawer->ShadingAspect()->SetColor (theColor, Aspect_TOFM_BACK_SIDE);
SynchronizeAspects();
}
//! Return box side label or empty string if undefined.
//! Default labels: FRONT, BACK, LEFT, RIGHT, TOP, BOTTOM.
TCollection_AsciiString BoxSideLabel (V3d_TypeOfOrientation theSide) const
{
const TCollection_AsciiString* aLabel = myBoxSideLabels.Seek (theSide);
return aLabel != NULL ? *aLabel : TCollection_AsciiString();
}
//! Set box side label.
void SetBoxSideLabel (const V3d_TypeOfOrientation theSide,
const TCollection_AsciiString& theLabel)
{
if (!IsBoxSide (theSide))
{
throw Standard_ProgramError ("AIS_ViewCube::SetBoxSideLabel(), invalid enumeration value");
}
myBoxSideLabels.Bind (theSide, theLabel);
SetToUpdate();
}
//! Return text color of labels of box sides; BLACK by default.
const Quantity_Color& TextColor() const { return myDrawer->TextAspect()->Aspect()->Color(); }
//! Set color of text labels on box sides. Alias for:
//! @code Attributes()->TextAspect()->SetColor() @endcode
void SetTextColor (const Quantity_Color& theColor)
{
myDrawer->TextAspect()->SetColor (theColor);
SynchronizeAspects();
}
//! Return font name that is used for displaying of sides and axes text. Alias for:
//! @code Attributes()->TextAspect()->Aspect()->SetFont() @endcode
const TCollection_AsciiString& Font() const { return myDrawer->TextAspect()->Aspect()->Font(); }
//! Set font name that is used for displaying of sides and axes text. Alias for:
//! @code Attributes()->TextAspect()->SetFont() @endcode
void SetFont (const TCollection_AsciiString& theFont)
{
myDrawer->TextAspect()->Aspect()->SetFont (theFont);
SynchronizeAspects();
}
//! Return height of font
Standard_Real FontHeight() const { return myDrawer->TextAspect()->Height(); }
//! Change font height. Alias for:
//! @code Attributes()->TextAspect()->SetHeight() @endcode
void SetFontHeight (Standard_Real theValue)
{
if (Abs (myDrawer->TextAspect()->Height() - theValue) > Precision::Confusion())
{
myDrawer->TextAspect()->SetHeight (theValue);
SetToUpdate();
}
}
//! Return axes labels or empty string if undefined.
//! Default labels: X, Y, Z.
TCollection_AsciiString AxisLabel (Prs3d_DatumParts theAxis) const
{
const TCollection_AsciiString* aLabel = myAxesLabels.Seek (theAxis);
return aLabel != NULL ? *aLabel : TCollection_AsciiString();
}
//! Set axes labels.
void SetAxesLabels (const TCollection_AsciiString& theX,
const TCollection_AsciiString& theY,
const TCollection_AsciiString& theZ)
{
myAxesLabels.Bind (Prs3d_DP_XAxis, theX);
myAxesLabels.Bind (Prs3d_DP_YAxis, theY);
myAxesLabels.Bind (Prs3d_DP_ZAxis, theZ);
SetToUpdate();
}
public:
//! Set new value of color for the whole object.
//! @param theColor [in] input color value.
virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE
{
SetBoxColor (theColor);
}
//! Reset color for the whole object.
virtual void UnsetColor() Standard_OVERRIDE
{
myDrawer->ShadingAspect()->SetColor (Quantity_NOC_WHITE);
myBoxEdgeAspect ->SetColor (Quantity_NOC_GRAY30);
myBoxCornerAspect->SetColor (Quantity_NOC_GRAY30);
SynchronizeAspects();
}
//! Set new value of transparency for the whole object.
//! @param theValue [in] input transparency value.
virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE
{
SetBoxTransparency (theValue);
}
//! Reset transparency for the whole object.
virtual void UnsetTransparency() Standard_OVERRIDE
{
SetBoxTransparency (0.0f);
}
//! Sets the material for the interactive object.
virtual void SetMaterial (const Graphic3d_MaterialAspect& theMat) Standard_OVERRIDE
{
myDrawer->ShadingAspect()->SetMaterial (theMat);
myBoxEdgeAspect ->SetMaterial (theMat);
myBoxCornerAspect->SetMaterial (theMat);
SynchronizeAspects();
}
//! Sets the material for the interactive object.
virtual void UnsetMaterial() Standard_OVERRIDE
{
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_UserDefined);
aMat.SetColor (Quantity_NOC_WHITE);
aMat.SetAmbientColor (Quantity_NOC_GRAY60);
myDrawer->ShadingAspect()->SetMaterial (aMat);
myBoxEdgeAspect ->SetMaterial (aMat);
myBoxEdgeAspect ->SetColor (Quantity_NOC_GRAY30);
myBoxCornerAspect->SetMaterial (aMat);
myBoxCornerAspect->SetColor (Quantity_NOC_GRAY30);
SynchronizeAspects();
}
public: //! @name animation methods
//! Return duration of animation in seconds; 0.5 sec by default
Standard_Real Duration() const { return myDuration; }
//! Set duration of animation.
//! @param theValue [in] input value of duration in seconds
void SetDuration (Standard_Real theValue) { myDuration = theValue; }
//! Return TRUE if new camera Up direction should be always set to default value for a new camera Direction; FALSE by default.
//! When this flag is FALSE, the new camera Up will be set as current Up orthogonalized to the new camera Direction,
//! and will set to default Up on second click.
Standard_Boolean ToResetCameraUp() const { return myToResetCameraUp; }
//! Set if new camera Up direction should be always set to default value for a new camera Direction.
void SetResetCamera (Standard_Boolean theToReset) { myToResetCameraUp = theToReset; }
//! Return TRUE if animation should fit selected objects and FALSE to fit entire scene; TRUE by default.
Standard_Boolean ToFitSelected() const { return myToFitSelected; }
//! Set if animation should fit selected objects or to fit entire scene.
void SetFitSelected (Standard_Boolean theToFitSelected) { myToFitSelected = theToFitSelected; }
//! @return TRUE if View Cube has unfinished animation of view camera.
Standard_EXPORT Standard_Boolean HasAnimation() const;
//! Start camera transformation corresponding to the input detected owner.
//! @param theOwner [in] detected owner.
Standard_EXPORT virtual void StartAnimation (const Handle(AIS_ViewCubeOwner)& theOwner);
//! Perform one step of current camera transformation.
//! theToUpdate [in] enable/disable update of view.
//! @return TRUE if animation is not stopped.
Standard_EXPORT virtual Standard_Boolean UpdateAnimation (const Standard_Boolean theToUpdate);
//! Perform camera transformation corresponding to the input detected owner.
Standard_EXPORT virtual void HandleClick (const Handle(AIS_ViewCubeOwner)& theOwner);
protected:
//! Perform internal single step of animation.
//! @return FALSE if animation has been finished
Standard_EXPORT Standard_Boolean updateAnimation();
//! Fit selected/all into view.
//! @param theView [in] view definition to retrieve scene bounding box
//! @param theCamera [in,out] camera definition
Standard_EXPORT virtual void viewFitAll (const Handle(V3d_View)& theView,
const Handle(Graphic3d_Camera)& theCamera);
protected: //! @name protected virtual API
//! Method that is called after one step of transformation.
virtual void onAfterAnimation() {}
//! Method that is called after transformation finish.
virtual void onAnimationFinished() {}
public: //! @name Presentation computation
//! Return TRUE for supported display mode.
virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
//! Global selection has no meaning for this class.
virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const Standard_OVERRIDE { return Handle(SelectMgr_EntityOwner)(); }
//! Compute 3D part of View Cube.
//! @param thePrsMgr [in] presentation manager.
//! @param thePrs [in] input presentation that is to be filled with flat presentation primitives.
//! @param theMode [in] display mode.
//! @warning this object accept only 0 display mode.
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode = 0) Standard_OVERRIDE;
//! Redefine computing of sensitive entities for View Cube.
//! @param theSelection [in] input selection object that is to be filled with sensitive entities.
//! @param theMode [in] selection mode.
//! @warning object accepts only 0 selection mode.
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
//! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overridden methods.
virtual Standard_Boolean IsAutoHilight() const Standard_OVERRIDE { return Standard_False; }
//! Method which clear all selected owners belonging to this selectable object.
//! @warning this object does not support selection.
virtual void ClearSelected() Standard_OVERRIDE {}
//! Method which highlights input owner belonging to this selectable object.
//! @param thePM [in] presentation manager
//! @param theStyle [in] style for dynamic highlighting.
//! @param theOwner [in] input entity owner.
Standard_EXPORT virtual void HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Prs3d_Drawer)& theStyle,
const Handle(SelectMgr_EntityOwner)& theOwner) Standard_OVERRIDE;
//! Method which draws selected owners.
Standard_EXPORT virtual void HilightSelected (const Handle(PrsMgr_PresentationManager3d)& thePM,
const SelectMgr_SequenceOfOwner& theSeq) Standard_OVERRIDE;
//! Set default parameters for visual attributes
//! @sa Attributes()
virtual void UnsetAttributes() Standard_OVERRIDE
{
setDefaultAttributes();
SetToUpdate();
}
//! Set default parameters for dynamic highlighting attributes, reset highlight attributes
virtual void UnsetHilightAttributes() Standard_OVERRIDE
{
myHilightDrawer.Nullify();
setDefaultHighlightAttributes();
SetToUpdate();
}
protected: //! @name Auxiliary classes to fill presentation with proper primitives
//! Create triangulation for a box part - for presentation and selection purposes.
//! @param theTris [in,out] triangulation to fill, or NULL to return size
//! @param theNbNodes [in,out] should be incremented by a number of nodes defining this triangulation
//! @param theNbTris [in,out] should be incremented by a number of triangles defining this triangulation
//! @param theDir [in] part to define
Standard_EXPORT virtual void createBoxPartTriangles (const Handle(Graphic3d_ArrayOfTriangles)& theTris,
Standard_Integer& theNbNodes,
Standard_Integer& theNbTris,
V3d_TypeOfOrientation theDir) const;
//! Create triangulation for a box side.
//! @param theTris [in,out] triangulation to fill, or NULL to return size
//! @param theNbNodes [in,out] should be incremented by a number of nodes defining this triangulation
//! @param theNbTris [in,out] should be incremented by a number of triangles defining this triangulation
//! @param theDir [in] part to define
Standard_EXPORT virtual void createBoxSideTriangles (const Handle(Graphic3d_ArrayOfTriangles)& theTris,
Standard_Integer& theNbNodes,
Standard_Integer& theNbTris,
V3d_TypeOfOrientation theDir) const;
//! Create triangulation for a box edge.
//! @param theTris [in,out] triangulation to fill, or NULL to return size
//! @param theNbNodes [in,out] should be incremented by a number of nodes defining this triangulation
//! @param theNbTris [in,out] should be incremented by a number of triangles defining this triangulation
//! @param theDir [in] part to define
Standard_EXPORT virtual void createBoxEdgeTriangles (const Handle(Graphic3d_ArrayOfTriangles)& theTris,
Standard_Integer& theNbNodes,
Standard_Integer& theNbTris,
V3d_TypeOfOrientation theDir) const;
//! Create triangulation for a box corner (vertex).
//! @param theTris [in,out] triangulation to fill, or NULL to return size
//! @param theNbNodes [in,out] should be incremented by a number of nodes defining this triangulation
//! @param theNbTris [in,out] should be incremented by a number of triangles defining this triangulation
//! @param theDir [in] part to define
Standard_EXPORT virtual void createBoxCornerTriangles (const Handle(Graphic3d_ArrayOfTriangles)& theTris,
Standard_Integer& theNbNodes,
Standard_Integer& theNbTris,
V3d_TypeOfOrientation theDir) const;
protected:
//! Create triangulation for a rectangle with round corners.
//! @param theTris [in,out] triangulation to fill, or NULL to return size
//! @param theNbNodes [in,out] should be incremented by a number of nodes defining this triangulation
//! @param theNbTris [in,out] should be incremented by a number of triangles defining this triangulation
//! @param theSize [in] rectangle dimensions
//! @param theRadius [in] radius at corners
//! @param theTrsf [in] transformation
Standard_EXPORT static void createRoundRectangleTriangles (const Handle(Graphic3d_ArrayOfTriangles)& theTris,
Standard_Integer& theNbNodes,
Standard_Integer& theNbTris,
const gp_XY& theSize,
Standard_Real theRadius,
const gp_Trsf& theTrsf);
protected:
//! Trivial hasher to avoid ambiguity with enumeration type.
struct IntegerHasher
{
static Standard_Integer HashCode (Standard_Integer theValue, Standard_Integer theUpper) { return ::HashCode (theValue, theUpper); }
static Standard_Boolean IsEqual (Standard_Integer theA, Standard_Integer theB) { return theA == theB; }
};
protected:
NCollection_DataMap<V3d_TypeOfOrientation, TCollection_AsciiString, IntegerHasher>
myBoxSideLabels; //!< map with box side labels
NCollection_DataMap<Prs3d_DatumParts, TCollection_AsciiString, IntegerHasher>
myAxesLabels; //!< map with axes labels
Handle(Prs3d_ShadingAspect) myBoxEdgeAspect; //!< style for box edges
Handle(Prs3d_ShadingAspect) myBoxCornerAspect; //!< style for box corner
Standard_Real mySize; //!< size of box side, length of one axis
Standard_Real myBoxEdgeMinSize; //!< minimal size of box edge
Standard_Real myBoxEdgeGap; //!< gap between box side and box edge
Standard_Real myBoxFacetExtension; //!< box facet extension
Standard_Real myAxesPadding; //!< Padding between box and axes
Standard_Real myCornerMinSize; //!< minimal size of box corner
Standard_Real myRoundRadius; //!< relative round radius within [0; 0.5] range
Standard_Boolean myToDisplayAxes; //!< trihedron visibility
Standard_Boolean myToDisplayEdges; //!< box edges visibility
Standard_Boolean myToDisplayVertices; //!< box corners (vertices) visibility
Standard_Boolean myIsYup; //!< flag indicating that application expects Y-up viewer orientation instead of Z-up
protected: //! @name Animation options
Handle(AIS_AnimationCamera) myViewAnimation; //!< Camera animation object
Handle(Graphic3d_Camera) myStartState; //!< Start state of view camera
Handle(Graphic3d_Camera) myEndState; //!< End state of view camera
Standard_Real myDuration; //!< Duration of animation. By default it is half a second
Standard_Boolean myToAutoStartAnim; //!< start animation automatically on click
Standard_Boolean myIsFixedAnimation; //!< fixed-loop animation
Standard_Boolean myToFitSelected; //!< fit selected or fit entire scene
Standard_Boolean myToResetCameraUp; //!< always reset camera up direction to default
};
//! Redefined entity owner that is highlighted when owner is detected,
//! even if Interactive Context highlighted on last detection procedure.
class AIS_ViewCubeOwner : public SelectMgr_EntityOwner
{
DEFINE_STANDARD_RTTIEXT(AIS_ViewCubeOwner, SelectMgr_EntityOwner)
public:
//! Main constructor.
AIS_ViewCubeOwner (const Handle(AIS_ViewCube)& theObject,
V3d_TypeOfOrientation theOrient,
Standard_Integer thePriority = 5)
: SelectMgr_EntityOwner ((const Handle(SelectMgr_SelectableObject)& )theObject, thePriority),
myMainOrient (theOrient)
{
myFromDecomposition = true;
}
//! @return TRUE. This owner will always call method
//! Hilight for its Selectable Object when the owner is detected.
virtual Standard_Boolean IsForcedHilight() const Standard_OVERRIDE { return Standard_True; }
//! Return new orientation to set.
V3d_TypeOfOrientation MainOrientation() const { return myMainOrient; }
//! Handle mouse button click event.
virtual Standard_Boolean HandleMouseClick (const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick) Standard_OVERRIDE
{
(void )thePoint; (void )theButton; (void )theModifiers; (void )theIsDoubleClick;
AIS_ViewCube* aCubePrs = dynamic_cast<AIS_ViewCube* >(mySelectable);
aCubePrs->HandleClick (this);
return Standard_True;
}
protected:
V3d_TypeOfOrientation myMainOrient; //!< new orientation to set
};
#endif // _AIS_ViewCube_HeaderFile

View File

@@ -182,4 +182,6 @@ AIS_TypeOfPlane.hxx
AIS_ViewController.cxx
AIS_ViewController.hxx
AIS_ViewInputBuffer.hxx
AIS_ViewCube.cxx
AIS_ViewCube.hxx
AIS_WalkDelta.hxx

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -48,25 +48,6 @@ Aspect_GenId::Aspect_GenId (const Standard_Integer theLow,
}
}
// =======================================================================
// function : HasFree
// purpose :
// =======================================================================
Standard_Boolean Aspect_GenId::HasFree() const
{
return myFreeCount > 0
|| myFreeIds.Extent() > 0;
}
// =======================================================================
// function : Available
// purpose :
// =======================================================================
Standard_Integer Aspect_GenId::Available() const
{
return myFreeCount + myFreeIds.Extent();
}
// =======================================================================
// function : Free
// purpose :
@@ -99,41 +80,37 @@ void Aspect_GenId::Free (const Standard_Integer theId)
}
// =======================================================================
// function : Lower
// function : Next
// purpose :
// =======================================================================
Standard_Integer Aspect_GenId::Lower() const
Standard_Integer Aspect_GenId::Next()
{
return myLowerBound;
Standard_Integer aNewId = 0;
if (!Next (aNewId))
{
throw Aspect_IdentDefinitionError("Aspect_GenId::Next(), Error: Available == 0");
}
return aNewId;
}
// =======================================================================
// function : Next
// purpose :
// =======================================================================
Standard_Integer Aspect_GenId::Next()
Standard_Boolean Aspect_GenId::Next (Standard_Integer& theId)
{
if (!myFreeIds.IsEmpty())
{
const Standard_Integer anId = myFreeIds.First();
theId = myFreeIds.First();
myFreeIds.RemoveFirst();
return anId;
return Standard_True;
}
else if (myFreeCount < 1)
{
throw Aspect_IdentDefinitionError("GenId Next Error: Available == 0");
return Standard_False;
}
--myFreeCount;
const Standard_Integer anId = myLowerBound + myLength - myFreeCount - 1;
return anId;
}
// =======================================================================
// function : Upper
// purpose :
// =======================================================================
Standard_Integer Aspect_GenId::Upper() const
{
return myUpperBound;
theId = myLowerBound + myLength - myFreeCount - 1;
return Standard_True;
}

View File

@@ -49,47 +49,38 @@ public:
Standard_EXPORT void Free (const Standard_Integer theId);
//! Returns true if there are available identifiers in range.
Standard_EXPORT Standard_Boolean HasFree() const;
Standard_Boolean HasFree() const
{
return myFreeCount > 0
|| myFreeIds.Extent() > 0;
}
//! Returns the number of available identifiers.
Standard_EXPORT Standard_Integer Available() const;
Standard_Integer Available() const { return myFreeCount + myFreeIds.Extent(); }
//! Returns the lower identifier in range.
Standard_EXPORT Standard_Integer Lower() const;
Standard_Integer Lower() const { return myLowerBound; }
//! Returns the next available identifier.
//! Warning: Raises IdentDefinitionError if all identifiers are busy.
Standard_EXPORT Standard_Integer Next();
//! Generates the next available identifier.
//! @param theId [out] generated identifier
//! @return FALSE if all identifiers are busy.
Standard_EXPORT Standard_Boolean Next (Standard_Integer& theId);
//! Returns the upper identifier in range.
Standard_EXPORT Standard_Integer Upper() const;
protected:
Standard_Integer Upper() const { return myUpperBound; }
private:
Standard_Integer myFreeCount;
Standard_Integer myLength;
Standard_Integer myLowerBound;
Standard_Integer myUpperBound;
TColStd_ListOfInteger myFreeIds;
};
#endif // _Aspect_GenId_HeaderFile

View File

@@ -255,9 +255,8 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
//
const BOPDS_MapOfPair& aMPK=aDS.Interferences();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using namespace std;
vector <BOPTest_Interf> aVec;
vector <BOPTest_Interf>::iterator aIt;
std::vector <BOPTest_Interf> aVec;
std::vector <BOPTest_Interf>::iterator aIt;
BOPTest_Interf aBInterf;
//
aItMPK.Initialize(aMPK);
@@ -281,7 +280,7 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
aVec.push_back(aBInterf);
}
//
sort( aVec.begin(), aVec.end(), less<BOPTest_Interf>());
sort( aVec.begin(), aVec.end(), std::less<BOPTest_Interf>());
//
iCnt=0;
for (aIt=aVec.begin(); aIt!=aVec.end(); aIt++) {

View File

@@ -988,7 +988,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
aDN1, aDBF, theContext, aProjPL, aDt3D);
if (!bIsComputed) {
#ifdef OCCT_DEBUG
cout << "BOPTools_AlgoTools::GetFaceOff(): incorrect computation of bi-normal direction." << endl;
std::cout << "BOPTools_AlgoTools::GetFaceOff(): incorrect computation of bi-normal direction." << std::endl;
#endif
}
//
@@ -1006,7 +1006,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
aDBF2, theContext, aProjPL, aDt3D);
if (!bIsComputed) {
#ifdef OCCT_DEBUG
cout << "BOPTools_AlgoTools::GetFaceOff(): incorrect computation of bi-normal direction." << endl;
std::cout << "BOPTools_AlgoTools::GetFaceOff(): incorrect computation of bi-normal direction." << std::endl;
#endif
}
//Angle

View File

@@ -149,7 +149,7 @@ BRepAlgo_BooleanOperation::~BRepAlgo_BooleanOperation()
}
myBuilderCanWork = (esp || tede) ;
#ifdef OCCT_DEBUG
if (!esp) cout<<"BRepAlgo_BooleanOperation(DEB) some edges not SameParameter"<<endl;
if (!esp) std::cout<<"BRepAlgo_BooleanOperation(DEB) some edges not SameParameter"<<std::endl;
#endif
if (!myBuilderCanWork) return;
@@ -241,8 +241,8 @@ BRepAlgo_BooleanOperation::~BRepAlgo_BooleanOperation()
Vertex2.Append(Ex.Current()); nbv2++;
}
//-- cout<<"Solids1: "<<nbs1<<" Faces1: "<<nbf1<<" Edges1:"<<nbe1<<" Vtx1:"<<nbv1<<endl;
//-- cout<<"Solids2: "<<nbs2<<" Faces2: "<<nbf2<<" Edges2:"<<nbe2<<" Vtx2:"<<nbv2<<endl;
//-- std::cout<<"Solids1: "<<nbs1<<" Faces1: "<<nbf1<<" Edges1:"<<nbe1<<" Vtx1:"<<nbv1<<std::endl;
//-- std::cout<<"Solids2: "<<nbs2<<" Faces2: "<<nbf2<<" Edges2:"<<nbe2<<" Vtx2:"<<nbv2<<std::endl;
//==
@@ -253,14 +253,14 @@ BRepAlgo_BooleanOperation::~BRepAlgo_BooleanOperation()
// Standard_Boolean Correct = Standard_True;
if( (nbs1 && nbs2==0 && St1==TopAbs_OUT && St2==TopAbs_IN)
|| (nbs2 && nbs1==0 && St2==TopAbs_OUT && St1==TopAbs_IN)) {
//-- cout<<"***** Invalid Operation : Cut of a Solid by a Non Solid "<<endl;
//-- std::cout<<"***** Invalid Operation : Cut of a Solid by a Non Solid "<<std::endl;
Done();
return;
}
if( (nbs1 && nbs2==0 && St1==TopAbs_OUT && St2==TopAbs_OUT)
|| (nbs2 && nbs1==0 && St2==TopAbs_OUT && St1==TopAbs_OUT)) {
//-- cout<<"***** Invalid Operation : Fusion of a Solid and a Non Solid "<<endl;
//-- std::cout<<"***** Invalid Operation : Fusion of a Solid and a Non Solid "<<std::endl;
Done();
return;
}
@@ -268,7 +268,7 @@ BRepAlgo_BooleanOperation::~BRepAlgo_BooleanOperation()
if( (nbs1>0 && nbs2>0)
&& (nbe1 || nbe2 || nbf1 || nbf2 || nbv1 || nbv2)) {
//-- cout<<"***** Not Yet Implemented : Compound of solid and non Solid"<<endl;
//-- std::cout<<"***** Not Yet Implemented : Compound of solid and non Solid"<<std::endl;
Done();
return;
}

View File

@@ -198,7 +198,7 @@ static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
if (!VB[0].IsSame(VB[1])) {
#ifdef OCCT_DEBUG_ALGO
if (AffichLoop)
cout <<"Two different vertices on the closing vertex"<<endl;
std::cout <<"Two different vertices on the closing vertex"<<std::endl;
#endif
}
else {
@@ -314,7 +314,7 @@ static Standard_Boolean SelectEdge(const TopoDS_Face& F,
#ifdef OCCT_DEBUG_ALGO
if (AffichLoop) {
if ( LE.Extent() > 2) {
cout <<"vertex on more than 2 edges in a face."<<endl;
std::cout <<"vertex on more than 2 edges in a face."<<std::endl;
}
}
#endif
@@ -512,7 +512,7 @@ void BRepAlgo_Loop::Perform()
#ifdef OCCT_DEBUG_ALGO
if (AffichLoop) {
cout <<"NewLoop"<<endl;
std::cout <<"NewLoop"<<std::endl;
NbLoops++;
#ifdef DRAW
sprintf(name,"FLoop_%d",NbLoops);
@@ -582,7 +582,7 @@ void BRepAlgo_Loop::Perform()
#ifdef DRAW
if (AffichLoop) {
cout <<"NewLoop"<<endl;
std::cout <<"NewLoop"<<std::endl;
Standard_Integer NbEdges = 1;
TopTools_MapOfShape Done;
for (Standard_Integer iV = 1; iV <= MVE.Extent(); iV++) {
@@ -685,9 +685,9 @@ void BRepAlgo_Loop::Perform()
}
#ifdef OCCT_DEBUG_ALGO
else {
cout <<"BRepAlgo_Loop: Open Wire"<<endl;
std::cout <<"BRepAlgo_Loop: Open Wire"<<std::endl;
if (AffichLoop)
cout << "OpenWire is : NW_"<<NbLoops<<"_"<<NbWires<<endl;
std::cout << "OpenWire is : NW_"<<NbLoops<<"_"<<NbWires<<std::endl;
}
#endif
#ifdef DRAW

View File

@@ -292,8 +292,8 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
for(k = 1; k <= Projector.NbCurves(); k++){
if(Projector.IsSinglePnt(k, P2d)){
#ifdef OCCT_DEBUG
cout << "Projection of edge "<<i<<" on face "<<j;
cout << " is punctual"<<endl<<endl;
std::cout << "Projection of edge "<<i<<" on face "<<j;
std::cout << " is punctual"<<std::endl<<std::endl;
#endif
Projector.GetSurface()->D0(P2d.X(), P2d.Y(), P);
prj = BRepLib_MakeVertex(P).Shape();
@@ -310,8 +310,8 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
/**************************************************************/
if (Projector.IsUIso(k, UIso)) {
#ifdef OCCT_DEBUG
cout << "Projection of edge "<<i<<" on face "<<j;
cout << " is U-isoparametric"<<endl<<endl;
std::cout << "Projection of edge "<<i<<" on face "<<j;
std::cout << " is U-isoparametric"<<std::endl<<std::endl;
#endif
Projector.D0(Udeb, Pdeb);
Projector.D0(Ufin, Pfin);
@@ -327,8 +327,8 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
}
else if (Projector.IsVIso(k, VIso)) {
#ifdef OCCT_DEBUG
cout << "Projection of edge "<<i<<" on face "<<j;
cout << " is V-isoparametric"<<endl<<endl;
std::cout << "Projection of edge "<<i<<" on face "<<j;
std::cout << " is V-isoparametric"<<std::endl<<std::endl;
#endif
Projector.D0(Udeb, Pdeb);
Projector.D0(Ufin, Pfin);
@@ -370,12 +370,12 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
ResultChron(chr_approx,t_approx);
approx_count++;
cout<<"Approximation.IsDone = "<<appr.IsDone()<<endl;
std::cout<<"Approximation.IsDone = "<<appr.IsDone()<<std::endl;
if(!Only2d)
cout<<"MaxError3d = "<<appr.MaxError3d()<<endl<<endl;
std::cout<<"MaxError3d = "<<appr.MaxError3d()<<std::endl<<std::endl;
if(!Only3d) {
cout<<"MaxError2dU = "<<appr.MaxError2dU()<<endl;
cout<<"MaxError2dV = "<<appr.MaxError2dV()<<endl<<endl;
std::cout<<"MaxError2dU = "<<appr.MaxError2dU()<<std::endl;
std::cout<<"MaxError2dV = "<<appr.MaxError2dV()<<std::endl<<std::endl;
}
#endif
@@ -440,8 +440,8 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
}
if (Degenerated) {
#ifdef OCCT_DEBUG
cout << "Projection of edge "<<i<<" on face "<<j;
cout << " is degenerated "<<endl<<endl;
std::cout << "Projection of edge "<<i<<" on face "<<j;
std::cout << " is degenerated "<<std::endl<<std::endl;
#endif
TopoDS_Vertex VV;
BB.MakeVertex(VV);
@@ -511,7 +511,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
}
else {
#ifdef OCCT_DEBUG
cout << " BooleanOperations : no solution " << endl;
std::cout << " BooleanOperations : no solution " << std::endl;
#endif
BRepTopAdaptor_FClass2d classifier(TopoDS::Face(Faces->Value(j)),
@@ -557,13 +557,13 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
#ifdef OCCT_DEBUG_CHRONO
ResultChron(chr_total,t_total);
cout<<"Build - Total time : "<<t_total<<" includes:" <<endl;
cout<<"- Projection : "<<t_init<<endl;
cout<<" -- Initial point search : "<<t_init_point<<endl;
cout<<" -- DichoBound search : "<<t_dicho_bound<<endl;
cout<<"- Approximation : "<<t_approx<<endl;
cout<<"- Boolean operation : "<<t_booltool<<endl;
cout<<"- Rest of time : "<<t_total-(t_init + t_approx + t_booltool )<<endl<<endl;
std::cout<<"Build - Total time : "<<t_total<<" includes:" <<std::endl;
std::cout<<"- Projection : "<<t_init<<std::endl;
std::cout<<" -- Initial point search : "<<t_init_point<<std::endl;
std::cout<<" -- DichoBound search : "<<t_dicho_bound<<std::endl;
std::cout<<"- Approximation : "<<t_approx<<std::endl;
std::cout<<"- Boolean operation : "<<t_booltool<<std::endl;
std::cout<<"- Rest of time : "<<t_total-(t_init + t_approx + t_booltool )<<std::endl<<std::endl;
if (init_count != 0)
t_init /= init_count;
if (init_point_count != 0)
@@ -575,13 +575,13 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if (booltool_count != 0)
t_booltool /= booltool_count;
cout<<"Unitary average time : "<<endl;
cout<<"- Projection : "<<t_init<<endl;
cout<<" -- Initial point search: "<<t_init_point<<endl;
cout<<" -- DichoBound search : "<<t_dicho_bound<<endl;
cout<<"- Approximation : "<<t_approx<<endl;
cout<<"- Boolean operation :"<<t_booltool<<endl;
cout<<endl<<"Number of initial point computations is "<<init_point_count<<endl<<endl;
std::cout<<"Unitary average time : "<<std::endl;
std::cout<<"- Projection : "<<t_init<<std::endl;
std::cout<<" -- Initial point search: "<<t_init_point<<std::endl;
std::cout<<" -- DichoBound search : "<<t_dicho_bound<<std::endl;
std::cout<<"- Approximation : "<<t_approx<<std::endl;
std::cout<<"- Boolean operation :"<<t_booltool<<std::endl;
std::cout<<std::endl<<"Number of initial point computations is "<<init_point_count<<std::endl<<std::endl;
#endif
}

View File

@@ -91,7 +91,7 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
if (NbSub == 0)
{
#ifdef OCCT_DEBUG
cout << "No subhape in shape!" << endl;
std::cout << "No subhape in shape!" << std::endl;
#endif
SS = TopoDS_Shape();
}

View File

@@ -331,7 +331,7 @@ Standard_Boolean BRepBlend_AppFuncRoot::SearchPoint(Blend_AppFunction& Func,
if (!rsnld.IsDone()) {
# ifdef BREPBLEND_DEB
cout << "AppFunc : RNLD Not done en t = " << Param << endl;
std::cout << "AppFunc : RNLD Not done en t = " << Param << std::endl;
# endif
return Standard_False;
}
@@ -343,8 +343,8 @@ Standard_Boolean BRepBlend_AppFuncRoot::SearchPoint(Blend_AppFunction& Func,
// (4) Insertion of the point if the calculation seems long.
if ((!Trouve)&&(rsnld.NbIterations()>3)) {
#ifdef OCCT_DEBUG
cout << "Evaluation in t = " << Param << "given" << endl;
rsnld.Dump(cout);
std::cout << "Evaluation in t = " << Param << "given" << std::endl;
rsnld.Dump(std::cout);
#endif
myLine->InsertBefore(Index+1, Pnt);
}

View File

@@ -101,28 +101,28 @@ static void tracederiv(Blend_RstRstFunction& Func,
Standard_Real param2 = BP2.Parameter();
Standard_Real scal = 1./ (param1 - param2);
cout<<endl;
cout<<"control of derivatives at point : "<<param1<<endl;
std::cout<<std::endl;
std::cout<<"control of derivatives at point : "<<param1<<std::endl;
for(i = 1; i <= hp; i++){
cout<<endl;
cout<<"point : "<<i<<endl;
cout<<"dx calculated : "<<TDP1(i).X()<<endl;
cout<<"dx estimated : "<<scal*(TP1(i).X()-TP2(i).X())<<endl;
cout<<"dy calculated : "<<TDP1(i).Y()<<endl;
cout<<"dy estimated : "<<scal*(TP1(i).Y()-TP2(i).Y())<<endl;
cout<<"dz calculated : "<<TDP1(i).Z()<<endl;
cout<<"dz estimated : "<<scal*(TP1(i).Z()-TP2(i).Z())<<endl;
cout<<"dw calculated : "<<TDW1(i)<<endl;
cout<<"dw estimated : "<<scal*(TW1(i)-TW2(i))<<endl;
std::cout<<std::endl;
std::cout<<"point : "<<i<<std::endl;
std::cout<<"dx calculated : "<<TDP1(i).X()<<std::endl;
std::cout<<"dx estimated : "<<scal*(TP1(i).X()-TP2(i).X())<<std::endl;
std::cout<<"dy calculated : "<<TDP1(i).Y()<<std::endl;
std::cout<<"dy estimated : "<<scal*(TP1(i).Y()-TP2(i).Y())<<std::endl;
std::cout<<"dz calculated : "<<TDP1(i).Z()<<std::endl;
std::cout<<"dz estimated : "<<scal*(TP1(i).Z()-TP2(i).Z())<<std::endl;
std::cout<<"dw calculated : "<<TDW1(i)<<std::endl;
std::cout<<"dw estimated : "<<scal*(TW1(i)-TW2(i))<<std::endl;
}
for(i = 1; i <= hp2d; i++){
cout<<endl;
cout<<"point 2d : "<<i<<endl;
cout<<"dx calculated : "<<TDP2d1(i).X()<<endl;
cout<<"dx estimated : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<endl;
cout<<"dy calculated : "<<TDP2d1(i).Y()<<endl;
cout<<"dy estimated : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
std::cout<<std::endl;
std::cout<<"point 2d : "<<i<<std::endl;
std::cout<<"dx calculated : "<<TDP2d1(i).X()<<std::endl;
std::cout<<"dx estimated : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<std::endl;
std::cout<<"dy calculated : "<<TDP2d1(i).Y()<<std::endl;
std::cout<<"dy estimated : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<std::endl;
}
}
#endif
@@ -825,7 +825,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
else{
// reframing failed. Leave with PointsConfondus
#ifdef OCCT_DEBUG
cout<<"reframing failed"<<endl;
std::cout<<"reframing failed"<<std::endl;
#endif
State = Blend_SamePoints;
}
@@ -880,7 +880,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
#ifdef OCCT_DEBUG
if (line->NbPoints()>=2) {
// Show that there is a stop during processing
cout<<"No more advancement in the processing"<<endl;
std::cout<<"No more advancement in the processing"<<std::endl;
}
#endif
}
@@ -988,7 +988,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func,
{
// Stop
#ifdef OCCT_DEBUG
cout << " Mixed points in the processing" << endl;
std::cout << " Mixed points in the processing" << std::endl;
#endif
Extrst1.SetValue(previousP.PointOnC1(),
previousP.ParameterOnC1(),
@@ -1039,7 +1039,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction&
rsnld.Perform(Finv, Solinv, infb, supb);
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
std::cout << "RSNLD not done "<< std::endl << std::endl;
#endif
return Standard_False;
}
@@ -1121,7 +1121,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction&
rsnld.Perform(Finv, Solinv, infb, supb);
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
std::cout << "RSNLD not done "<< std::endl << std::endl;
#endif
return Standard_False;
}
@@ -1207,7 +1207,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv&
rsnld.Perform(FinvP, Solinv, infb, supb);
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
std::cout << "RSNLD not done "<< std::endl << std::endl;
#endif
return Standard_False;
}
@@ -1275,7 +1275,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv&
rsnld.Perform(FinvP, Solinv, infb, supb);
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "RSNLD not done "<< endl << endl;
std::cout << "RSNLD not done "<< std::endl << std::endl;
#endif
return Standard_False;
}

View File

@@ -921,7 +921,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::Section
if (norm < Eps) {
norm = 1; // Not enough, but it is not necessary to stop
#ifdef OCCT_DEBUG
cout << " SurfRstConstRad : Singular Surface " << endl;
std::cout << " SurfRstConstRad : Singular Surface " << std::endl;
#endif
}

View File

@@ -934,7 +934,7 @@ TColStd_Array1OfReal& DWeigths)
if (norm < Eps) {
norm = 1; // Not enough, but it is not necessary to stop
#ifdef OCCT_DEBUG
cout << " SurfRstEvolRad : Surface single " << endl;
std::cout << " SurfRstEvolRad : Surface single " << std::endl;
#endif
}

View File

@@ -96,28 +96,28 @@ static void tracederiv(Blend_SurfRstFunction& Func,
Standard_Real param2 = BP2.Parameter();
Standard_Real scal = 1./(param1-param2);
cout<<endl;
cout<<"control derivatives at point : "<<param1<<endl;
std::cout<<std::endl;
std::cout<<"control derivatives at point : "<<param1<<std::endl;
for(i = 1; i <= hp; i++){
cout<<endl;
cout<<"point : "<<i<<endl;
cout<<"dx calculated : "<<TDP1(i).X()<<endl;
cout<<"dx estimated : "<<scal*(TP1(i).X()-TP2(i).X())<<endl;
cout<<"dy calculated : "<<TDP1(i).Y()<<endl;
cout<<"dy estimated : "<<scal*(TP1(i).Y()-TP2(i).Y())<<endl;
cout<<"dz calculated : "<<TDP1(i).Z()<<endl;
cout<<"dz estimated : "<<scal*(TP1(i).Z()-TP2(i).Z())<<endl;
cout<<"dw calculated : "<<TDW1(i)<<endl;
cout<<"dw estimated : "<<scal*(TW1(i)-TW2(i))<<endl;
std::cout<<std::endl;
std::cout<<"point : "<<i<<std::endl;
std::cout<<"dx calculated : "<<TDP1(i).X()<<std::endl;
std::cout<<"dx estimated : "<<scal*(TP1(i).X()-TP2(i).X())<<std::endl;
std::cout<<"dy calculated : "<<TDP1(i).Y()<<std::endl;
std::cout<<"dy estimated : "<<scal*(TP1(i).Y()-TP2(i).Y())<<std::endl;
std::cout<<"dz calculated : "<<TDP1(i).Z()<<std::endl;
std::cout<<"dz estimated : "<<scal*(TP1(i).Z()-TP2(i).Z())<<std::endl;
std::cout<<"dw calculated : "<<TDW1(i)<<std::endl;
std::cout<<"dw estimated : "<<scal*(TW1(i)-TW2(i))<<std::endl;
}
for(i = 1; i <= hp2d; i++){
cout<<endl;
cout<<"point 2d : "<<i<<endl;
cout<<"dx calculated : "<<TDP2d1(i).X()<<endl;
cout<<"dx estimated : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<endl;
cout<<"dy calculated : "<<TDP2d1(i).Y()<<endl;
cout<<"dy estimated : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<endl;
std::cout<<std::endl;
std::cout<<"point 2d : "<<i<<std::endl;
std::cout<<"dx calculated : "<<TDP2d1(i).X()<<std::endl;
std::cout<<"dx estimated : "<<scal*(TP2d1(i).X()-TP2d2(i).X())<<std::endl;
std::cout<<"dy calculated : "<<TDP2d1(i).Y()<<std::endl;
std::cout<<"dy estimated : "<<scal*(TP2d1(i).Y()-TP2d2(i).Y())<<std::endl;
}
}
#endif
@@ -717,7 +717,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
else{
// Failed reframing. Leave with PointsConfondus
#ifdef OCCT_DEBUG
cout<<"SurfRstLineBuilder : failed reframing"<<endl;
std::cout<<"SurfRstLineBuilder : failed reframing"<<std::endl;
#endif
State = Blend_SamePoints;
}
@@ -772,7 +772,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
if (line->NbPoints()>=2) {
// Indicate that one stops during the processing
#ifdef OCCT_DEBUG
cout<<"SurfRstLineBuilder : No advancement in the processing"<<endl;
std::cout<<"SurfRstLineBuilder : No advancement in the processing"<<std::endl;
#endif
}
}
@@ -878,7 +878,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func,
{
// Stop
#ifdef OCCT_DEBUG
cout << "SurfRstLineBuilder Points mixed in the processing" << endl;
std::cout << "SurfRstLineBuilder Points mixed in the processing" << std::endl;
#endif
previousP.ParametersOnS(U,V);
Exts.SetValue(previousP.PointOnS(),U,V,
@@ -951,7 +951,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
std::cout << "SurfRstLineBuilder : RSNLD not done "<< std::endl << std::endl;
#endif
}
else {
@@ -990,7 +990,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv&
if (!aRsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "SurfRstLineBuilder : RSNLD not done "<< endl << endl;
std::cout << "SurfRstLineBuilder : RSNLD not done "<< std::endl << std::endl;
#endif
}
else {
@@ -1051,7 +1051,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction&
rsnld.Perform(Finv,Solinv,infb,supb);
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
std::cout << "SurfRstLineBuilder :RSNLD not done "<< std::endl;
#endif
return Standard_False;
}
@@ -1135,7 +1135,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv&
rsnld.Perform(FinvP,Solinv,infb,supb);
if (!rsnld.IsDone()) {
#ifdef OCCT_DEBUG
cout << "SurfRstLineBuilder :RSNLD not done "<< endl;
std::cout << "SurfRstLineBuilder :RSNLD not done "<< std::endl;
#endif
return Standard_False;
}

View File

@@ -330,7 +330,7 @@ void BRepBuilderAPI_FastSewing::Perform(void)
{
SetStatus(FS_Exception);
#ifdef OCCT_DEBUG
//Standard_Failure::Caught()->Print(cout);
//Standard_Failure::Caught()->Print(std::cout);
#endif
return;
}

View File

@@ -145,8 +145,8 @@ Handle(Geom2d_Curve) BRepBuilderAPI_Sewing::SameRange(const Handle(Geom2d_Curve)
}
catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::SameRange: ";
anException.Print(cout); cout << endl;
std::cout << "Exception in BRepBuilderAPI_Sewing::SameRange: ";
anException.Print(std::cout); std::cout << std::endl;
#endif
(void)anException;
}
@@ -318,8 +318,8 @@ void BRepBuilderAPI_Sewing::SameParameter(const TopoDS_Edge& edge) const
}
catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::SameParameter: ";
anException.Print(cout); cout << endl;
std::cout << "Exception in BRepBuilderAPI_Sewing::SameParameter: ";
anException.Print(std::cout); std::cout << std::endl;
#endif
(void)anException;
}
@@ -1827,7 +1827,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
if (myAnalysis)
{
#ifdef OCCT_DEBUG
cout << "Begin face analysis..." << endl;
std::cout << "Begin face analysis..." << std::endl;
chr_local.Reset();
chr_local.Start();
#endif
@@ -1838,7 +1838,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_analysis);
cout << "Face analysis finished after " << t_analysis << " s" << endl;
std::cout << "Face analysis finished after " << t_analysis << " s" << std::endl;
#endif
}
@@ -1851,7 +1851,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
{
#ifdef OCCT_DEBUG
cout << "Begin vertices assembling..." << endl;
std::cout << "Begin vertices assembling..." << std::endl;
chr_local.Reset();
chr_local.Start();
#endif
@@ -1862,12 +1862,12 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_assembling);
cout << "Vertices assembling finished after " << t_assembling << " s" << endl;
std::cout << "Vertices assembling finished after " << t_assembling << " s" << std::endl;
#endif
if (myCutting)
{
#ifdef OCCT_DEBUG
cout << "Begin cutting..." << endl;
std::cout << "Begin cutting..." << std::endl;
chr_local.Reset();
chr_local.Start();
#endif
@@ -1878,11 +1878,11 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_cutting);
cout << "Cutting finished after " << t_cutting << " s" << endl;
std::cout << "Cutting finished after " << t_cutting << " s" << std::endl;
#endif
}
#ifdef OCCT_DEBUG
cout << "Begin merging..." << endl;
std::cout << "Begin merging..." << std::endl;
chr_local.Reset();
chr_local.Start();
#endif
@@ -1893,7 +1893,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_merging);
cout << "Merging finished after " << t_merging << " s" << endl;
std::cout << "Merging finished after " << t_merging << " s" << std::endl;
#endif
}
else
@@ -1910,7 +1910,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
{
#ifdef OCCT_DEBUG
cout << "Creating sewed shape..." << endl;
std::cout << "Creating sewed shape..." << std::endl;
#endif
// examine the multiple edges if any and process sameparameter for edges if necessary
EdgeProcessing (thePI);
@@ -1933,7 +1933,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
return;
}
#ifdef OCCT_DEBUG
cout << "Sewed shape created" << endl;
std::cout << "Sewed shape created" << std::endl;
#endif
}
@@ -1948,12 +1948,12 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
#ifdef OCCT_DEBUG
chr_total.Stop();
chr_total.Show(t_total);
cout << "Sewing finished!" << endl;
cout << " analysis time : " << t_analysis << " s" << endl;
cout << " assembling time : " << t_assembling << " s" << endl;
cout << " cutting time : " << t_cutting << " s" << endl;
cout << " merging time : " << t_merging << " s" << endl;
cout << "Total time : " << t_total << " s" << endl;
std::cout << "Sewing finished!" << std::endl;
std::cout << " analysis time : " << t_analysis << " s" << std::endl;
std::cout << " assembling time : " << t_assembling << " s" << std::endl;
std::cout << " cutting time : " << t_cutting << " s" << std::endl;
std::cout << " merging time : " << t_merging << " s" << std::endl;
std::cout << "Total time : " << t_total << " s" << std::endl;
#endif
}
@@ -2205,23 +2205,23 @@ void BRepBuilderAPI_Sewing::Dump() const
mapVertices.Add(V2);
}
}
cout << " " << endl;
cout << " Informations " << endl;
cout << " ===========================================================" << endl;
cout << " " << endl;
cout << " Number of input shapes : " << myOldShapes.Extent() << endl;
cout << " Number of actual shapes : " << myNbShapes << endl;
cout << " Number of Bounds : " << NbBounds << endl;
cout << " Number of Sections : " << NbSections << endl;
cout << " Number of Edges : " << mapEdges.Extent() << endl;
cout << " Number of Vertices : " << myNbVertices << endl;
cout << " Number of Nodes : " << mapVertices.Extent() << endl;
cout << " Number of Free Edges : " << myFreeEdges.Extent() << endl;
cout << " Number of Contigous Edges : " << myContigousEdges.Extent() << endl;
cout << " Number of Multiple Edges : " << myMultipleEdges.Extent() << endl;
cout << " Number of Degenerated Edges : " << myDegenerated.Extent() << endl;
cout << " ===========================================================" << endl;
cout << " " << endl;
std::cout << " " << std::endl;
std::cout << " Informations " << std::endl;
std::cout << " ===========================================================" << std::endl;
std::cout << " " << std::endl;
std::cout << " Number of input shapes : " << myOldShapes.Extent() << std::endl;
std::cout << " Number of actual shapes : " << myNbShapes << std::endl;
std::cout << " Number of Bounds : " << NbBounds << std::endl;
std::cout << " Number of Sections : " << NbSections << std::endl;
std::cout << " Number of Edges : " << mapEdges.Extent() << std::endl;
std::cout << " Number of Vertices : " << myNbVertices << std::endl;
std::cout << " Number of Nodes : " << mapVertices.Extent() << std::endl;
std::cout << " Number of Free Edges : " << myFreeEdges.Extent() << std::endl;
std::cout << " Number of Contigous Edges : " << myContigousEdges.Extent() << std::endl;
std::cout << " Number of Multiple Edges : " << myMultipleEdges.Extent() << std::endl;
std::cout << " Number of Degenerated Edges : " << myDegenerated.Extent() << std::endl;
std::cout << " ===========================================================" << std::endl;
std::cout << " " << std::endl;
}
//=======================================================================
@@ -2297,7 +2297,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,first,last);
if (c3d.IsNull()) {
#ifdef OCCT_DEBUG
cout << "Warning: Possibly small edge can be sewed: No 3D curve" << endl;
std::cout << "Warning: Possibly small edge can be sewed: No 3D curve" << std::endl;
#endif
}
else {
@@ -2318,8 +2318,8 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
}
catch (Standard_Failure) {
#ifdef OCCT_DEBUG
cout << "Warning: Possibly small edge can be sewed: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
std::cout << "Warning: Possibly small edge can be sewed: ";
Standard_Failure::Caught()->Print(std::cout); std::cout << std::endl;
#endif
}*/
}
@@ -2377,7 +2377,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
// Replace small edge
if (isSmall) {
#ifdef OCCT_DEBUG
cout << "Warning: Small edge made degenerated by FaceAnalysis" << endl;
std::cout << "Warning: Small edge made degenerated by FaceAnalysis" << std::endl;
#endif
nbSmall++;
// Create new degenerated edge
@@ -2414,7 +2414,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
// Remove small face
if (nbSmall == nbEdges) {
#ifdef OCCT_DEBUG
cout << "Warning: Small face removed by FaceAnalysis" << endl;
std::cout << "Warning: Small face removed by FaceAnalysis" << std::endl;
#endif
myLittleFace.Add(face);
myReShape->Remove(face);
@@ -2801,7 +2801,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
}
Standard_Integer nbNodes = NodeVertices.Extent();
#ifdef OCCT_DEBUG
cout << "Glueing " << nbNodes << " nodes..." << endl;
std::cout << "Glueing " << nbNodes << " nodes..." << std::endl;
#endif
// Merge nearest nodes
TopTools_IndexedDataMapOfShapeShape NodeNearestNode;
@@ -2962,7 +2962,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
// Glue vertices
if (nbVert) {
#ifdef OCCT_DEBUG
cout << "Assemble " << nbVert << " vertices on faces..." << endl;
std::cout << "Assemble " << nbVert << " vertices on faces..." << std::endl;
#endif
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, thePI));
}
@@ -2971,7 +2971,7 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
aPS.Next();
if (nbVertFree) {
#ifdef OCCT_DEBUG
cout << "Assemble " << nbVertFree << " vertices on floating edges..." << endl;
std::cout << "Assemble " << nbVertFree << " vertices on floating edges..." << std::endl;
#endif
while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, thePI));
}
@@ -3737,8 +3737,8 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
}
}
#ifdef OCCT_DEBUG
cout << "From " << nbBounds << " bounds " << myBoundSections.Extent()
<< " were cut into " << mySectionBound.Extent() << " sections" << endl;
std::cout << "From " << nbBounds << " bounds " << myBoundSections.Extent()
<< " were cut into " << mySectionBound.Extent() << " sections" << std::endl;
#endif
}
@@ -4364,8 +4364,8 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn
}
catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::ProjectPointsOnCurve: ";
anException.Print(cout); cout << endl;
std::cout << "Exception in BRepBuilderAPI_Sewing::ProjectPointsOnCurve: ";
anException.Print(std::cout); std::cout << std::endl;
#endif
(void)anException;
worktol = MinTolerance();
@@ -4704,8 +4704,8 @@ void BRepBuilderAPI_Sewing::CreateSections(const TopoDS_Shape& section,
//}
/*catch (Standard_Failure) {
#ifdef OCCT_DEBUG
cout << "Exception in CreateSections: segment [" << par1 << "," << par2 << "]: ";
Standard_Failure::Caught()->Print(cout); cout << endl;
std::cout << "Exception in CreateSections: segment [" << par1 << "," << par2 << "]: ";
Standard_Failure::Caught()->Print(std::cout); std::cout << std::endl;
#endif
Handle(Geom2d_TrimmedCurve) c2dT = new Geom2d_TrimmedCurve(c2dNew,Max(first2d,par1),Min(par2,last2d));
c2dNew = c2dT;
@@ -4746,7 +4746,7 @@ void BRepBuilderAPI_Sewing::SameParameterShape()
}
catch (Standard_Failure const&) {
#ifdef OCCT_DEBUG
cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << endl;
std::cout << "Fail: BRepBuilderAPI_Sewing::SameParameterShape exception in BRepLib::SameParameter" << std::endl;
#endif
continue;
}

View File

@@ -135,9 +135,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )
@@ -164,9 +164,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )
@@ -202,9 +202,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )
@@ -262,9 +262,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )
@@ -315,9 +315,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )
@@ -362,9 +362,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )
@@ -403,9 +403,9 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
}
catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
anException.Print(cout);
cout<<endl;
std::cout<<"BRepCheck_Analyzer : ";
anException.Print(std::cout);
std::cout<<std::endl;
#endif
(void)anException;
if ( ! myMap(S).IsNull() )

View File

@@ -920,10 +920,10 @@ void PrintProblematicPoint(const gp_Pnt& problematic_point,
const Standard_Real Error,
const Standard_Real Tol)
{
cout << " **** probleme de SameParameter au point :" << endl;
cout << " " << problematic_point.Coord(1) << " "
<< problematic_point.Coord(2) << " " << problematic_point.Coord(3) << endl ;
cout << " Erreur detectee :" << Error << " Tolerance :" << Tol << endl;
std::cout << " **** probleme de SameParameter au point :" << std::endl;
std::cout << " " << problematic_point.Coord(1) << " "
<< problematic_point.Coord(2) << " " << problematic_point.Coord(3) << std::endl ;
std::cout << " Erreur detectee :" << Error << " Tolerance :" << Tol << std::endl;
}
#else
void PrintProblematicPoint(const gp_Pnt&,

View File

@@ -477,11 +477,11 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
if (BRepCheck_Trace(0) > 1) {
TopTools_DataMapIteratorOfDataMapOfShapeInteger itt(MapOfShapeOrientation);
Standard_Integer upper = MapOfShapeOrientation.NbBuckets();
cout << "La map shape Orientation :" << endl;
std::cout << "La map shape Orientation :" << std::endl;
for (; itt.More(); itt.Next()) {
PrintShape(itt.Key(), upper);
}
cout << endl;
std::cout << std::endl;
}
#endif
@@ -666,7 +666,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
#ifdef OCCT_DEBUG
if (BRepCheck_Trace(0) > 3) {
cout << "Fref : " ;
std::cout << "Fref : " ;
PrintShape(Fref, MapOfShapeOrientation.NbBuckets());
}
#endif
@@ -709,7 +709,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
#ifdef OCCT_DEBUG
if (BRepCheck_Trace(0) > 3) {
cout << " Fcur : " ;
std::cout << " Fcur : " ;
PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
}
#endif
@@ -731,8 +731,8 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
if (BRepCheck_Trace(0) > 3) {
orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
Fcur.Orientation(orf);
cout << " Error : this face has been already examined " << endl;
cout << " Imposible to return it ";
std::cout << " Error : this face has been already examined " << std::endl;
std::cout << " Imposible to return it ";
PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
}
#endif
@@ -746,7 +746,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
if (BRepCheck_Trace(0) > 3) {
orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
Fcur.Orientation(orf);
cout << " Resulting Fcur is returned : " ;
std::cout << " Resulting Fcur is returned : " ;
PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
}
#endif

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