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

Compare commits

..

46 Commits

Author SHA1 Message Date
dpasukhi
feff48e050 0033374: Coding - Static Analyzing checking
// Not processed changes.
Need to be cleared
2023-05-06 20:06:21 +00:00
msmediasofts
359edc7d8a 0033366: Documentation - Add description of BRepAlgoAPI_Algo::Shape()
Added description of BRepAlgoAPI_Algo::Shape()
2023-04-19 18:04:52 +01:00
mzernova
f9998f03ad 0031777: Visualization - improve SelectMgr_EntityOwner to process selection scheme
The selection scheme has been propagated to Owner object interface, and the
AIS_Selection::Select() method has been replaced to unify the logic.
2023-04-05 17:20:33 +01:00
dorlov
c479c4f6d8 0023638: Data Exchange - Reading IGES file produced invalid shape
Removed double healing of Iges group entities
Added ShapeBuild_ReShape member to the IGESData_IGESModel class, shapes which are registered in ShapeBuild_ReShape class does not process to healing
2023-03-28 01:00:42 +01:00
dpasukhi
c51df6bfd2 0033327: Data Exchange, IGES Import - SubfigureDef can't read string
Fixed problem with texted types
Added checking for null string for subfigure via XCAF transferring
2023-03-20 23:11:36 +00:00
dpasukhi
5e43274280 0033337: DRAW - Can't load plugins on Linux OS
WSL 2 have windows FileSystem and as a result we have \r symbols before \n
For this cases we can just remove \r\n (\n is a last symbol) for the node value.
2023-03-20 23:11:35 +00:00
dpasukhi
efe960751c 0033331: Data Exchange, Step Import - Unsupported Representation Items
Fixed problem with iteration on Null RI
2023-03-20 23:11:27 +00:00
anv
6b9e0dc3f8 0033345: Coding - Memory allocation operators got inaccessible
Macros was moved back to public.
2023-03-19 20:53:54 +00:00
akaftasev
2ef94c994e 0033340: Modeling Algorithm - Improve memory management performance in the PaveFiller
Changed NCollection_BaseAllocator to NCollection_IncAllocator in BOPAlgo_PaveFiller::MakeBlocks()
2023-03-19 20:53:53 +00:00
dpasukhi
1dd4b902c0 0033092: Data Exchange, Documentation - Implementation of DE_Wrapper documentation
Implement new user-guide documentation for DE Wrapper
2023-03-19 20:53:53 +00:00
akaftasev
a846d36326 0033264: Modeling Algorithms - Result of section operation is incomplete
Test case added.
2023-03-19 20:53:53 +00:00
akaftasev
86e352849d 0033263: Modeling Algorithms - BRepFilletAPI_MakeFillet doesn't work for current parameters
Do not calculate edge state if there are more than 4 G1 connections for currect vertex.
2023-02-10 15:35:41 +00:00
akaftasev
6d140acb14 0030292: Modeling Algorithms - BRepBndLib should avoid using Poly_Polygon3D when called with useTriangulation set to false
BRepBndLib.cxx : treatment of useTriangulation is modified according to specified behavior of algorithm
BRepTest_CurveCommands.cxx : creation edge from polygon3d is added in Draw command mkedge.
2023-02-06 17:51:52 +00:00
akaftasev
44be123039 0030055: BRepOffset_MakeOffset throws "TopoDS_Vertex hasn't gp_Pnt" in intersection mode
Diagnostic of mixed connectivity of faces along common edge is added.
If algorithm finds such pair of faces, it stops working with special error code.
2023-02-06 14:15:35 +03:00
dpasukhi
47263fa6a3 0033317: Data Exchange, Step Export - Ignoring color attached to the reference shape label
Fixed problem with pure referencing.
  To export reference label to step we convert it to the assembly with one part.
  All attributes attached to the label should be moved to the new part.
  For working with it new map contains only pure reference labels, that converted to the part
  was implemented to the STEPCAFControl_Writer.
Updated code style of the STEPCAFControl_Writer
Improved ability to export labels from different documents
Removed OCCT_Debug macros to print in Trace gravity
2023-02-04 09:18:29 +00:00
mzernova
b0afa94d10 0027848: Visualization - sensitivity of lines is too high
Improved objects sorting by depth.

The sensitivity calculation for the manipulator has been changed.
Now the sensitivity of the elements of the manipulator depends on its size.

Also fixed the problem of erroneous selection of unfilled circles (SelectMgr_Frustum<N>::hasCircleOverlap() function).

Test case vselect/bugs/bug27848 added.
2023-02-04 09:17:58 +00:00
dorlov
c772c6caa4 0030828: Data Exchange - The commands getting shapes from XCAF document should be available in C++
Added two new overloaded methods XCAFDoc_ShapeTool::GetOneShape: one returns TopoDS_Shape from TDF_LabelSequence and the other from a sequence of all top-level shapes which are free
2023-02-02 15:04:50 +00:00
mzernova
53eae1a935 0032570: Visualization, AIS_AnimationObject - define rotation around axis
When using AIS_AnimationObject, linear interpolation is performed from one gp_Trsf transformation to another.
But when an object rotates around a specific axis, the object moves not along a linear trajectory,
but along a circle. Therefore, a separate class AIS_AnimationAxisRotation was created that
allows to animate rotation around a specific axis.

Test case tests/v3d/bugs/bug32570 was added.
2023-02-01 23:26:46 +00:00
dpasukhi
d22b135217 0033307: Data Exchange, Step Import - Crash after reading empty edge loop
Fixed problem with empty edge list in the edge loop, mark as a fail entity in this case
2023-02-01 00:09:26 +00:00
vro
3c7c705d77 0033320: Data Exchange - Reading of a VRML file with a long line fails
Implement rolling back input stream to split on possible logical parts by comma or space.
2023-01-24 22:38:57 +00:00
dorlov
fc72568ba9 0033312: Data Exchange - NULL-dereference in StepToTopoDS_TranslateShell::Init()
The condition "if" was changed to opposite
2023-01-20 03:10:45 +00:00
akaftasev
107b57a955 0033311: Modeling Algorithm - No results of thrusection algorithm
Changed default value of myPercent
2023-01-17 20:47:54 +00:00
oan
8b301eb865 0033315: Mesh - BRepMesh_IncrementalMesh takes forever to finish (ends up with system memory, etc)
Added test case
2023-01-16 22:00:35 +00:00
rodrlyra
1f469e3781 0033305: Coding - BOPTools_PairSelector::Clear method uses "Clear" instead of "clear" on std::vector 2023-01-16 15:22:08 +00:00
akaftasev
ce4d294074 0033306: Modeling Algorithm - Crash in TrimEdge() method
Added condition to not cut the edges by closely located parameters
2023-01-09 21:44:11 +00:00
akaftasev
9f338a00a1 0033298: Modeling Algorithm - Offset operation gives wrong result
Process only those images of the faces, if one if them has anInsideEdges/anInsideVertices and the other is not.
2023-01-03 18:01:14 +00:00
akaftasev
a011359b8a 0033227: Modeling Algorithm - BOPAlgo_BuilderSolid generates incomplete result
Deleted outer loop for shells.
Added additional check of edges orientation for RefineShell().
2023-01-03 18:01:05 +00:00
msv
42e4ae96ae 0033304: Modeling Data - Floating point signal when converting a B-spline curve to analytical form
Protect the static function ConicDefinition from calling sqrt with negative argument.
2023-01-03 18:00:55 +00:00
akaftasev
686926c0a9 0033247: Modeling Algorithm - BOP report small edges problem and produce empty result
Build shifted pcurve for ellipse and circle cases.
2022-12-22 16:20:54 +00:00
akaftasev
a638dd6224 0033265: Modeling Algorithms - Boolean operation hangs on the attached shapes
Added test case.
2022-12-16 14:28:08 +00:00
ifv
961a306dc4 0033244: Modeling Algorithms - Surface-surface intersection produces the double curves
IntAna_QuadQuadGeo.cxx - estimation of angular tolerance is added for case cone-cone

tests/lowalgos/intss/bug33244 - new test case added
2022-12-12 10:27:10 +03:00
ifv
195a068c4f 0030781: Sweep algorithm creates non-planar edges (orig. BOPAlgo_MakerVolume fails to build a solid)
BRepFill/BRepFill_AdvancedEvolved.cxx - estimation of angular tolerance is added in method GetLids()

tests/evolved/voluved/bug30781 - new test added
2022-12-10 14:04:53 +00:00
dpasukhi
669e0dfc17 0033246: Data Exchange, DE Wrapper - Checking license leads to performance problem
ReWork UpdateLoad functionality:
UpdateLoad calls only if provider is found.
UpdateLoad calls only for chosen type of translation (read/write)
Add new method to UpdateLoad all registered nodes.
2022-12-10 14:02:56 +00:00
nunomsil
74cb5673a5 0031919: Modeling Algorithms - General Fuse raises exception on attempt to imprint a contour to a shell
Exception no longer occurs in current version. However, fuzzyvalue should be set to 1 for the result of the operation to make sense (result of common is 1 wire). Test case added
2022-12-07 14:45:36 +00:00
dpasukhi
768f3a4a19 0033235: Configuration - Solving the problem with static building of ExpToCasExe
Added new dependency to ExpToCasExe - CSF_wsock32 (on Win only)
2022-12-04 13:49:06 +03:00
dpasukhi
2a8c5ad46c 0033250: Configuration - Missing Limits header file
Added new include limits to fix build problem
2022-12-04 13:48:24 +03:00
stv
7ea3eff4f8 0033218: Data Exchange - XCAFPrs_Texture not allow to use classes inherited from Image_Texture
Type of field XCAFPrs_Texture::myImageSource was changed from Image_Texture to Handle(Image_Texture)
2022-12-04 13:47:36 +03:00
dpasukhi
c07f4ee70d 0033232: Data Exchange, DE_Wrapper - Implement ability to change global session
Add ability to set/get global session
2022-12-04 13:46:38 +03:00
dpasukhi
6cc679d81c 0033230: Data Exchange, DE Wrapper - Update API to find CAD provider
Moved FindProvider method to public section
Made FindProvider as virtual to make it possible to overwrite.
2022-12-04 13:46:38 +03:00
dpasukhi
62f554bc3f 0033228: Data Exchange, DE Wrapper - Make the document argument of the method Read const handle
Rewrite document argument for DE_Wrapper Read method
2022-12-04 13:46:37 +03:00
sshutina
7eeb5d5fbf 0032965: PMIVis - PMIVis_TOT_Vectorized text regressions
Added the ability to draw a shaded shape in the required group.
2022-12-04 13:44:52 +03:00
oan
9b7f1aea28 0031865: Mesh - triangulation fails with large deflection values due to unhandled Standard_OutOfRange, BRepMesh_PairOfIndex::Append()
Define minimum number of points for specific types of curves like it was done for circular edges.
2022-12-04 13:43:52 +03:00
knosulko
1e96cf65fa 0033156: Modeling Algorithms - Planar face creation problem
BRepLib_MakeFace::BRepLib_MakeFace: deleted degenerative edges from the input wire;
add test tests\mkface\mkplane\bug33156.
2022-12-04 13:42:28 +03:00
ddzama
03275c0be1 0022821: Crash with BRepFilletAPI_MakeFillet
test bugs modalg_7 bug22821 failed on fillet shape with 5-th edge.
Experimentally has been found that reducing of parameter
ChFi3d_Builder::tolesp for this task solves the issue.

So, as soluton it is proposed to link parameter toleps with parameter range of
spine curve. So, production coefficient has been set to pass all tests and
2 teset was extended: tests/blend/complex/A6, tests/bugs/modalg_7/bug22821

first has been extended to test different scaling factors,
second has been extended to make fillet on all edges from 12.

Additionally:
 - fixed misusage of tolesp in contexts where tolerance of point in 3d is excepted;
     In some context usage of tol_esp is irrelevant, because its essentiality - tolerance of the parameter on the 3d curve.
     So, in such context it has been replaced with new parameter tol3d (with fix value 1.0e-4).
     Get rid of tolapp3d duplication constant - tol_3d
 - tolesp = 5.0e-5 * (umax - umin)
 - tolesp replaced by tolpoint2d/tolpoint3d in several classes.
     Blend_Walking
     BRepBlend_SurfRstLineBuilder
     BRepBlend_RstRstLineBuilder
     Blend_CSWalking
     Instead `tolesp` - `tolgui` is employed in contexts where tolerance of guide curve parameter is excepted.
     Instead `tolesp` - `tolpoint2d` or `tolpoint3d` is employed in contexts where tolerance of point in 2d or 3d space is excepted.
 - Replace tolesp with tolpoint2d/tolpoint3d in BBPP function argument.
 - Use tolapp3d instead tolesp in BonVoisin function,
2022-12-04 13:41:29 +03:00
ddzama
2f33e34038 0032934: Modelling Algorithms - BRepExtrema_DistShapeShape returns two solutions instead of one
distmini of two edges returns two solution points instead one.
Second unneeded solution point is the same as first.

The problem was in fact that second edge has continuity C0.
In this case additional extremas analysis performed in special procedure

PERFORM_C0

And second point found in this procedure.
Folowing code of

BRepExtrema_DistanceSS::Perform (variant for Edge/Edge)

we should this additional solution extremas set
to be object of test TRI_SOLUTION before pushing
into main list of solution.
This solves the problem.
Corresponding test and compound with edges has been created.

Additionally, in the function

PERFORM_C0

an obvious error has fixed.
2022-12-04 13:39:35 +03:00
akaftasev
3eb891ec49 0033180: We had a problem calling the OCC library at the customer site, and the program crashed
Added status for thrusection operations and changed throw constructions to set of the status and break the function.
2022-12-04 13:35:24 +03:00
2367 changed files with 22256 additions and 18307 deletions

View File

@@ -45,6 +45,7 @@ user_guides/visualization/visualization.md
user_guides/iges/iges.md
user_guides/step/step.md
user_guides/xde/xde.md
user_guides/de_wrapper/de_wrapper.md
user_guides/ocaf/ocaf.md
user_guides/draw_test_harness/draw_test_harness.md
user_guides/inspector/inspector.md

View File

@@ -20,6 +20,7 @@ user_guides/vis/vis.md
user_guides/iges/iges.md
user_guides/step/step.md
user_guides/xde/xde.md
user_guides/de_wrapper/de_wrapper.md
user_guides/inspector/inspector.md
user_guides/draw_test_harness/draw_test_harness.md

View File

@@ -0,0 +1,413 @@
Data Exchange Wrapper (DE_Wrapper) {#occt_user_guides__de_wrapper}
============================
@tableofcontents
@section occt_de_wrapper_1 Introduction
This guide explains how to use the **Data Exchange Wrapper** (DE Wrapper).
It provides basic directions on setup, usage and file creation via DE_Wrapper.
The Data Exchange Wrapper (DE Wrapper) module allows reading and writing supported CAD formats to shape objects or special XDE documents, setting up the transfer process for all CAD files.
It is also possible to add support for new CAD formats by prototyping existing tools.
The DE Wrapper component requires @ref occt_user_guides__xde "XDE" toolkit for operation.
This guide mainly explains how to convert CAD files to Open CASCADE Technology (OCCT) shapes and vice versa.
This guide principally deals with the following OCCT classes:
* The Provider class, which loads CAD files and translates their contents to OCCT shapes or XDE documents, or translates OCCT shapes or XDE documents to CAD entities and then writes those entities to a CAD file.
* The Configuration class, which contains all information for the transfer process, such as the units, tolerance, and all internal information for the OCC readers or writers.
* The wrapper class, which contains all loaded configuration objects with own CAD format, reads or writes CAD files in the format derived from file extension or contents and saves or loads configuration settings for loaded configuration objects.
@section occt_de_wrapper_2 Supported CAD formats
| CAD format | Extensions | RW support | Thread Safety | Presentation | Package |
| :--------- | :--------- | :--------- | :----------- | :----------- | :------ |
| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | STEPCAFControl |
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAFCascade |
| BREP | .brep | RW | Yes | BRep, Mesh | DEBRepCascade |
| IGES | .igs, .iges | RW | No | BRep | IGESCAFControl |
| OBJ | .obj | RW | Yes | Mesh | RWObj |
| STL | .stl | RW | Yes | Mesh | RWStl |
| PLY | .ply | W | Yes | Mesh | RWPly |
| GLTF | .glTF .glb | RW | Yes | Mesh | RWGltf |
| VRML | .wrl .vrml | RW | Yes | Mesh | Vrml |
**Note** :
* The format names in the first column match the FormatName values used for configuration nodes.
* The VendorName for all listed CAD formats is "OCC".
@section occt_de_wrapper_3 DE Session Configuration
Any providers can have their own read/write parameters. The transfer process is set up using DE configuration nodes, which hold all relevant parameters. There are two ways to change the parameter values: directly from code or by an external resource file/string.
The session is a global or static DE_Wrapper object that stores registered DE configuration nodes and wraps DE commands to work with them. It has some configuration parameters of its own and also keeps track of loaded nodes and specilal global parameters.
@subsection occt_de_wrapper_3_1 Getting a DE session. Code sample
Working with a DE session requires a DE_Wrapper object to be loaded or created first.
Getting the global DE_Wrapping object:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
~~~~
Creating a local DE_Wrapper:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = new DE_Wrapper();
~~~~
It is recommended to create a local one-time copy to work with the session, if no global changes are intended.
~~~~{.cpp}
Handle(DE_Wrapper) aOneTimeSession = aSession->Copy();
~~~~
@subsection occt_de_wrapper_3_2 Configuration resource
Configuration resource is an external file or string of the following format:
~~~~{.cpp}
global.priority.STEP : OCC DTK
global.general.length.unit : 1
provider.STEP.OCC.read.precision.val : 0.0001
~~~~
@subsubsection occt_de_wrapper_3_2_1 Configuration resource: graph of scopes
* **global.** is a scope of global parameters
* **priority.** is a scope of priority to use vendors with their providers.
* **general.** is a scope of global configuration parameter values
* <strong>"..."</strong> is an internal configuration with any internal scopes
* <strong>". : "</strong> is a separator of key-value
* __...__ parameter value, can't contain new line symbols.
* **provider.** is a scope of configuration providers
* **STEP.** is a scope of CAD format to configure
* **OCC.** is a scope of a vendor or provider
* <strong>"..."</strong> is an internal configuration with any internal scopes
* <strong>". : "</strong> is a separator of key-value
* <strong>"..."</strong> parameter value, can't contain new line symbols.
@subsubsection occt_de_wrapper_3_2_2 Loading configuration resources. Configuring DE Session
The resource should be loaded after the registration of all providers that should be configured. The resource only impacts registered parameters. To configure a new registered provider it is necessary to load the resource again. Parameters not present in the resource will remain unchanged.
There are two ways to check what parameters are available:
* C++: Open ConfigureNode file and check the InternalParameter field. Each parameter will be described with a comment. To check the global parameters, use the DE_Wrapper class public methods.
* Resource: Register all available Nodes to the session, then save the configuration and view all existing parameters.
There are two options for loading a resource: recursive and global parameters only. Recursive is the default option to configure all global parameters (units, priority, enable status) and all registered providers. Non-recursive configures only global parameters and ignores all provider settings. This option is the best for updating provider priority.
@subsubsection occt_de_wrapper_3_2_3 Loading configuration resources. Code sample
Configuring using a resource string:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aString =
"global.priority.STEP : OCC DTK\n"
"global.general.length.unit : 1\n"
"provider.STEP.OCC.read.precision.val : 0.\n";
Standard_Boolean aIsRecursive = Standard_True;
if (!aSession->Load(aString, aIsRecursive))
{
Message::SendFail() << "Error: configuration is incorrect";
}
~~~~
Configuring using a resource file:
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "";
Standard_Boolean aIsRecursive = Standard_True;
if (!aSession->Load(aPathToFile, aIsRecursive))
{
Message::SendFail() << "Error: configuration is incorrect";
}
~~~~
@subsubsection occt_de_wrapper_3_2_4 Loading configuration resources. DRAW sample
Configuring using a resource string:
~~~~{.cpp}
set conf "
global.priority.STEP : OCC
global.general.length.unit : 1
provider.STEP.OCC.read.iges.bspline.continuity : 1
provider.STEP.OCC.read.precision.mode : 0
provider.STEP.OCC.read.precision.val : 0.0001
"
LoadConfiguration ${conf} -recursive on
~~~~
Configuring using a resource file:
~~~~{.cpp}
set pathToFile ""
LoadConfiguration ${pathToFile} -recursive on
~~~~
@subsubsection occt_de_wrapper_3_2_5 Saving configuration resources. Dump of configuration DE Session
Saving the configuration of a DE Session involves dumping all parameters of registered providers.
If a parameter did not change during the session, its value remains as default.
There are two ways to save a resource: recursive and global parameters only. Recursive is the way to dump all registered provider information. Non-recursive dumps only global parameters, for example, save priority of vendors or the length unit.
It is possible to filter what vendors or providers to save by providing the correct name of the vendor or provider.
@subsubsection occt_de_wrapper_3_2_6 Saving configuration resources. Code sample
Dump to resource string. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TColStd_ListOfAsciiString aFormats;
TColStd_ListOfAsciiString aVendors;
aFormats.Appends("STEP");
aVendors.Appends("OCC");
Standard_Boolean aIsRecursive = Standard_True;
TCollection_AsciiString aConf = aSession->aConf->Save(aIsRecursive, aFormats, aVendors);
~~~~
Configure using a resource file. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "";
TColStd_ListOfAsciiString aFormats;
TColStd_ListOfAsciiString aVendors;
aFormats.Appends("STEP");
aVendors.Appends("OCC");
Standard_Boolean aIsRecursive = Standard_True;
if (!aSession->Save(aPathToFile, aIsRecursive, aFormats,aVendors))
{
Message::SendFail() << "Error: configuration is not saved";
}
~~~~
@subsubsection occt_de_wrapper_3_2_7 Saving configuration resources. DRAW sample
Dump configuration to string. If no list of vendors is passed or it is empty, all vendors are saved. If no providers list is passed or it is empty, all providers of valid vendors are saved.
~~~~{.cpp}
set vendors "OCC"
set format "STEP"
set dump_conf [DumpConfiguration -recursive on -format ${format} -vendor ${vendors}]
~~~~
Dump configuration to file. If no vendors list are set as an argument or it is empty, saves all vendors. If no providers list as argument or it is empty, saves all providers of valid vendors:
~~~~{.cpp}
set vendors "OCC"
set format "STEP"
set pathToFile ""
DumpConfiguration -path ${pathToFile} -recursive on -format ${format} -vendor ${vendors}
~~~~
@subsection occt_de_wrapper_3_3 Registering providers
To transfer a CAD file using DE Wrapper, it is necessary to register a CAD provider.
The provider contains internal and global parameters that have default values in the creation stage.
All registered providers are set to the map with information about its vendor and kept as smart handles. Therefore, it is possible to change the values via handle from external code.
@subsubsection occt_de_wrapper_3_3_1 Registering providers. Code sample
It is nesessary to register only one ConfigurationNode for all needed formats.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
Handle(DE_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
aSession->Bind(aNode);
~~~~
@subsubsection occt_de_wrapper_3_3_2 Registering providers. DRAW Sample
Use DRAW with all providers registered by the following command:
~~~~{.cpp}
pload XDE
~~~~
@subsubsection occt_de_wrapper_3_3_3 Realtime initialization. Code sample
It is possible to change a paramater from code using a smart pointer.
~~~~{.cpp}
// global variable
static Handle(STEPCAFControl_ConfigurationNode) THE_STEP_NODE;
static Handle(DE_ConfigurationNode) RegisterStepNode()
{
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
if (!THE_STEP_NODE.IsNull())
{
return THE_STEP_NODE;
}
THE_STEP_NODE = new STEPCAFControl_ConfigurationNode();
aSession->Bind(THE_STEP_NODE);
return THE_STEP_NODE;
}
// Change parameter value
THE_STEP_NODE->InternalParameters.ReadRelationship = false;
THE_STEP_NODE->InternalParameters.ReadName = false;
THE_STEP_NODE->InternalParameters.ReadProps = false;
~~~~
@subsection occt_de_wrapper_3_4 Priority of Vendors
DE session is able to work with several vendors with the same supported CAD format. To choose the preffered vendor for each format, use a special priority list.
If the high priority vendor's provider is not supported, a transfer operation is needed (write/read), then the next vendor will be chosen.
@subsubsection occt_de_wrapper_3_4_1 Priority of Vendors. Code sample
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aFormat = "STEP";
TColStd_ListOfAsciiString aVendors;
aVendors.Appends("OCC"); // high priority
aVendors.Appends("DTK");
// Flag to disable not choosen vendors, in this case configuration is possible
// otherwise, lower their priority and continue to check ability to transfer
Standard_Boolean aToDisable = Standard_True;
aSession->ChangePriority(aFormat, aVendors, aToDisable);
~~~~
@subsubsection occt_de_wrapper_3_4_2 Priority of Vendors. DRAW Sample
It is recommended to disable recursion and update only global parameters.
~~~~{.cpp}
set conf "
global.priority.STEP : OCC DTK
"
LoadConfiguration ${conf} -recursive off
~~~~
@section occt_de_wrapper_4 Transfer of CAD files
To transfer from a CAD file to OCC or from OCC to a CAD file, it is necessary to use a configured DE_Wrapper object. It can be local, one-time or global. Global configuration of DE_Wrapper propagates to all nodes via transfer. There are two options for transferring: using OCC shape or XCAF document. It is possible to work only with real path to/from the file. Streaming is not supported (yet).
The format of input/output file is automatically determined by its extension or contents.
@subsection occt_de_wrapper_4_1 Transfer of CAD files. Code samples
Reading STEP file to Shape.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShRes;
if (!aSession->Read(aPathToFile, aShRes))
{
Message::SendFail() << "Error: Can't read file";
}
~~~~
Writing Shape to STEP file.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShFrom = ...;
if (!aSession->Write(aPathToFile, aShRes))
{
Message::SendFail() << "Error: Can't write file";
}
~~~~
Reading STEP file into XCAF document.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
Handle(TDocStd_Document) aDoc = ...;
if (!aSession->Read(aPathToFile, aDoc))
{
Message::SendFail() << "Error: Can't read file";
}
~~~~
Writing XCAF document into STEP.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
Handle(TDocStd_Document) aDoc = ...;
if (!aSession->Write(aPathToFile, aDoc))
{
Message::SendFail() << "Error: Can't write file";
}
~~~~
@subsection occt_de_wrapper_4_2 Transfer of CAD files. DRAW samples
Reading a STEP file into a Shape.
~~~~{.cpp}
set fileName "sample.stp"
readfile shape ${fileName}
~~~~
Writing a Shape into STEP.
~~~~{.cpp}
set fileName "sample.stp"
writefile shape ${fileName}
~~~~
Reading STEP into XCAF document.
~~~~{.cpp}
set fileName "sample.stp"
ReadFile D ${fileName}
~~~~
Writing XCAF document into STEP.
~~~~{.cpp}
set fileName "sample.stp"
WriteFile D ${fileName}
~~~~
@subsection occt_de_wrapper_4_3 Transfer using DE Provider. Code sample
It is possible to read and write CAD files directly from a special provider.
~~~~{.cpp}
// Creating or getting node
Handle(STEPCAFControl_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
// Creationg an one-time provider
Handle(DE_Provider) aProvider = aNode->BuildProvider();
// Setting configuration with all parameters
aProvider->SetNode(aNode);
if (!aProvider->Read(...))
{
Message::SendFail() << "Error: Can't read STEP file";
}
if (!aProvider->Write(...))
{
Message::SendFail() << "Error: Can't write STEP file";
}
~~~~
@subsection occt_de_wrapper_4_4 Temporary configuration via transfer
It is possible to change the configuration of only one transfer operation. To avoid changing parameters in a session, one-time clone of the session can be created and used for transfer. This way is recommended for use in multithreaded mode.
@subsubsection occt_de_wrapper_4_4_1 Temporary configuration via transfer. Code sample
Code sample to configure via transfer.
~~~~{.cpp}
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper()->Copy();
TCollection_AsciiString aString =
"global.priority.STEP : OCC DTK\n"
"global.general.length.unit : 1\n"
"provider.STEP.OCC.read.precision.val : 0.\n";
if (!aSession->Load(aString, aIsRecursive))
{
Message::SendFail() << "Error: configuration is incorrect";
}
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShRes;
if (!aSession->Read(aPathToFile, aShRes))
{
Message::SendFail() << "Error: Can't read file";
}
~~~~
@subsubsection occt_de_wrapper_4_4_2 Temporary configuration via transfer. DRAW sample
Code sample to configure via transfer within DRAW command.
~~~~{.cpp}
set fileName "sample.stp"
readfile S5 $filename -conf "global.general.length.unit : 1000 "
~~~~
Code sample to configure via transfer as variable.
~~~~{.cpp}
set fileName "sample.stp"
set conf "
global.priority.STEP : OCC
global.general.length.unit : 1
provider.STEP.OCC.read.iges.bspline.continuity : 1
provider.STEP.OCC.read.precision.mode : 0
provider.STEP.OCC.read.precision.val : 0.0001
"
readfile S5 $filename -conf ${conf}
~~~~

View File

@@ -13,6 +13,7 @@ OCCT User Guides are organized by OCCT modules:
* @subpage occt_user_guides__iges "IGES Translator"
* @subpage occt_user_guides__step "STEP Translator"
* @subpage occt_user_guides__xde "Extended Data Exchange (XDE)"
* @subpage occt_user_guides__de_wrapper "Data Exchange Wrapper (DE Wrapper)"
* @subpage occt_user_guides__ocaf "Open CASCADE Application Framework (OCAF)"
* @subpage occt_user_guides__test_harness "DRAW Test Harness"
* @subpage occt_user_guides__inspector "Inspector"

View File

@@ -0,0 +1,51 @@
// Copyright (c) 2023 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.
#include <AIS_AnimationAxisRotation.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
//=============================================================================
//function : Constructor
//purpose :
//=============================================================================
AIS_AnimationAxisRotation::AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd)
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
myRotAxis (theAxis),
myAngleStart (theAngleStart),
myAngleEnd (theAngleEnd)
{
//
}
//=============================================================================
//function : update
//purpose :
//=============================================================================
void AIS_AnimationAxisRotation::update (const AIS_AnimationProgress& theProgress)
{
if (myObject.IsNull())
{
return;
}
gp_Trsf aTrsf;
Standard_Real aCurrentAngle = (1.0 - theProgress.LocalNormalized) * myAngleStart + theProgress.LocalNormalized * myAngleEnd;
aTrsf.SetRotation (myRotAxis, aCurrentAngle);
updateTrsf (aTrsf);
}

View File

@@ -0,0 +1,53 @@
// Copyright (c) 2023 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_AnimationAxisRotation_HeaderFile
#define _AIS_AnimationAxisRotation_HeaderFile
#include <AIS_BaseAnimationObject.hxx>
#include <gp_TrsfNLerp.hxx>
//! Animation defining object transformation.
class AIS_AnimationAxisRotation : public AIS_BaseAnimationObject
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
public:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply rotation
//! @param[in] theAxis rotation axis
//! @param[in] theAngleStart rotation angle at the start of animation
//! @param[in] theAngleEnd rotation angle at the end of animation
Standard_EXPORT AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
const gp_Ax1& theAxis,
const Standard_Real theAngleStart,
const Standard_Real theAngleEnd);
protected:
//! Update the progress.
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
private:
gp_Ax1 myRotAxis; //!< rotation axis
Standard_Real myAngleStart; //!< start angle for rotation
Standard_Real myAngleEnd; //!< end angle for rotation
};
#endif // _AIS_AnimationAxisRotation_HeaderFile

View File

@@ -14,10 +14,7 @@
#include <AIS_AnimationObject.hxx>
#include <AIS_InteractiveContext.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
//=============================================================================
//function : Constructor
@@ -28,9 +25,7 @@ AIS_AnimationObject::AIS_AnimationObject (const TCollection_AsciiString& theAnim
const Handle(AIS_InteractiveObject)& theObject,
const gp_Trsf& theTrsfStart,
const gp_Trsf& theTrsfEnd)
: AIS_Animation (theAnimationName),
myContext (theContext),
myObject (theObject),
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
myTrsfLerp (theTrsfStart, theTrsfEnd)
{
//
@@ -49,52 +44,5 @@ void AIS_AnimationObject::update (const AIS_AnimationProgress& theProgress)
gp_Trsf aTrsf;
myTrsfLerp.Interpolate (theProgress.LocalNormalized, aTrsf);
if (!myContext.IsNull())
{
myContext->SetLocation (myObject, aTrsf);
invalidateViewer();
}
else
{
myObject->SetLocalTransformation (aTrsf);
}
}
//=============================================================================
//function : invalidateViewer
//purpose :
//=============================================================================
void AIS_AnimationObject::invalidateViewer()
{
if (myContext.IsNull())
{
return;
}
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
if (!isImmediate)
{
myContext->CurrentViewer()->Invalidate();
return;
}
// Invalidate immediate view only if it is going out of z-fit range.
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
aDefViewIter.More(); aDefViewIter.Next())
{
const Handle(V3d_View)& aView = aDefViewIter.Value();
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
Standard_Real aZNear = 0.0;
Standard_Real aZFar = 0.0;
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
{
if (aZNear < aView->Camera()->ZNear()
|| aZFar > aView->Camera()->ZFar())
{
aDefViewIter.Value()->Invalidate();
}
}
}
updateTrsf (aTrsf);
}

View File

@@ -15,24 +15,23 @@
#ifndef _AIS_AnimationObject_HeaderFile
#define _AIS_AnimationObject_HeaderFile
#include <AIS_Animation.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_BaseAnimationObject.hxx>
#include <gp_TrsfNLerp.hxx>
//! Animation defining object transformation.
class AIS_AnimationObject : public AIS_Animation
class AIS_AnimationObject : public AIS_BaseAnimationObject
{
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_Animation)
DEFINE_STANDARD_RTTIEXT(AIS_AnimationObject, AIS_BaseAnimationObject)
public:
//! Constructor with initialization.
//! Note that start/end transformations specify exactly local transformation of the object,
//! not the transformation to be applied to existing local transformation.
//! @param theAnimationName animation identifier
//! @param theContext interactive context where object have been displayed
//! @param theObject object to apply local transformation
//! @param theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
//! @param theTrsfEnd local transformation at the end of animation
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
//! @param[in] theTrsfStart local transformation at the start of animation (e.g. theObject->LocalTransformation())
//! @param[in] theTrsfEnd local transformation at the end of animation
Standard_EXPORT AIS_AnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject,
@@ -44,17 +43,10 @@ protected:
//! Update the progress.
Standard_EXPORT virtual void update (const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
private:
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
};
DEFINE_STANDARD_HANDLE(AIS_AnimationObject, AIS_Animation)
#endif // _AIS_AnimationObject_HeaderFile

View File

@@ -103,7 +103,7 @@ public:
private:
Quantity_NameOfColor myCol;
Standard_Real myWid;
Standard_Real myWid{};
Standard_Boolean hasC;
Standard_Boolean hasW;

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AIS_Axis.hxx>
#include <Aspect_TypeOfLine.hxx>
@@ -71,7 +73,7 @@ myTypeOfAxis(anAxisType),
myIsXYZAxis(Standard_True)
{
Handle (Prs3d_DatumAspect) DA = new Prs3d_DatumAspect();
Standard_Real aLength;
Standard_Real aLength = NAN;
try {
aLength = UnitsAPI::AnyToLS(100. ,"mm");
} catch (Standard_Failure const&) {
@@ -112,11 +114,11 @@ AIS_Axis::AIS_Axis(const Handle(Geom_Axis1Placement)& anAxis)
//=======================================================================
AIS_Axis::AIS_Axis (const gp_Ax1& theAxis, const Standard_Real theLength)
: myComponent (new Geom_Line (theAxis)),
myTypeOfAxis (AIS_TOAX_ZAxis),
myIsXYZAxis (Standard_True)
myPfirst(theAxis.Location()), myTypeOfAxis (AIS_TOAX_ZAxis),
myIsXYZAxis (Standard_True), myDir(theAxis.Direction())
{
myDir = theAxis.Direction();
myPfirst = theAxis.Location();
if (theLength <= 0 && theLength != -1)
{
throw Standard_NumericError ("AIS_Axis::AIS_Axis : invalid value for theLength parameter");
@@ -274,7 +276,7 @@ void AIS_Axis::ComputeFields()
const gp_Dir& oX = anAxis.XDirection();
const gp_Dir& oY = anAxis.YDirection();
const gp_Dir& oZ = anAxis.Direction();
Standard_Real xo,yo,zo,x = 0.,y = 0.,z = 0.;
Standard_Real xo = NAN,yo = NAN,zo = NAN,x = 0.,y = 0.,z = 0.;
Orig.Coord(xo,yo,zo);
myPfirst.SetCoord(xo,yo,zo);

View File

@@ -124,8 +124,8 @@ private:
AIS_TypeOfAxis myTypeOfAxis;
Standard_Boolean myIsXYZAxis;
gp_Dir myDir;
Standard_Real myVal;
Standard_CString myText;
Standard_Real myVal{};
Standard_CString myText{};
Handle(Prs3d_LineAspect) myLineAspect;
};

View File

@@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_BadEdgeFilter,SelectMgr_Filter)
//function : AIS_BadEdgeFilter
//purpose :
//=======================================================================
AIS_BadEdgeFilter::AIS_BadEdgeFilter()
AIS_BadEdgeFilter::AIS_BadEdgeFilter() : myContour(0)
{
myContour=0;
}
//=======================================================================

View File

@@ -0,0 +1,88 @@
// Copyright (c) 2023 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.
#include <AIS_BaseAnimationObject.hxx>
#include <V3d_View.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
//=============================================================================
//function : Constructor
//purpose :
//=============================================================================
AIS_BaseAnimationObject::AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject)
: AIS_Animation (theAnimationName),
myContext (theContext),
myObject (theObject)
{
//
}
//=============================================================================
//function : updateTrsf
//purpose :
//=============================================================================
void AIS_BaseAnimationObject::updateTrsf (const gp_Trsf& theTrsf)
{
if (!myContext.IsNull())
{
myContext->SetLocation (myObject, theTrsf);
invalidateViewer();
}
else
{
myObject->SetLocalTransformation (theTrsf);
}
}
//=============================================================================
//function : invalidateViewer
//purpose :
//=============================================================================
void AIS_BaseAnimationObject::invalidateViewer()
{
if (myContext.IsNull())
{
return;
}
const Standard_Boolean isImmediate = myContext->CurrentViewer()->ZLayerSettings (myObject->ZLayer()).IsImmediate();
if (!isImmediate)
{
myContext->CurrentViewer()->Invalidate();
return;
}
// Invalidate immediate view only if it is going out of z-fit range.
// This might be sub-optimal performing this for each animated objects in case of many animated objects.
for (V3d_ListOfView::Iterator aDefViewIter = myContext->CurrentViewer()->DefinedViewIterator();
aDefViewIter.More(); aDefViewIter.Next())
{
const Handle(V3d_View)& aView = aDefViewIter.Value();
const Bnd_Box aMinMaxBox = aView->View()->MinMaxValues (Standard_False);
const Bnd_Box aGraphicBox = aView->View()->MinMaxValues (Standard_True);
Standard_Real aZNear = 0.0;
Standard_Real aZFar = 0.0;
if (aView->Camera()->ZFitAll (aDefViewIter.Value()->AutoZFitScaleFactor(), aMinMaxBox, aGraphicBox, aZNear, aZFar))
{
if (aZNear < aView->Camera()->ZNear()
|| aZFar > aView->Camera()->ZFar())
{
aDefViewIter.Value()->Invalidate();
}
}
}
}

View File

@@ -0,0 +1,49 @@
// Copyright (c) 2023 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_BaseAnimationObject_HeaderFile
#define _AIS_BaseAnimationObject_HeaderFile
#include <AIS_Animation.hxx>
#include <AIS_InteractiveContext.hxx>
//! Animation defining object transformation.
class AIS_BaseAnimationObject : public AIS_Animation
{
DEFINE_STANDARD_RTTIEXT(AIS_BaseAnimationObject, AIS_Animation)
protected:
//! Constructor with initialization.
//! @param[in] theAnimationName animation identifier
//! @param[in] theContext interactive context where object have been displayed
//! @param[in] theObject object to apply local transformation
Standard_EXPORT AIS_BaseAnimationObject (const TCollection_AsciiString& theAnimationName,
const Handle(AIS_InteractiveContext)& theContext,
const Handle(AIS_InteractiveObject)& theObject);
//! Update the transformation.
Standard_EXPORT void updateTrsf (const gp_Trsf& theTrsf);
private:
//! Invalidate the viewer for proper update.
Standard_EXPORT void invalidateViewer();
protected:
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
};
#endif // _AIS_BaseAnimationObject_HeaderFile

View File

@@ -37,7 +37,7 @@ AIS_C0RegularityFilter::AIS_C0RegularityFilter(const TopoDS_Shape& aShape)
{
TopTools_IndexedDataMapOfShapeListOfShape SubShapes;
TopExp::MapShapesAndAncestors(aShape,TopAbs_EDGE,TopAbs_FACE,SubShapes);
Standard_Boolean Ok;
Standard_Boolean Ok = 0;
for (Standard_Integer i = 1; i <= SubShapes.Extent(); i++) {
Ok = Standard_False;
TopTools_ListIteratorOfListOfShape it(SubShapes(i));
@@ -56,7 +56,7 @@ AIS_C0RegularityFilter::AIS_C0RegularityFilter(const TopoDS_Shape& aShape)
}
}
if (Ok) {
TopoDS_Shape curEdge = SubShapes.FindKey( i );
const TopoDS_Shape& curEdge = SubShapes.FindKey( i );
myMapOfEdges.Add(curEdge);
}
}

View File

@@ -511,7 +511,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
setContextToObject (theIObj);
if (!myObjects.IsBound (theIObj))
{
Standard_Integer aDispMode, aHiMod, aSelModeDef;
Standard_Integer aDispMode = 0, aHiMod = 0, aSelModeDef = 0;
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
theIObj->ViewAffinity()->SetVisible (true); // reset view affinity mask
@@ -945,7 +945,7 @@ void AIS_InteractiveContext::Redisplay (const AIS_KindOfInteractive theKOI,
Standard_Boolean isRedisplayed = Standard_False;
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
{
Handle(AIS_InteractiveObject) anObj = anObjIter.Key();
const Handle(AIS_InteractiveObject)& anObj = anObjIter.Key();
if (anObj->Type() != theKOI)
{
continue;
@@ -1155,7 +1155,7 @@ void AIS_InteractiveContext::SetDisplayMode(const Standard_Integer theMode,
continue;
}
Handle(AIS_GlobalStatus) aStatus = anObjIter.Value();
const Handle(AIS_GlobalStatus)& aStatus = anObjIter.Value();
aStatus->SetDisplayMode (theMode);
if (anObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
@@ -2251,7 +2251,7 @@ Bnd_Box AIS_InteractiveContext::BoundingBoxOfSelection (const Handle(V3d_View)&
for (AIS_MapIteratorOfMapOfObjectOwners anIter (anObjectOwnerMap); anIter.More(); anIter.Next())
{
const Handle(SelectMgr_SelectableObject) anObject = anIter.Key();
const Handle(SelectMgr_SelectableObject)& anObject = anIter.Key();
Bnd_Box aTmpBox = anObject->BndBoxOfSelected (anIter.ChangeValue());
aBndSelected.Add (aTmpBox);
}
@@ -3228,6 +3228,30 @@ void AIS_InteractiveContext::ClearSelected (const Standard_Boolean theToUpdateVi
}
}
//=======================================================================
//function : isDetected
//purpose :
//=======================================================================
Standard_Boolean AIS_InteractiveContext::isDetected (const Handle(AIS_InteractiveObject)& theObject)
{
for (Standard_Integer aDetIter = myDetectedSeq.Lower(); aDetIter <= myDetectedSeq.Upper(); aDetIter++)
{
Handle(SelectMgr_EntityOwner) aPicked = MainSelector()->Picked(myDetectedSeq(aDetIter));
Handle(AIS_InteractiveObject) anObj;
if (!aPicked.IsNull())
{
anObj = Handle(AIS_InteractiveObject)::DownCast(aPicked->Selectable());
}
if (!anObj.IsNull()
&& anObj == theObject)
{
return Standard_True;
}
}
return Standard_False;
}
//=======================================================================
//function : SetSelected
//purpose : Sets the whole object as selected and highlights it with selection color
@@ -3288,7 +3312,8 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
}
// added to avoid untimely viewer update...
mySelection->ClearAndSelect (anOwner);
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
mySelection->ClearAndSelect (anOwner, myFilters, isDetected (anObj));
if (myAutoHilight)
{
@@ -3350,7 +3375,7 @@ void AIS_InteractiveContext::SetSelected (const Handle(SelectMgr_EntityOwner)& t
unhighlightSelected();
}
mySelection->ClearAndSelect (theOwner);
mySelection->ClearAndSelect (theOwner, myFilters, isDetected (anObject));
if (myAutoHilight)
{
Handle(Prs3d_Drawer) aCustomStyle;
@@ -3401,16 +3426,17 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
return;
}
if (!myFilters->IsOk(theOwner) && !theOwner->IsSelected())
if (!myFilters->IsOk (theOwner) && !theOwner->IsSelected())
{
return;
}
mySelection->Select (theOwner);
AIS_SelectionScheme aSelScheme = theOwner->IsSelected() ? AIS_SelectionScheme_Remove : AIS_SelectionScheme_Add;
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
mySelection->Select (theOwner, myFilters, aSelScheme, isDetected (anObj));
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
{
@@ -3469,7 +3495,8 @@ Standard_Boolean AIS_InteractiveContext::SetSelectedState (const Handle(SelectMg
}
else
{
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity);
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast(theEntity->Selectable());
const AIS_SelectStatus aSelStatus = mySelection->Select (theEntity, myFilters, AIS_SelectionScheme_Remove, isDetected (anObj));
theEntity->SetSelected (false);
return aSelStatus == AIS_SS_Removed;
}

View File

@@ -1302,6 +1302,9 @@ protected: //! @name internal methods
Standard_EXPORT AIS_StatusOfDetection moveTo (const Handle(V3d_View)& theView,
const Standard_Boolean theToRedrawOnUpdate);
//! Returns True if the object is detected.
Standard_EXPORT Standard_Boolean isDetected (const Handle(AIS_InteractiveObject)& theObject);
//! Helper function to unhighlight all entity owners currently highlighted with seleciton color.
Standard_EXPORT void unselectOwners (const Handle(AIS_InteractiveObject)& theObject);
@@ -1450,7 +1453,7 @@ protected: //! @name internal fields
Handle(SelectMgr_SelectionManager) mgrSelector;
Handle(PrsMgr_PresentationManager) myMainPM;
Handle(V3d_Viewer) myMainVwr;
V3d_View* myLastActiveView;
V3d_View* myLastActiveView{};
Handle(SelectMgr_EntityOwner) myLastPicked;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;

View File

@@ -256,7 +256,7 @@ protected:
Handle(Graphic3d_AspectLine3d) myArrowLineAspectShadow; //!< arrow shadow style
Handle(Graphic3d_MarkerImage) myMarkerImages[2]; //!< icon of disabled (0) and enabled (1) light
Handle(Select3D_SensitiveSphere) mySensSphere; //!< sensitive sphere of directional light source
Aspect_TypeOfMarker myMarkerTypes[2]; //!< icon of disabled (0) and enabled (1) light
Aspect_TypeOfMarker myMarkerTypes[2]{}; //!< icon of disabled (0) and enabled (1) light
Aspect_TypeOfMarker myCodirMarkerType; //!< icon of arrow co-directional to camera direction (look from)
Aspect_TypeOfMarker myOpposMarkerType; //!< icon of arrow opposite to camera direction (look at)

View File

@@ -89,7 +89,7 @@ namespace
ManipSensRotation (theCircle.Position().Direction()) {}
//! Checks whether the circle overlaps current selecting volume
virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) Standard_OVERRIDE
{
return isValidRay (theMgr)
@@ -108,7 +108,7 @@ namespace
ManipSensRotation (thePlaneNormal) {}
//! Checks whether the circle overlaps current selecting volume
virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult) Standard_OVERRIDE
{
return isValidRay (theMgr)
@@ -1116,18 +1116,23 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
const Standard_Integer theMode)
{
//Check mode
AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
const AIS_ManipulatorMode aMode = (AIS_ManipulatorMode) theMode;
if (aMode == AIS_MM_None)
{
return;
}
Handle(SelectMgr_EntityOwner) anOwner;
if (aMode == AIS_MM_None)
{
anOwner = new SelectMgr_EntityOwner (this, 5);
}
if (aMode == AIS_MM_Translation || aMode == AIS_MM_None)
// Sensitivity calculation for manipulator parts allows to avoid
// overlapping of sensitive areas when size of manipulator is small.
// Sensitivity is calculated relative to the default size of the manipulator (100.0f).
const Standard_ShortReal aSensitivityCoef = myAxes[0].Size() / 100.0f;
const Standard_Integer aHighSensitivity = Max (Min (RealToInt (aSensitivityCoef * 15), 15), 3); // clamp sensitivity within range [3, 15]
const Standard_Integer aLowSensitivity = Max (Min (RealToInt (aSensitivityCoef * 10), 10), 2); // clamp sensitivity within range [2, 10]
switch (aMode)
{
case AIS_MM_Translation:
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1136,23 +1141,21 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
continue;
}
const Axis& anAxis = myAxes[anIt];
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Translation, 9);
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Translation, 9);
// define sensitivity by line
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment (anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor (15);
Handle(Select3D_SensitiveSegment) aLine = new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor (aHighSensitivity);
theSelection->Add (aLine);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray (anOwner);
Handle(Select3D_SensitivePrimitiveArray) aTri = new Select3D_SensitivePrimitiveArray(anOwner);
aTri->InitTriangulation (anAxis.TriangleArray()->Attributes(), anAxis.TriangleArray()->Indices(), TopLoc_Location());
theSelection->Add (aTri);
}
break;
}
if (aMode == AIS_MM_Rotation || aMode == AIS_MM_None)
case AIS_MM_Rotation:
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1161,22 +1164,20 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
continue;
}
const Axis& anAxis = myAxes[anIt];
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Rotation, 9);
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Rotation, 9);
// define sensitivity by circle
const gp_Circ aGeomCircle (gp_Ax2 (gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle (anOwner, aGeomCircle);
aCircle->SetSensitivityFactor (15);
theSelection->Add (aCircle);
const gp_Circ aGeomCircle (gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()), anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle);
aCircle->SetSensitivityFactor (aLowSensitivity);
theSelection->Add(aCircle);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation (anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
Handle(Select3D_SensitiveTriangulation) aTri = new ManipSensTriangulation(anOwner, myAxes[anIt].RotatorDisk().Triangulation(), anAxis.ReferenceAxis().Direction());
theSelection->Add (aTri);
}
break;
}
if (aMode == AIS_MM_Scaling || aMode == AIS_MM_None)
case AIS_MM_Scaling:
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1184,21 +1185,19 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
{
continue;
}
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner (this, anIt, AIS_MM_Scaling, 9);
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_Scaling, 9);
// define sensitivity by point
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint (anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor (15);
Handle(Select3D_SensitivePoint) aPnt = new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
aPnt->SetSensitivityFactor (aHighSensitivity);
theSelection->Add (aPnt);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation (anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].ScalerCube().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add (aTri);
}
break;
}
if (aMode == AIS_MM_TranslationPlane || aMode == AIS_MM_None)
case AIS_MM_TranslationPlane:
{
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
{
@@ -1206,28 +1205,33 @@ void AIS_Manipulator::ComputeSelection (const Handle(SelectMgr_Selection)& theSe
{
continue;
}
if (aMode != AIS_MM_None)
{
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
}
anOwner = new AIS_ManipulatorOwner(this, anIt, AIS_MM_TranslationPlane, 9);
// define sensitivity by two crossed lines
gp_Pnt aP1, aP2;
aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition();
aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition();
Standard_Real aSensitivityOffset = ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated (myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
gp_XYZ anOrig = aMidP.Normalized().Multiplied (aSensitivityOffset);
Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
aLine1->SetSensitivityFactor(10);
theSelection->Add(aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, gp::Origin(), aMidP);
aLine2->SetSensitivityFactor(10);
theSelection->Add(aLine2);
aLine1->SetSensitivityFactor(aLowSensitivity);
theSelection->Add (aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
aLine2->SetSensitivityFactor (aLowSensitivity);
theSelection->Add (aLine2);
// enlarge sensitivity by triangulation
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add(aTri);
Handle(Select3D_SensitiveTriangulation) aTri = new Select3D_SensitiveTriangulation(anOwner, myAxes[anIt].DraggerSector().Triangulation(), TopLoc_Location(), Standard_True);
theSelection->Add (aTri);
}
break;
}
default:
{
anOwner = new SelectMgr_EntityOwner(this, 5);
break;
}
}
}

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AIS_Plane.hxx>
#include <AIS_InteractiveContext.hxx>
@@ -421,7 +423,7 @@ void AIS_Plane::SetMinimumSize (const Standard_Real theValue)
UnsetMinimumSize();
return;
}
Standard_Real aX, anY;
Standard_Real aX = NAN, anY = NAN;
Size (aX, anY);
SetTransformPersistence (new Graphic3d_TransformPersScaledAbove (Min (aX, anY) / theValue, myCenter));
}
@@ -518,7 +520,7 @@ void AIS_Plane::ComputeFrame()
{
const Handle(Geom_Plane)& pl = myComponent;
Standard_Real U,V;
Standard_Real U = NAN,V = NAN;
if (myAutomaticPosition) {
ElSLib::Parameters(pl->Pln(),myCenter,U,V);
@@ -551,7 +553,7 @@ void AIS_Plane::ComputeFields()
gp_Dir oY = myAx2->Ax2().YDirection();
gp_Dir oZ = myAx2->Ax2().Direction();
myCenter = Orig;
Standard_Real xo,yo,zo,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4=0,y4=0,z4=0;
Standard_Real xo = NAN,yo = NAN,zo = NAN,x1 = NAN,y1 = NAN,z1 = NAN,x2 = NAN,y2 = NAN,z2 = NAN,x3 = NAN,y3 = NAN,z3 = NAN,x4=0,y4=0,z4=0;
Standard_Real x5=0,y5=0,z5=0;
Orig.Coord(xo,yo,zo);
oX.Coord(x1,y1,z1);

View File

@@ -169,7 +169,7 @@ private:
Standard_Boolean myAutomaticPosition;
AIS_TypeOfPlane myTypeOfPlane;
Standard_Boolean myIsXYZPlane;
Standard_Boolean myHasOwnSize;
Standard_Boolean myHasOwnSize{};
Select3D_TypeOfSensitivity myTypeOfSensitivity;
};

View File

@@ -18,6 +18,8 @@
// + (-1) selection mode token into account
// (SAMTECH specific)
#include <math.h>
#include <AIS_Line.hxx>
#include <AIS_PlaneTrihedron.hxx>
#include <AIS_Point.hxx>
@@ -153,7 +155,7 @@ void AIS_PlaneTrihedron::Compute (const Handle(PrsMgr_PresentationManager)& ,
gp_Dir xDir = myPlane->Position().Ax2().XDirection();
gp_Pnt orig = myPlane->Position().Ax2().Location();
Standard_Real xo,yo,zo,x,y,z;
Standard_Real xo = NAN,yo = NAN,zo = NAN,x = NAN,y = NAN,z = NAN;
orig.Coord( xo, yo, zo );
xDir.Coord( x, y, z );
first.SetCoord( xo, yo, zo );
@@ -188,7 +190,7 @@ void AIS_PlaneTrihedron::Compute (const Handle(PrsMgr_PresentationManager)& ,
void AIS_PlaneTrihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
{
Standard_Integer Prior;
Standard_Integer Prior = 0;
Handle(SelectMgr_EntityOwner) eown;
TColgp_Array1OfPnt PP(1,4),PO(1,4);
// ExtremityPoints(PP);

View File

@@ -55,24 +55,38 @@ void AIS_Selection::Clear()
//function : Select
//purpose :
//=======================================================================
AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& theObject)
AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter,
const AIS_SelectionScheme theSelScheme,
const Standard_Boolean theIsDetected)
{
if (theObject.IsNull()
|| !theObject->HasSelectable())
if (theOwner.IsNull()
|| !theOwner->HasSelectable())
{
return AIS_SS_NotDone;
}
if (!myResultMap.IsBound (theObject))
const Standard_Boolean isDetected = theIsDetected
&& (theFilter.IsNull() || theFilter->IsOk (theOwner));
const Standard_Boolean wasSelected = theOwner->IsSelected();
const Standard_Boolean toSelect = theOwner->Select (theSelScheme, isDetected);
if (toSelect && !wasSelected)
{
AIS_NListOfEntityOwner::Iterator aListIter;
myresult.Append (theObject, aListIter);
myResultMap.Bind (theObject, aListIter);
theObject->SetSelected (Standard_True);
myresult.Append (theOwner, aListIter);
myResultMap.Bind (theOwner, aListIter);
theOwner->SetSelected (Standard_True);
return AIS_SS_Added;
}
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theObject);
if (!toSelect && !wasSelected)
{
return AIS_SS_NotDone;
}
AIS_NListOfEntityOwner::Iterator aListIter = myResultMap.Find (theOwner);
if (myIterator == aListIter)
{
if (myIterator.More())
@@ -88,14 +102,14 @@ AIS_SelectStatus AIS_Selection::Select (const Handle(SelectMgr_EntityOwner)& the
// In the mode of advanced mesh selection only one owner is created for all selection modes.
// It is necessary to check the current detected entity
// and remove the owner from map only if the detected entity is the same as previous selected (IsForcedHilight call)
if (theObject->IsForcedHilight())
if (theOwner->IsForcedHilight())
{
return AIS_SS_Added;
}
myresult.Remove (aListIter);
myResultMap.UnBind (theObject);
theObject->SetSelected (Standard_False);
myResultMap.UnBind (theOwner);
theOwner->SetSelected (Standard_False);
// update list iterator for next object in <myresult> list if any
if (aListIter.More())
@@ -142,86 +156,39 @@ void AIS_Selection::SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwner
const Standard_Boolean theToAllowSelOverlap,
const Handle(SelectMgr_Filter)& theFilter)
{
(void )theToAllowSelOverlap;
switch (theSelScheme)
(void)theToAllowSelOverlap;
if (theSelScheme == AIS_SelectionScheme_ReplaceExtra
&& thePickedOwners.Size() == myresult.Size())
{
case AIS_SelectionScheme_UNKNOWN:
// If picked owners is equivalent to the selected then just clear selected.
Standard_Boolean isTheSame = Standard_True;
for (AIS_NArray1OfEntityOwner::Iterator aPickedIter (thePickedOwners); aPickedIter.More(); aPickedIter.Next())
{
return;
}
case AIS_SelectionScheme_ReplaceExtra:
{
// If picked owners is equivalent to the selected then just clear selected
// Else go to AIS_SelectionScheme_Replace
if (thePickedOwners.Size() == myresult.Size())
if (!myResultMap.IsBound (aPickedIter.Value()))
{
Standard_Boolean isTheSame = Standard_True;
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (!myResultMap.IsBound (aSelIter.Value()))
{
isTheSame = Standard_False;
break;
}
}
if (isTheSame)
{
Clear();
return;
}
isTheSame = Standard_False;
break;
}
}
Standard_FALLTHROUGH
case AIS_SelectionScheme_Replace:
if (isTheSame)
{
Clear();
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
Clear();
return;
}
}
return;
}
case AIS_SelectionScheme_Add:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
appendOwner (aSelIter.Value(), theFilter);
}
return;
}
case AIS_SelectionScheme_Remove:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
if (myResultMap.IsBound (aSelIter.Value()))
{
Select (aSelIter.Value());
}
}
return;
}
case AIS_SelectionScheme_XOR:
{
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aSelIter.Value();
if (anOwner.IsNull()
|| !anOwner->HasSelectable()
|| !theFilter->IsOk (anOwner))
{
continue;
}
if (theSelScheme == AIS_SelectionScheme_Replace
|| theSelScheme == AIS_SelectionScheme_ReplaceExtra
|| theSelScheme == AIS_SelectionScheme_Clear)
{
Clear();
}
Select (anOwner);
}
return;
}
case AIS_SelectionScheme_Clear:
{
Clear();
return;
}
for (AIS_NArray1OfEntityOwner::Iterator aPickedIter (thePickedOwners); aPickedIter.More(); aPickedIter.Next())
{
const Handle(SelectMgr_EntityOwner)& anOwner = aPickedIter.Value();
Select (anOwner, theFilter, theSelScheme, true);
}
}

View File

@@ -34,23 +34,36 @@ public:
//! creates a new selection.
Standard_EXPORT AIS_Selection();
//! removes all the object of the selection.
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 virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theObject);
//! @param[in] theOwner element to change selection state
//! @param[in] theFilter context filter
//! @param[in] theSelScheme selection scheme
//! @param[in] theIsDetected flag of object detection
//! @return result of selection
Standard_EXPORT virtual AIS_SelectStatus Select (const Handle(SelectMgr_EntityOwner)& theOwner,
const Handle(SelectMgr_Filter)& theFilter,
const AIS_SelectionScheme theSelScheme,
const Standard_Boolean theIsDetected);
//! the object is always add int the selection.
//! faster when the number of objects selected is great.
Standard_EXPORT virtual AIS_SelectStatus AddSelect (const Handle(SelectMgr_EntityOwner)& theObject);
//! clears the selection and adds the object in the selection.
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject)
//! @param[in] theObject element to change selection state
//! @param[in] theFilter context filter
//! @param[in] theIsDetected flag of object detection
virtual void ClearAndSelect (const Handle(SelectMgr_EntityOwner)& theObject,
const Handle(SelectMgr_Filter)& theFilter,
const Standard_Boolean theIsDetected)
{
Clear();
Select (theObject);
Select (theObject, theFilter, AIS_SelectionScheme_Add, theIsDetected);
}
//! checks if the object is in the selection.

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AIS_Shape.hxx>
#include <AIS_GraphicTool.hxx>
@@ -856,7 +858,7 @@ void AIS_Shape::SetOwnDeviationAngle (const Standard_Real theAngle)
void AIS_Shape::SetAngleAndDeviation ( const Standard_Real anAngle )
{
Standard_Real OutAngl,OutDefl;
Standard_Real OutAngl = NAN,OutDefl = NAN;
HLRBRep::PolyHLRAngleAndDeflection(anAngle,OutAngl,OutDefl);
SetOwnDeviationAngle(anAngle) ;
SetOwnDeviationCoefficient(OutDefl) ;

View File

@@ -12,6 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AIS_TextLabel.hxx>
#include <AIS_InteractiveContext.hxx>
@@ -292,7 +294,7 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager)& ,
}
gp_Pnt aCenterOfLabel;
Standard_Real aWidth, aHeight;
Standard_Real aWidth = NAN, aHeight = NAN;
Standard_Boolean isInit = calculateLabelParams (aPosition, aCenterOfLabel, aWidth, aHeight);
if (myHasOrientation3D)
@@ -363,7 +365,7 @@ void AIS_TextLabel::ComputeSelection (const Handle(SelectMgr_Selection)& theSele
}
gp_Pnt aCenterOfLabel;
Standard_Real aWidth, aHeight;
Standard_Real aWidth = NAN, aHeight = NAN;
if (!calculateLabelParams (aPosition, aCenterOfLabel, aWidth, aHeight))
{

View File

@@ -13,6 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AIS_TexturedShape.hxx>
#include <AIS_GraphicTool.hxx>
@@ -266,8 +268,8 @@ void AIS_TexturedShape::updateAttributes (const Handle(Prs3d_Presentation)& theP
myAspect = new Graphic3d_AspectFillArea3d (*myDrawer->ShadingAspect()->Aspect());
if (HasPolygonOffsets())
{
Standard_Integer aMode;
Standard_ShortReal aFactor, aUnits;
Standard_Integer aMode = 0;
Standard_ShortReal aFactor = NAN, aUnits = NAN;
PolygonOffsets (aMode, aFactor, aUnits);
myAspect->SetPolygonOffsets (aMode, aFactor, aUnits);
}

View File

@@ -27,12 +27,12 @@
IMPLEMENT_STANDARD_RTTIEXT(AIS_Triangulation,AIS_InteractiveObject)
AIS_Triangulation::AIS_Triangulation(const Handle(Poly_Triangulation)& Triangulation)
AIS_Triangulation::AIS_Triangulation(const Handle(Poly_Triangulation)& Triangulation) : myTriangulation(Triangulation), myNbNodes(Triangulation->NbNodes()), myNbTriangles(Triangulation->NbTriangles()), myFlagColor(0)
{
myTriangulation = Triangulation;
myNbNodes = Triangulation->NbNodes();
myNbTriangles = Triangulation->NbTriangles();
myFlagColor = 0;
}
//=======================================================================

View File

@@ -241,7 +241,7 @@ protected:
Standard_Boolean myHasOwnArrowColor;
TCollection_ExtendedString myLabels[Prs3d_DatumParts_NB];
Standard_Integer mySelectionPriority[Prs3d_DatumParts_NB];
Standard_Integer mySelectionPriority[Prs3d_DatumParts_NB]{};
Handle(Graphic3d_Group) myPartToGroup[Prs3d_DatumParts_NB];
NCollection_List<Prs3d_DatumParts> mySelectedParts;

View File

@@ -43,7 +43,7 @@ public:
}
//! Image reader.
virtual Handle(Image_PixMap) GetImage (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE
Handle(Image_PixMap) GetImage (const Handle(Image_SupportedFormats)& theSupported) Standard_OVERRIDE
{
return myImageSource->ReadImage (theSupported);
}

View File

@@ -2,6 +2,8 @@ AIS.hxx
AIS_Animation.cxx
AIS_Animation.hxx
AIS_AnimationTimer.hxx
AIS_AnimationAxisRotation.cxx
AIS_AnimationAxisRotation.hxx
AIS_AnimationCamera.cxx
AIS_AnimationCamera.hxx
AIS_AnimationObject.cxx
@@ -12,6 +14,8 @@ AIS_Axis.cxx
AIS_Axis.hxx
AIS_BadEdgeFilter.cxx
AIS_BadEdgeFilter.hxx
AIS_BaseAnimationObject.cxx
AIS_BaseAnimationObject.hxx
AIS_C0RegularityFilter.cxx
AIS_C0RegularityFilter.hxx
AIS_CameraFrustum.cxx

View File

@@ -36,9 +36,9 @@ static Handle(TCollection_HAsciiString) nulstr;
static Handle(Interface_HArray1OfHAsciiString) nularr;
APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader
(const Handle(StepData_StepModel)& model)
(const Handle(StepData_StepModel)& model) : done(Standard_True)
{
done = Standard_True;
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileName))) {
fn = GetCasted(HeaderSection_FileName,
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileName)));
@@ -384,7 +384,7 @@ void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_H
Handle(Interface_HArray1OfHAsciiString) idents = fs->SchemaIdentifiers();
// check that requested subschema is already in the list
Standard_Integer i;
Standard_Integer i = 0;
for ( i=1; ! idents.IsNull() && i <= idents->Length(); i++ ) {
if ( aSchem->IsSameString ( idents->Value(i) ) ) return;
}

View File

@@ -185,7 +185,7 @@ private:
Standard_Boolean done;
Standard_Boolean done{};
Handle(HeaderSection_FileName) fn;
Handle(HeaderSection_FileSchema) fs;
Handle(HeaderSection_FileDescription) fd;

View File

@@ -224,7 +224,7 @@ void Adaptor2d_OffsetCurve::Intervals(TColStd_Array1OfReal& TI,
Standard_Integer last = nbInter+1;
while (T(last) >= myLast) last--;
Standard_Integer i = TI.Lower(), j;
Standard_Integer i = TI.Lower(), j = 0;
for (j = first-1; j <= last+1; j++) {
TI(i) = T(j);
i++;

View File

@@ -14,6 +14,8 @@
#define No_Standard_OutOfRange
#include <math.h>
#include <Adaptor3d_CurveOnSurface.hxx>
#include <Adaptor2d_Curve2d.hxx>
@@ -242,9 +244,9 @@ static void Locate1Coord(const Standard_Integer Index,
const Handle(Geom_BSplineCurve)& BSplC,
gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop)
{
Standard_Real Comp1=0, DComp1=0, cur, f = 0.0, l = 0.0;
Standard_Real Comp1=0, DComp1=0, cur = NAN, f = 0.0, l = 0.0;
Standard_Real Tol = Precision::PConfusion()/10;
Standard_Integer i = 1, Bnd1, Bnd2;
Standard_Integer i = 1, Bnd1 = 0, Bnd2 = 0;
Standard_Boolean DIsNull= Standard_False;
TColStd_Array1OfReal Arr(1,BSplC->NbKnots()); BSplC->Knots(Arr);
@@ -346,7 +348,7 @@ static void Locate1Coord(const Standard_Integer Index,
{
Standard_Real Comp1=0,DComp1=0;
Standard_Real Tol = Precision::PConfusion()/10;
Standard_Integer i=1, Up=0, Up1, Up2, Down=0, Down1, Down2;
Standard_Integer i=1, Up=0, Up1 = 0, Up2 = 0, Down=0, Down1 = 0, Down2 = 0;
Standard_Real cur = 0.;
DIsNull= Standard_False;
@@ -875,7 +877,7 @@ Standard_Integer Adaptor3d_CurveOnSurface::NbIntervals (const GeomAbs_Shape S) c
if(S == myIntCont && !myIntervals.IsNull())
return myIntervals->Length()-1;
Standard_Integer nu,nv,nc;
Standard_Integer nu = 0,nv = 0,nc = 0;
nu=mySurface->NbUIntervals(S);
nv=mySurface->NbVIntervals(S);
nc=myCurve->NbIntervals(S);
@@ -887,7 +889,7 @@ Standard_Integer Adaptor3d_CurveOnSurface::NbIntervals (const GeomAbs_Shape S) c
TColStd_Array1OfReal TabC(TabBuf(nu + nv + 3), 1, nc+1);
Standard_Integer NbSample = 20;
Standard_Real U,V,Tdeb,Tfin;
Standard_Real U = NAN,V = NAN,Tdeb = NAN,Tfin = NAN;
Tdeb=myCurve->FirstParameter();
Tfin=myCurve->LastParameter();
@@ -1234,7 +1236,7 @@ gp_Vec Adaptor3d_CurveOnSurface::DN
Standard_Real Adaptor3d_CurveOnSurface::Resolution
(const Standard_Real R3d) const
{
Standard_Real ru,rv;
Standard_Real ru = NAN,rv = NAN;
ru = mySurface->UResolution(R3d);
rv = mySurface->VResolution(R3d);
return myCurve->Resolution(Min(ru,rv));
@@ -1648,7 +1650,7 @@ void Adaptor3d_CurveOnSurface::EvalKPart()
void Adaptor3d_CurveOnSurface::EvalFirstLastSurf()
{
Standard_Real FirstPar,LastPar;
Standard_Real FirstPar = NAN,LastPar = NAN;
gp_Pnt2d UV, LeftBot, RightTop;
gp_Vec2d DUV;
Standard_Real Tol= Precision::PConfusion()/10;
@@ -1756,7 +1758,7 @@ Standard_Boolean Adaptor3d_CurveOnSurface::LocatePart_RevExt(const gp_Pnt2d& UV,
Locate2Coord(1,UV,DUV,S->FirstUParameter(),S->LastUParameter(),LeftBot,RightTop);
}
Standard_Real u1,u2,v1,v2;
Standard_Real u1 = NAN,u2 = NAN,v1 = NAN,v2 = NAN;
ReverseParam(LeftBot.X(),RightTop.X(),u1,u2);
LeftBot.SetX(u1);
RightTop.SetX(u2);

View File

@@ -13,6 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Adaptor3d_HSurfaceTool.hxx>
#include <Adaptor3d_Curve.hxx>
@@ -102,7 +104,7 @@ Standard_Boolean Adaptor3d_HSurfaceTool::IsSurfG1(const Handle(Adaptor3d_Surface
const Standard_Boolean theAlongU,
const Standard_Real theAngTol)
{
Standard_Real aUf, aUl, aVf, aVl;
Standard_Real aUf = NAN, aUl = NAN, aVf = NAN, aVl = NAN;
aUf = theSurf->FirstUParameter();
aUl = theSurf->LastUParameter();
aVf = theSurf->FirstVParameter();

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Adaptor3d_InterFunc.hxx>
#include <Adaptor2d_Curve2d.hxx>
@@ -40,7 +42,7 @@ Standard_Boolean Adaptor3d_InterFunc::Value(const Standard_Real X , Standard_Rea
}
Standard_Boolean Adaptor3d_InterFunc::Derivative(const Standard_Real X , Standard_Real& D)
{
Standard_Real F;
Standard_Real F = NAN;
return Values(X,F,D);
}
Standard_Boolean Adaptor3d_InterFunc::Values(const Standard_Real X , Standard_Real& F,Standard_Real& D)

View File

@@ -11,6 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Adaptor3d_IsoCurve.hxx>
#include <Adaptor3d_Curve.hxx>
@@ -312,7 +314,7 @@ void Adaptor3d_IsoCurve::Intervals(TColStd_Array1OfReal& TI,
Standard_Integer last = nbInter+1;
while (T(last) >= myLast) last--;
Standard_Integer i = TI.Lower(), j;
Standard_Integer i = TI.Lower(), j = 0;
for (j = first-1; j <= last+1; j++) {
TI(i) = T(j);
i++;
@@ -675,7 +677,7 @@ static void computeHR(const gp_Ax3& axes,
gp_Circ Adaptor3d_IsoCurve::Circle() const
{
gp_Ax3 axes;
Standard_Real radius,h = 0.;
Standard_Real radius = NAN,h = 0.;
switch (mySurface->GetType()) {

View File

@@ -11,6 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Adaptor3d_TopolTool.hxx>
#include <Adaptor2d_Line2d.hxx>
@@ -58,7 +60,7 @@ void Adaptor3d_TopolTool::Initialize ()
void Adaptor3d_TopolTool::Initialize (const Handle(Adaptor3d_Surface)& S)
{
Standard_Real pinf,psup,deltap;
Standard_Real pinf = NAN,psup = NAN,deltap = NAN;
//Adaptor2d_Line2d * Line2dPtr ;
myNbSamplesU=-1;
@@ -216,7 +218,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor2d_Curve2d)& C)
{
nbVtx = 0;
idVtx = 0;
Standard_Real theUinf,theUsup;
Standard_Real theUinf = NAN,theUsup = NAN;
theUinf = C->FirstParameter();
theUsup = C->LastParameter();
// if (!Precision::IsNegativeInfinite(theUinf)) {
@@ -280,7 +282,7 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P,
return TopAbs_IN;
}
else {
Standard_Boolean dansu,dansv,surumin,surumax,survmin,survmax;
Standard_Boolean dansu = 0,dansv = 0,surumin = 0,surumax = 0,survmin = 0,survmax = 0;
if (Precision::IsNegativeInfinite(Uinf) &&
Precision::IsPositiveInfinite(Usup)) {
dansu = Standard_True;
@@ -415,7 +417,7 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P,
return(Standard_False);
}
else {
Standard_Boolean dansu,dansv,surumin,surumax,survmin,survmax;
Standard_Boolean dansu = 0,dansv = 0,surumin = 0,surumax = 0,survmin = 0,survmax = 0;
if (Precision::IsNegativeInfinite(Uinf) &&
Precision::IsPositiveInfinite(Usup)) {
dansu = Standard_True;
@@ -569,7 +571,7 @@ static void Analyse(const TColgp_Array2OfPnt& array2,
Standard_Integer& myNbSamplesU,
Standard_Integer& myNbSamplesV) {
gp_Vec Vi,Vip1;
Standard_Integer sh,nbch,i,j;
Standard_Integer sh = 0,nbch = 0,i = 0,j = 0;
sh = 1;
nbch = 0;
@@ -638,7 +640,7 @@ void Adaptor3d_TopolTool::ComputeSamplePoints()
{
const Standard_Integer aMaxNbSample = 50;
Standard_Real uinf,usup,vinf,vsup;
Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN;
uinf = myS->FirstUParameter(); usup = myS->LastUParameter();
vinf = myS->FirstVParameter(); vsup = myS->LastVParameter();
if (usup < uinf) { Standard_Real temp=uinf; uinf=usup; usup=temp; }
@@ -651,7 +653,7 @@ void Adaptor3d_TopolTool::ComputeSamplePoints()
else if (vinf == RealFirst()) { vinf=vsup-2.e5; }
else if (vsup == RealLast()) { vsup=vinf+2.e5; }
Standard_Integer nbsu,nbsv;
Standard_Integer nbsu = 0,nbsv = 0;
GeomAbs_SurfaceType typS = myS->GetType();
switch(typS) {
case GeomAbs_Plane: { nbsv=2; nbsu=2; } break;
@@ -756,8 +758,8 @@ void Adaptor3d_TopolTool::SamplePoint(const Standard_Integer i,
gp_Pnt2d& P2d,
gp_Pnt& P3d)
{
Standard_Integer iu, iv;
Standard_Real u, v;
Standard_Integer iu = 0, iv = 0;
Standard_Real u = NAN, v = NAN;
if (myUPars.IsNull())
{
Standard_Real myDU=(Usup-Uinf)/(myNbSamplesU+1);
@@ -846,7 +848,7 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl,
const Standard_Integer theNUmin,
const Standard_Integer theNVmin)
{
Standard_Real uinf,usup,vinf,vsup;
Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN;
uinf = myS->FirstUParameter(); usup = myS->LastUParameter();
vinf = myS->FirstVParameter(); vsup = myS->LastVParameter();
if (usup < uinf) { Standard_Real temp=uinf; uinf=usup; usup=temp; }
@@ -906,8 +908,8 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl,
myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
myVPars = new TColStd_HArray1OfReal(1, myNbSamplesV);
Standard_Integer i;
Standard_Real t, dt = (usup - uinf)/(myNbSamplesU - 1);
Standard_Integer i = 0;
Standard_Real t = NAN, dt = (usup - uinf)/(myNbSamplesU - 1);
myUPars->SetValue(1, uinf);
myUPars->SetValue(myNbSamplesU, usup);
for(i = 2, t = uinf+dt; i < myNbSamplesU; ++i, t += dt) {
@@ -936,12 +938,12 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
{
const Standard_Integer aMaxPnts = 1001;
const Handle(Geom_BSplineSurface)& aBS = myS->BSpline();
Standard_Real uinf,usup,vinf,vsup;
Standard_Real uinf = NAN,usup = NAN,vinf = NAN,vsup = NAN;
uinf = myS->FirstUParameter(); usup = myS->LastUParameter();
vinf = myS->FirstVParameter(); vsup = myS->LastVParameter();
Standard_Integer i, k, j = 1;
Standard_Real t1, t2, dt;
Standard_Integer i = 0, k = 0, j = 1;
Standard_Real t1 = NAN, t2 = NAN, dt = NAN;
Standard_Integer ui1 = aBS->FirstUKnotIndex();
Standard_Integer ui2 = aBS->LastUKnotIndex();
Standard_Integer vi1 = aBS->FirstVKnotIndex();
@@ -982,7 +984,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
//modified by NIZHNY-EMV Mon Jun 10 14:19:04 2013
if (nbsu < theNUmin || nbsv < theNVmin) {
Standard_Integer aNb;
Standard_Integer aNb = 0;
if (nbsu < nbsv) {
aNb = (Standard_Integer)(nbsv * ((Standard_Real)theNUmin)/((Standard_Real)nbsu));
aNb = Min(aNb, 30);
@@ -1096,7 +1098,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
Standard_Real aDefl2 = Max(theDefl*theDefl, 1.e-9);
Standard_Real tol = Max(0.01*aDefl2, 1.e-9);
Standard_Integer l;
Standard_Integer l = 0;
anUFlg(1) = Standard_True;
anUFlg(nbsu) = Standard_True;
@@ -1270,7 +1272,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
//
//modified by NIZNHY-PKV Fri Dec 16 10:05:01 2011f
//
Standard_Boolean bFlag;
Standard_Boolean bFlag = 0;
//
// U
bFlag=(myNbSamplesU < theNUmin);

View File

@@ -157,22 +157,22 @@ public:
protected:
Handle(Adaptor3d_Surface) myS;
Standard_Integer myNbSamplesU;
Standard_Integer myNbSamplesV;
Standard_Integer myNbSamplesU{};
Standard_Integer myNbSamplesV{};
Handle(TColStd_HArray1OfReal) myUPars;
Handle(TColStd_HArray1OfReal) myVPars;
private:
Standard_Integer nbRestr;
Standard_Integer idRestr;
Standard_Real Uinf;
Standard_Real Usup;
Standard_Real Vinf;
Standard_Real Vsup;
Standard_Integer nbRestr{};
Standard_Integer idRestr{};
Standard_Real Uinf{};
Standard_Real Usup{};
Standard_Real Vinf{};
Standard_Real Vsup{};
Handle(Adaptor2d_Line2d) myRestr[4];
Standard_Integer nbVtx;
Standard_Integer idVtx;
Standard_Integer nbVtx{};
Standard_Integer idVtx{};
Handle(Adaptor3d_HVertex) myVtx[2];
};

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AdvApp2Var_ApproxAFunc2Var.hxx>
#include <AdvApp2Var_EvaluatorFunc2Var.hxx>
#include <AdvApp2Var_Criterion.hxx>
@@ -171,7 +173,7 @@ AdvApp2Var_ApproxAFunc2Var::AdvApp2Var_ApproxAFunc2Var(
void AdvApp2Var_ApproxAFunc2Var::Init()
{
Standard_Integer ifav,iu=0,iv=0,ndu,ndv;
Standard_Integer ifav = 0,iu=0,iv=0,ndu = 0,ndv = 0;
switch (myFavoriteIso) {
case GeomAbs_IsoU :
ifav = 1;
@@ -239,7 +241,7 @@ void AdvApp2Var_ApproxAFunc2Var::Init()
void AdvApp2Var_ApproxAFunc2Var::InitGrid(const Standard_Integer NbInt)
{
Standard_Integer iu=myConditions.UOrder(),iv=myConditions.VOrder(),iint;
Standard_Integer iu=myConditions.UOrder(),iv=myConditions.VOrder(),iint = 0;
Handle(AdvApp2Var_Patch) M0 = new AdvApp2Var_Patch (myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,iu,iv);
@@ -346,10 +348,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
const AdvApprox_Cutting& VChoice,
const AdvApp2Var_EvaluatorFunc2Var& Func)
{
Standard_Real Udec, Vdec;
Standard_Boolean Umore, Vmore;
Standard_Integer NbPatch, NbU, NbV, NumDec;
Standard_Integer FirstNA;
Standard_Real Udec = NAN, Vdec = NAN;
Standard_Boolean Umore = 0, Vmore = 0;
Standard_Integer NbPatch = 0, NbU = 0, NbV = 0, NumDec = 0;
Standard_Integer FirstNA = 0;
while (myResult.FirstNotApprox(FirstNA)) {
@@ -437,10 +439,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
const AdvApp2Var_EvaluatorFunc2Var& Func,
const AdvApp2Var_Criterion& Crit)
{
Standard_Real Udec, Vdec, CritValue, m1=0.;
Standard_Boolean Umore, Vmore, CritAbs = (Crit.Type() == AdvApp2Var_Absolute);
Standard_Integer NbPatch, NbU, NbV, NbInt, NumDec;
Standard_Integer FirstNA, decision=0;
Standard_Real Udec = NAN, Vdec = NAN, CritValue = NAN, m1=0.;
Standard_Boolean Umore = 0, Vmore = 0, CritAbs = (Crit.Type() == AdvApp2Var_Absolute);
Standard_Integer NbPatch = 0, NbU = 0, NbV = 0, NbInt = 0, NumDec = 0;
Standard_Integer FirstNA = 0, decision=0;
while (myResult.FirstNotApprox(FirstNA)) {
@@ -551,9 +553,9 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
const AdvApprox_Cutting& VChoice,
const AdvApp2Var_EvaluatorFunc2Var& Func)
{
Standard_Real dec;
Standard_Boolean more;
Standard_Integer ind1, ind2, NbPatch, NbU, NbV;
Standard_Real dec = NAN;
Standard_Boolean more = 0;
Standard_Integer ind1 = 0, ind2 = 0, NbPatch = 0, NbU = 0, NbV = 0;
Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder();
AdvApp2Var_Node N1(iu,iv), N2(iu,iv);
@@ -638,10 +640,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
const AdvApp2Var_EvaluatorFunc2Var& Func,
const AdvApp2Var_Criterion& Crit)
{
Standard_Real dec;
Standard_Boolean more, CritRel = (Crit.Type() == AdvApp2Var_Relative);
Standard_Integer ind1, ind2, NbPatch, NbU, NbV;
Standard_Integer indN1, indN2;
Standard_Real dec = NAN;
Standard_Boolean more = 0, CritRel = (Crit.Type() == AdvApp2Var_Relative);
Standard_Integer ind1 = 0, ind2 = 0, NbPatch = 0, NbU = 0, NbV = 0;
Standard_Integer indN1 = 0, indN2 = 0;
Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder();
AdvApp2Var_Node N1(iu,iv), N2(iu,iv);
@@ -727,9 +729,9 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
void AdvApp2Var_ApproxAFunc2Var::Compute3DErrors()
{
Standard_Integer iesp,ipat;
Standard_Real error_max,error_moy,error_U0,error_V0,error_U1,error_V1;
Standard_Real Tol,F1Tol,F2Tol,F3Tol,F4Tol;
Standard_Integer iesp = 0,ipat = 0;
Standard_Real error_max = NAN,error_moy = NAN,error_U0 = NAN,error_V0 = NAN,error_U1 = NAN,error_V1 = NAN;
Standard_Real Tol = NAN,F1Tol = NAN,F2Tol = NAN,F3Tol = NAN,F4Tol = NAN;
if ( myNumSubSpaces[2] > 0 ) {
my3DMaxError = new (TColStd_HArray1OfReal) (1,myNumSubSpaces[2]);
my3DAverageError = new (TColStd_HArray1OfReal) (1,myNumSubSpaces[2]);
@@ -778,8 +780,8 @@ void AdvApp2Var_ApproxAFunc2Var::Compute3DErrors()
void AdvApp2Var_ApproxAFunc2Var::ComputeCritError()
{
Standard_Integer iesp,ipat;
Standard_Real crit_max;
Standard_Integer iesp = 0,ipat = 0;
Standard_Real crit_max = NAN;
if ( myNumSubSpaces[2] > 0 ) {
for (iesp=1;iesp<=myNumSubSpaces[2];iesp++) {
crit_max = 0.;
@@ -808,7 +810,7 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS()
// Calculate resulting surfaces
mySurfaces = new ( TColGeom_HArray1OfSurface) (1, myNumSubSpaces[2]);
Standard_Integer j;
Standard_Integer j = 0;
TColStd_Array1OfReal UKnots (1, myResult.NbPatchInU()+1);
for (j=1; j<=UKnots.Length(); j++) { UKnots.SetValue(j, myResult.UParameter(j)); }
@@ -840,11 +842,11 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS()
Handle(TColStd_HArray1OfReal) Poly =
new (TColStd_HArray1OfReal) (1, nmax * Size_eq);
Standard_Integer SSP, i;
Standard_Integer SSP = 0, i = 0;
for (SSP=1; SSP <= myNumSubSpaces[2]; SSP++) {
// Creation of the grid of polynoms
Standard_Integer n=0,icf=1,ieq;
Standard_Integer n=0,icf=1,ieq = 0;
for (j=1; j<=myResult.NbPatchInV(); j++) {
for (i=1; i<=myResult.NbPatchInU(); i++) {
n++;
@@ -1064,7 +1066,7 @@ Standard_Real
void AdvApp2Var_ApproxAFunc2Var::Dump(Standard_OStream& o) const
{
Standard_Integer iesp=1,NbKU,NbKV,ik;
Standard_Integer iesp=1,NbKU = 0,NbKV = 0,ik = 0;
o<<std::endl;
if (!myHasResult) { o<<"No result"<<std::endl; }
else {

View File

@@ -193,7 +193,7 @@ private:
Standard_EXPORT void ConvertBS();
Standard_Integer myNumSubSpaces[3];
Standard_Integer myNumSubSpaces[3]{};
Handle(TColStd_HArray1OfReal) my1DTolerances;
Handle(TColStd_HArray1OfReal) my2DTolerances;
Handle(TColStd_HArray1OfReal) my3DTolerances;

View File

@@ -11,6 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <AdvApp2Var_SysBase.hxx>
#include <AdvApp2Var_MathBase.hxx>
#include <AdvApp2Var_Data_f2c.hxx>
@@ -275,15 +277,15 @@ int mma1cdi_(integer *ndimen,
integer c__1 = 1;
/* System generated locals */
integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset,
somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
fpntab_dim1, fpntab_offset, hermit_dim1, hermit_offset, i__1,
i__2, i__3;
integer contr1_dim1 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_offset = 0,
somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, diftab_offset = 0,
fpntab_dim1 = 0, fpntab_offset = 0, hermit_dim1 = 0, hermit_offset = 0, i__1 = 0,
i__2 = 0, i__3 = 0;
/* Local variables */
integer nroo2, ncfhe, nd, ii, kk;
integer ibb, kkm, kkp;
doublereal bid1, bid2, bid3 = 0.;
integer nroo2 = 0, ncfhe = 0, nd = 0, ii = 0, kk = 0;
integer ibb = 0, kkm = 0, kkp = 0;
doublereal bid1 = NAN, bid2 = NAN, bid3 = 0.;
/* **********************************************************************
*/
@@ -495,13 +497,13 @@ int mma1cnt_(integer *ndimen,
doublereal *crvjac)
{
/* System generated locals */
integer contr1_dim1, contr1_offset, contr2_dim1, contr2_offset,
hermit_dim1, hermit_offset, crvjac_dim1, crvjac_offset, i__1,
i__2, i__3;
integer contr1_dim1 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_offset = 0,
hermit_dim1 = 0, hermit_offset = 0, crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0,
i__2 = 0, i__3 = 0;
/* Local variables */
integer nd, ii, jj, ibb;
doublereal bid;
integer nd = 0, ii = 0, jj = 0, ibb = 0;
doublereal bid = NAN;
/* ***********************************************************************
@@ -632,16 +634,16 @@ int mma1fdi_(integer *ndimen,
integer *iercod)
{
/* System generated locals */
integer fpntab_dim1, somtab_dim1, somtab_offset, diftab_dim1,
diftab_offset, contr1_dim1, contr1_offset, contr2_dim1,
contr2_offset, i__1, i__2;
doublereal d__1;
integer fpntab_dim1 = 0, somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0,
diftab_offset = 0, contr1_dim1 = 0, contr1_offset = 0, contr2_dim1 = 0,
contr2_offset = 0, i__1 = 0, i__2 = 0;
doublereal d__1 = NAN;
/* Local variables */
integer ideb, ifin, nroo2, ideru, iderv;
doublereal renor;
integer ii, nd, ibb, iim, nbp, iip;
doublereal bid1, bid2;
integer ideb = 0, ifin = 0, nroo2 = 0, ideru = 0, iderv = 0;
doublereal renor = NAN;
integer ii = 0, nd = 0, ibb = 0, iim = 0, nbp = 0, iip = 0;
doublereal bid1 = NAN, bid2 = NAN;
/* **********************************************************************
*/
@@ -962,11 +964,11 @@ int mma1fer_(integer *,//ndimen,
integer *iercod)
{
/* System generated locals */
integer crvjac_dim1, crvjac_offset, i__1, i__2;
integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0;
/* Local variables */
integer idim, ncfja, ncfnw, ndses, ii, kk, ibb, ier;
integer nbr0;
integer idim = 0, ncfja = 0, ncfnw = 0, ndses = 0, ii = 0, kk = 0, ibb = 0, ier = 0;
integer nbr0 = 0;
/* ***********************************************************************
@@ -1156,10 +1158,10 @@ int AdvApp2Var_ApproxF2var::mma1her_(const integer *iordre,
integer *iercod)
{
/* System generated locals */
integer hermit_dim1, hermit_offset;
integer hermit_dim1 = 0, hermit_offset = 0;
/* Local variables */
integer ibb;
integer ibb = 0;
@@ -1323,11 +1325,11 @@ int mma1jak_(integer *ndimen,
integer *iercod)
{
/* System generated locals */
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
crvjac_dim1, crvjac_offset;
integer somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, diftab_offset = 0,
crvjac_dim1 = 0, crvjac_offset = 0;
/* Local variables */
integer ibb;
integer ibb = 0;
/* **********************************************************************
*/
@@ -1437,13 +1439,13 @@ int mma1noc_(doublereal *dfuvin,
doublereal *cntout)
{
/* System generated locals */
integer i__1;
doublereal d__1;
integer i__1 = 0;
doublereal d__1 = NAN;
/* Local variables */
doublereal rider, riord;
integer nd, ibb;
doublereal bid;
doublereal rider = NAN, riord = NAN;
integer nd = 0, ibb = 0;
doublereal bid = NAN;
/* **********************************************************************
*/
@@ -1571,11 +1573,11 @@ int mma1nop_(integer *nbroot,
{
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Local variables */
doublereal alinu, blinu, alinv, blinv;
integer ii, ibb;
doublereal alinu = NAN, blinu = NAN, alinv = NAN, blinv = NAN;
integer ii = 0, ibb = 0;
/* ***********************************************************************
*/
@@ -1686,18 +1688,18 @@ int AdvApp2Var_ApproxF2var::mma2ac1_(integer const *ndimen,
{
/* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
contr2_offset, contr3_dim1, contr3_dim2, contr3_offset,
contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1,
uhermt_offset, vhermt_dim1, vhermt_offset, patjac_dim1,
patjac_dim2, patjac_offset, i__1, i__2, i__3, i__4, i__5;
integer contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0,
contr2_offset = 0, contr3_dim1 = 0, contr3_dim2 = 0, contr3_offset = 0,
contr4_dim1 = 0, contr4_dim2 = 0, contr4_offset = 0, uhermt_dim1 = 0,
uhermt_offset = 0, vhermt_dim1 = 0, vhermt_offset = 0, patjac_dim1 = 0,
patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0, i__5 = 0;
/* Local variables */
logical ldbg;
integer ndgu, ndgv;
doublereal bidu1, bidu2, bidv1, bidv2;
integer ioru1, iorv1, ii, nd, jj, ku, kv;
doublereal cnt1, cnt2, cnt3, cnt4;
logical ldbg = 0;
integer ndgu = 0, ndgv = 0;
doublereal bidu1 = NAN, bidu2 = NAN, bidv1 = NAN, bidv2 = NAN;
integer ioru1 = 0, iorv1 = 0, ii = 0, nd = 0, jj = 0, ku = 0, kv = 0;
doublereal cnt1 = NAN, cnt2 = NAN, cnt3 = NAN, cnt4 = NAN;
/* **********************************************************************
*/
@@ -1853,14 +1855,14 @@ int AdvApp2Var_ApproxF2var::mma2ac2_(const integer *ndimen,
{
/* System generated locals */
integer crbiv1_dim1, crbiv1_dim2, crbiv1_offset, crbiv2_dim1, crbiv2_dim2,
crbiv2_offset, patjac_dim1, patjac_dim2, patjac_offset,
vhermt_dim1, vhermt_offset, i__1, i__2, i__3, i__4;
integer crbiv1_dim1 = 0, crbiv1_dim2 = 0, crbiv1_offset = 0, crbiv2_dim1 = 0, crbiv2_dim2 = 0,
crbiv2_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0,
vhermt_dim1 = 0, vhermt_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0;
/* Local variables */
logical ldbg;
integer ndgv1, ndgv2, ii, jj, nd, kk;
doublereal bid1, bid2;
logical ldbg = 0;
integer ndgv1 = 0, ndgv2 = 0, ii = 0, jj = 0, nd = 0, kk = 0;
doublereal bid1 = NAN, bid2 = NAN;
/* **********************************************************************
*/
@@ -1999,14 +2001,14 @@ int AdvApp2Var_ApproxF2var::mma2ac3_(const integer *ndimen,
{
/* System generated locals */
integer crbiu1_dim1, crbiu1_dim2, crbiu1_offset, crbiu2_dim1, crbiu2_dim2,
crbiu2_offset, patjac_dim1, patjac_dim2, patjac_offset,
uhermt_dim1, uhermt_offset, i__1, i__2, i__3, i__4;
integer crbiu1_dim1 = 0, crbiu1_dim2 = 0, crbiu1_offset = 0, crbiu2_dim1 = 0, crbiu2_dim2 = 0,
crbiu2_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0,
uhermt_dim1 = 0, uhermt_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0;
/* Local variables */
logical ldbg;
integer ndgu1, ndgu2, ii, jj, nd, kk;
doublereal bid1, bid2;
logical ldbg = 0;
integer ndgu1 = 0, ndgu2 = 0, ii = 0, jj = 0, nd = 0, kk = 0;
doublereal bid1 = NAN, bid2 = NAN;
/* **********************************************************************
*/
@@ -2146,12 +2148,12 @@ int AdvApp2Var_ApproxF2var::mma2can_(const integer *ncfmxu,
{
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, patcan_dim1, patcan_dim2,
patcan_offset, i__1, i__2;
integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, patcan_dim1 = 0, patcan_dim2 = 0,
patcan_offset = 0, i__1 = 0, i__2 = 0;
/* Local variables */
logical ldbg;
integer ilon1, ilon2, ii, nd;
logical ldbg = 0;
integer ilon1 = 0, ilon2 = 0, ii = 0, nd = 0;
/* **********************************************************************
*/
@@ -2306,21 +2308,21 @@ int mma2cd1_(integer *ndimen,
integer c__1 = 1;
/* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
contr2_offset, contr3_dim1, contr3_dim2, contr3_offset,
contr4_dim1, contr4_dim2, contr4_offset, uhermt_dim1,
uhermt_offset, vhermt_dim1, vhermt_offset, fpntbu_dim1,
fpntbu_offset, fpntbv_dim1, fpntbv_offset, sosotb_dim1,
sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2,
diditb_offset, soditb_dim1, soditb_dim2, soditb_offset,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4,
i__5;
integer contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0,
contr2_offset = 0, contr3_dim1 = 0, contr3_dim2 = 0, contr3_offset = 0,
contr4_dim1 = 0, contr4_dim2 = 0, contr4_offset = 0, uhermt_dim1 = 0,
uhermt_offset = 0, vhermt_dim1 = 0, vhermt_offset = 0, fpntbu_dim1 = 0,
fpntbu_offset = 0, fpntbv_dim1 = 0, fpntbv_offset = 0, sosotb_dim1 = 0,
sosotb_dim2 = 0, sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0,
diditb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
disotb_dim1 = 0, disotb_dim2 = 0, disotb_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0,
i__5 = 0;
/* Local variables */
integer ncfhu, ncfhv, nuroo, nvroo, nd, ii, jj, kk, ll, ibb, kkm,
llm, kkp, llp;
doublereal bid1, bid2, bid3, bid4;
doublereal diu1, diu2, div1, div2, sou1, sou2, sov1, sov2;
integer ncfhu = 0, ncfhv = 0, nuroo = 0, nvroo = 0, nd = 0, ii = 0, jj = 0, kk = 0, ll = 0, ibb = 0, kkm = 0,
llm = 0, kkp = 0, llp = 0;
doublereal bid1 = NAN, bid2 = NAN, bid3 = NAN, bid4 = NAN;
doublereal diu1 = NAN, diu2 = NAN, div1 = NAN, div2 = NAN, sou1 = NAN, sou2 = NAN, sov1 = NAN, sov2 = NAN;
/* **********************************************************************
*/
@@ -2665,17 +2667,17 @@ int mma2cd2_(integer *ndimen,
{
integer c__1 = 1;
/* System generated locals */
integer sotbv1_dim1, sotbv1_dim2, sotbv1_offset, sotbv2_dim1, sotbv2_dim2,
sotbv2_offset, ditbv1_dim1, ditbv1_dim2, ditbv1_offset,
ditbv2_dim1, ditbv2_dim2, ditbv2_offset, fpntab_dim1,
fpntab_offset, vhermt_dim1, vhermt_offset, sosotb_dim1,
sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2,
diditb_offset, soditb_dim1, soditb_dim2, soditb_offset,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
integer sotbv1_dim1 = 0, sotbv1_dim2 = 0, sotbv1_offset = 0, sotbv2_dim1 = 0, sotbv2_dim2 = 0,
sotbv2_offset = 0, ditbv1_dim1 = 0, ditbv1_dim2 = 0, ditbv1_offset = 0,
ditbv2_dim1 = 0, ditbv2_dim2 = 0, ditbv2_offset = 0, fpntab_dim1 = 0,
fpntab_offset = 0, vhermt_dim1 = 0, vhermt_offset = 0, sosotb_dim1 = 0,
sosotb_dim2 = 0, sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0,
diditb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
disotb_dim1 = 0, disotb_dim2 = 0, disotb_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0;
/* Local variables */
integer ncfhv, nuroo, nvroo, ii, nd, jj, kk, ibb, jjm, jjp;
doublereal bid1, bid2, bid3, bid4;
integer ncfhv = 0, nuroo = 0, nvroo = 0, ii = 0, nd = 0, jj = 0, kk = 0, ibb = 0, jjm = 0, jjp = 0;
doublereal bid1 = NAN, bid2 = NAN, bid3 = NAN, bid4 = NAN;
/* **********************************************************************
*/
@@ -2978,17 +2980,17 @@ int mma2cd3_(integer *ndimen,
integer c__1 = 1;
/* System generated locals */
integer sotbu1_dim1, sotbu1_dim2, sotbu1_offset, sotbu2_dim1, sotbu2_dim2,
sotbu2_offset, ditbu1_dim1, ditbu1_dim2, ditbu1_offset,
ditbu2_dim1, ditbu2_dim2, ditbu2_offset, fpntab_dim1,
fpntab_offset, uhermt_dim1, uhermt_offset, sosotb_dim1,
sosotb_dim2, sosotb_offset, diditb_dim1, diditb_dim2,
diditb_offset, soditb_dim1, soditb_dim2, soditb_offset,
disotb_dim1, disotb_dim2, disotb_offset, i__1, i__2, i__3, i__4;
integer sotbu1_dim1 = 0, sotbu1_dim2 = 0, sotbu1_offset = 0, sotbu2_dim1 = 0, sotbu2_dim2 = 0,
sotbu2_offset = 0, ditbu1_dim1 = 0, ditbu1_dim2 = 0, ditbu1_offset = 0,
ditbu2_dim1 = 0, ditbu2_dim2 = 0, ditbu2_offset = 0, fpntab_dim1 = 0,
fpntab_offset = 0, uhermt_dim1 = 0, uhermt_offset = 0, sosotb_dim1 = 0,
sosotb_dim2 = 0, sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0,
diditb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
disotb_dim1 = 0, disotb_dim2 = 0, disotb_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0;
/* Local variables */
integer ncfhu, nuroo, nvroo, ii, nd, jj, kk, ibb, kkm, kkp;
doublereal bid1, bid2, bid3, bid4;
integer ncfhu = 0, nuroo = 0, nvroo = 0, ii = 0, nd = 0, jj = 0, kk = 0, ibb = 0, kkm = 0, kkp = 0;
doublereal bid1 = NAN, bid2 = NAN, bid3 = NAN, bid4 = NAN;
/* **********************************************************************
*/
@@ -3304,22 +3306,22 @@ int AdvApp2Var_ApproxF2var::mma2cdi_( integer *ndimen,
integer c__8 = 8;
/* System generated locals */
integer contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
contr2_offset, contr3_dim1, contr3_dim2, contr3_offset,
contr4_dim1, contr4_dim2, contr4_offset, sosotb_dim1, sosotb_dim2,
sosotb_offset, diditb_dim1, diditb_dim2, diditb_offset,
soditb_dim1, soditb_dim2, soditb_offset, disotb_dim1, disotb_dim2,
disotb_offset;
integer contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0,
contr2_offset = 0, contr3_dim1 = 0, contr3_dim2 = 0, contr3_offset = 0,
contr4_dim1 = 0, contr4_dim2 = 0, contr4_offset = 0, sosotb_dim1 = 0, sosotb_dim2 = 0,
sosotb_offset = 0, diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0,
soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0,
disotb_offset = 0;
/* Local variables */
integer ilong;
intptr_t iofwr;
integer ilong = 0;
intptr_t iofwr = 0;
doublereal* wrkar = 0;
doublereal* wrkar_off;
integer iszwr;
integer ibb, ier = 0;
integer isz1, isz2, isz3, isz4;
intptr_t ipt1, ipt2, ipt3;
doublereal* wrkar_off = nullptr;
integer iszwr = 0;
integer ibb = 0, ier = 0;
integer isz1 = 0, isz2 = 0, isz3 = 0, isz4 = 0;
intptr_t ipt1 = 0, ipt2 = 0, ipt3 = 0;
@@ -3621,20 +3623,20 @@ int AdvApp2Var_ApproxF2var::mma2ce1_(integer *numdec,
integer c__8 = 8;
/* System generated locals */
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
disotb_offset, soditb_dim1, soditb_dim2, soditb_offset,
diditb_dim1, diditb_dim2, diditb_offset, patjac_dim1, patjac_dim2,
patjac_offset;
integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0,
disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0,
patjac_offset = 0;
/* Local variables */
logical ldbg;
intptr_t iofwr;
logical ldbg = 0;
intptr_t iofwr = 0;
doublereal* wrkar = 0;
doublereal* wrkar_off;
integer iszwr;
integer ier;
integer isz1, isz2, isz3, isz4, isz5, isz6, isz7;
intptr_t ipt1, ipt2, ipt3, ipt4, ipt5, ipt6;
doublereal* wrkar_off = nullptr;
integer iszwr = 0;
integer ier = 0;
integer isz1 = 0, isz2 = 0, isz3 = 0, isz4 = 0, isz5 = 0, isz6 = 0, isz7 = 0;
intptr_t ipt1 = 0, ipt2 = 0, ipt3 = 0, ipt4 = 0, ipt5 = 0, ipt6 = 0;
@@ -3902,20 +3904,20 @@ int mma2ce2_(integer *numdec,
{
/* System generated locals */
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
disotb_offset, soditb_dim1, soditb_dim2, soditb_offset,
diditb_dim1, diditb_dim2, diditb_offset, gssutb_dim1, gssvtb_dim1,
chpair_dim1, chpair_dim2, chpair_offset, chimpr_dim1,
chimpr_dim2, chimpr_offset, patjac_dim1, patjac_dim2,
patjac_offset, vecerr_dim1, vecerr_offset, i__1, i__2, i__3, i__4;
integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0,
disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, gssutb_dim1 = 0, gssvtb_dim1 = 0,
chpair_dim1 = 0, chpair_dim2 = 0, chpair_offset = 0, chimpr_dim1 = 0,
chimpr_dim2 = 0, chimpr_offset = 0, patjac_dim1 = 0, patjac_dim2 = 0,
patjac_offset = 0, vecerr_dim1 = 0, vecerr_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0;
/* Local variables */
logical ldbg;
integer idim, igsu, minu, minv, maxu, maxv, igsv;
logical ldbg = 0;
integer idim = 0, igsu = 0, minu = 0, minv = 0, maxu = 0, maxv = 0, igsv = 0;
doublereal vaux[3];
integer i2rdu, i2rdv, ndses, nd, ii, jj, kk, nu, nv;
doublereal zu, zv;
integer nu1, nv1;
integer i2rdu = 0, i2rdv = 0, ndses = 0, nd = 0, ii = 0, jj = 0, kk = 0, nu = 0, nv = 0;
doublereal zu = NAN, zv = NAN;
integer nu1 = 0, nv1 = 0;
/* **********************************************************************
*/
@@ -4671,13 +4673,13 @@ int mma2cfu_(integer *ndujac,
{
/* System generated locals */
integer sosotb_dim1, disotb_dim1, disotb_offset, soditb_dim1,
soditb_offset, diditb_dim1, i__1, i__2;
integer sosotb_dim1 = 0, disotb_dim1 = 0, disotb_offset = 0, soditb_dim1 = 0,
soditb_offset = 0, diditb_dim1 = 0, i__1 = 0, i__2 = 0;
/* Local variables */
logical ldbg;
integer nptu2, nptv2, ii, jj;
doublereal bid0, bid1, bid2;
logical ldbg = 0;
integer nptu2 = 0, nptv2 = 0, ii = 0, jj = 0;
doublereal bid0 = NAN, bid1 = NAN, bid2 = NAN;
/* **********************************************************************
*/
@@ -4887,13 +4889,13 @@ int mma2cfv_(integer *ndvjac,
{
/* System generated locals */
integer chpair_dim1, chpair_offset, chimpr_dim1, chimpr_offset,
patjac_offset, i__1, i__2;
integer chpair_dim1 = 0, chpair_offset = 0, chimpr_dim1 = 0, chimpr_offset = 0,
patjac_offset = 0, i__1 = 0, i__2 = 0;
/* Local variables */
logical ldbg;
integer nptv2, ii, jj;
doublereal bid1;
logical ldbg = 0;
integer nptv2 = 0, ii = 0, jj = 0;
doublereal bid1 = NAN;
/* **********************************************************************
*/
@@ -5043,15 +5045,15 @@ int AdvApp2Var_ApproxF2var::mma2ds1_(integer *ndimen,
{
/* System generated locals */
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
disotb_offset, soditb_dim1, soditb_dim2, soditb_offset,
diditb_dim1, diditb_dim2, diditb_offset, fpntab_dim1,
fpntab_offset, i__1;
integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0,
disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, fpntab_dim1 = 0,
fpntab_offset = 0, i__1 = 0;
/* Local variables */
logical ldbg;
integer ibid1, ibid2, iuouv, nd;
integer isz1, isz2;
logical ldbg = 0;
integer ibid1 = 0, ibid2 = 0, iuouv = 0, nd = 0;
integer isz1 = 0, isz2 = 0;
/* **********************************************************************
*/
@@ -5364,18 +5366,18 @@ int mma2ds2_(integer *ndimen,
{
integer c__0 = 0;
/* System generated locals */
integer sosotb_dim1, sosotb_dim2, sosotb_offset, disotb_dim1, disotb_dim2,
disotb_offset, soditb_dim1, soditb_dim2, soditb_offset,
diditb_dim1, diditb_dim2, diditb_offset, fpntab_dim1,
fpntab_offset, i__1, i__2, i__3;
integer sosotb_dim1 = 0, sosotb_dim2 = 0, sosotb_offset = 0, disotb_dim1 = 0, disotb_dim2 = 0,
disotb_offset = 0, soditb_dim1 = 0, soditb_dim2 = 0, soditb_offset = 0,
diditb_dim1 = 0, diditb_dim2 = 0, diditb_offset = 0, fpntab_dim1 = 0,
fpntab_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0;
/* Local variables */
integer jdec;
logical ldbg;
doublereal alinu, blinu, alinv, blinv, tcons;
integer jdec = 0;
logical ldbg = 0;
doublereal alinu = NAN, blinu = NAN, alinv = NAN, blinv = NAN, tcons = NAN;
doublereal dbfn1[2], dbfn2[2];
integer nuroo, nvroo, id, iu, iv;
doublereal um, up;
integer nuroo = 0, nvroo = 0, id = 0, iu = 0, iv = 0;
doublereal um = NAN, up = NAN;
/* **********************************************************************
@@ -5742,15 +5744,15 @@ int mma2er1_(integer *ndjacu,
{
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3;
doublereal d__1;
integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0;
doublereal d__1 = NAN;
/* Local variables */
logical ldbg;
integer minu, minv;
logical ldbg = 0;
integer minu = 0, minv = 0;
doublereal vaux[2];
integer ii, nd, jj;
doublereal bid0, bid1;
integer ii = 0, nd = 0, jj = 0;
doublereal bid0 = NAN, bid1 = NAN;
/* **********************************************************************
*/
@@ -5908,16 +5910,16 @@ int mma2er2_(integer *ndjacu,
{
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2;
doublereal d__1;
integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0;
doublereal d__1 = NAN;
/* Local variables */
logical ldbg;
logical ldbg = 0;
doublereal vaux[2];
integer i2rdu, i2rdv;
doublereal errnu, errnv;
integer ii, nd, jj, nu, nv;
doublereal bid0, bid1;
integer i2rdu = 0, i2rdv = 0;
doublereal errnu = NAN, errnv = NAN;
integer ii = 0, nd = 0, jj = 0, nu = 0, nv = 0;
doublereal bid0 = NAN, bid1 = NAN;
/* **********************************************************************
*/
@@ -6155,31 +6157,31 @@ int AdvApp2Var_ApproxF2var::mma2fnc_(integer *ndimen,
integer c__8 = 8;
/* System generated locals */
integer courbe_dim1, courbe_dim2, courbe_offset, somtab_dim1, somtab_dim2,
somtab_offset, diftab_dim1, diftab_dim2, diftab_offset,
contr1_dim1, contr1_dim2, contr1_offset, contr2_dim1, contr2_dim2,
contr2_offset, errmax_dim1, errmax_offset, errmoy_dim1,
errmoy_offset, i__1;
doublereal d__1;
integer courbe_dim1 = 0, courbe_dim2 = 0, courbe_offset = 0, somtab_dim1 = 0, somtab_dim2 = 0,
somtab_offset = 0, diftab_dim1 = 0, diftab_dim2 = 0, diftab_offset = 0,
contr1_dim1 = 0, contr1_dim2 = 0, contr1_offset = 0, contr2_dim1 = 0, contr2_dim2 = 0,
contr2_offset = 0, errmax_dim1 = 0, errmax_offset = 0, errmoy_dim1 = 0,
errmoy_offset = 0, i__1 = 0;
doublereal d__1 = NAN;
/* Local variables */
integer ideb;
doublereal tmil;
integer ideb1, ibid1, ibid2, ncfja, ndgre, ilong,
ndwrk;
integer ideb = 0;
doublereal tmil = NAN;
integer ideb1 = 0, ibid1 = 0, ibid2 = 0, ncfja = 0, ndgre = 0, ilong = 0,
ndwrk = 0;
doublereal* wrkar = 0;
doublereal* wrkar_off;
integer nupil;
intptr_t iofwr;
doublereal* wrkar_off = nullptr;
integer nupil = 0;
intptr_t iofwr = 0;
doublereal uvpav[4] /* was [2][2] */;
integer nd, ii;
integer ibb;
integer nd = 0, ii = 0;
integer ibb = 0;
integer ier = 0;
doublereal uv11[4] /* was [2][2] */;
integer ncb1;
doublereal eps3;
integer isz1, isz2, isz3, isz4, isz5;
intptr_t ipt1, ipt2, ipt3, ipt4,iptt, jptt;
integer ncb1 = 0;
doublereal eps3 = NAN;
integer isz1 = 0, isz2 = 0, isz3 = 0, isz4 = 0, isz5 = 0;
intptr_t ipt1 = 0, ipt2 = 0, ipt3 = 0, ipt4 = 0,iptt = 0, jptt = 0;
/* **********************************************************************
*/
@@ -6707,16 +6709,16 @@ int AdvApp2Var_ApproxF2var::mma2fx6_(integer *ncfmxu,
{
/* System generated locals */
integer epsfro_dim1, epsfro_offset, patcan_dim1, patcan_dim2, patcan_dim3,
patcan_dim4, patcan_offset, errmax_dim1, errmax_dim2,
errmax_offset, ncoefu_dim1, ncoefu_offset, ncoefv_dim1,
ncoefv_offset, i__1, i__2, i__3, i__4, i__5;
doublereal d__1, d__2;
integer epsfro_dim1 = 0, epsfro_offset = 0, patcan_dim1 = 0, patcan_dim2 = 0, patcan_dim3 = 0,
patcan_dim4 = 0, patcan_offset = 0, errmax_dim1 = 0, errmax_dim2 = 0,
errmax_offset = 0, ncoefu_dim1 = 0, ncoefu_offset = 0, ncoefv_dim1 = 0,
ncoefv_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0, i__4 = 0, i__5 = 0;
doublereal d__1 = NAN, d__2 = NAN;
/* Local variables */
integer idim, ncfu, ncfv, id, ii, nd, jj, ku, kv, ns, ibb;
doublereal bid;
doublereal tol;
integer idim = 0, ncfu = 0, ncfv = 0, id = 0, ii = 0, nd = 0, jj = 0, ku = 0, kv = 0, ns = 0, ibb = 0;
doublereal bid = NAN;
doublereal tol = NAN;
/* **********************************************************************
*/
@@ -7142,12 +7144,12 @@ int AdvApp2Var_ApproxF2var::mma2jmx_(integer *ndgjac,
2.71238965987606292679677228666411 };
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Local variables */
logical ldbg;
integer numax, ii;
doublereal bid;
logical ldbg = 0;
integer numax = 0, ii = 0;
doublereal bid = NAN;
/* **********************************************************************
@@ -7246,12 +7248,12 @@ int mma2moy_(integer *ndgumx,
doublereal *errmoy)
{
/* System generated locals */
integer patjac_dim1, patjac_dim2, patjac_offset, i__1, i__2, i__3;
integer patjac_dim1 = 0, patjac_dim2 = 0, patjac_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0;
/* Local variables */
logical ldbg;
integer minu, minv, idebu, idebv, ii, nd, jj;
doublereal bid0, bid1;
logical ldbg = 0;
integer minu = 0, minv = 0, idebu = 0, idebv = 0, ii = 0, nd = 0, jj = 0;
doublereal bid0 = NAN, bid1 = NAN;
/* **********************************************************************
@@ -7393,10 +7395,10 @@ int AdvApp2Var_ApproxF2var::mma2roo_(integer *nbpntu,
doublereal *vrootl)
{
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Local variables */
integer ii, ibb;
integer ii = 0, ibb = 0;
/* **********************************************************************
*/
@@ -7498,13 +7500,13 @@ int mmmapcoe_(integer *ndim,
{
/* System generated locals */
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
crvjac_dim1, crvjac_offset, gsstab_dim1, i__1, i__2, i__3;
integer somtab_dim1 = 0, somtab_offset = 0, diftab_dim1 = 0, diftab_offset = 0,
crvjac_dim1 = 0, crvjac_offset = 0, gsstab_dim1 = 0, i__1 = 0, i__2 = 0, i__3 = 0;
/* Local variables */
integer igss, ikdeb;
doublereal bidon;
integer nd, ik, ir, nbroot, ibb;
integer igss = 0, ikdeb = 0;
doublereal bidon = NAN;
integer nd = 0, ik = 0, ir = 0, nbroot = 0, ibb = 0;
/* **********************************************************************
*/
@@ -7660,12 +7662,12 @@ int mmaperm_(integer *ncofmx,
doublereal *errmoy)
{
/* System generated locals */
integer crvjac_dim1, crvjac_offset, i__1, i__2;
integer crvjac_dim1 = 0, crvjac_offset = 0, i__1 = 0, i__2 = 0;
/* Local variables */
doublereal bidj;
integer i__, ia, nd, ncfcut, ibb;
doublereal bid;
doublereal bidj = NAN;
integer i__ = 0, ia = 0, nd = 0, ncfcut = 0, ibb = 0;
doublereal bid = NAN;
/* **********************************************************************
*/
@@ -7769,10 +7771,10 @@ int AdvApp2Var_ApproxF2var::mmapptt_(const integer *ndgjac,
integer *iercod)
{
/* System generated locals */
integer cgauss_dim1, i__1;
integer cgauss_dim1 = 0, i__1 = 0;
/* Local variables */
integer kjac, iptt, ipdb0, infdg, iptdb, mxjac, ilong, ibb;
integer kjac = 0, iptt = 0, ipdb0 = 0, infdg = 0, iptdb = 0, mxjac = 0, ilong = 0, ibb = 0;
/* **********************************************************************
*/
@@ -8071,12 +8073,12 @@ int mmjacpt_(const integer *ndimen,
doublereal *ptccan)
{
/* System generated locals */
integer ptccan_dim1, ptccan_dim2, ptccan_offset, ptclgd_dim1, ptclgd_dim2,
ptclgd_offset, ptcaux_dim1, ptcaux_dim2, ptcaux_dim3,
ptcaux_offset, i__1, i__2, i__3;
integer ptccan_dim1 = 0, ptccan_dim2 = 0, ptccan_offset = 0, ptclgd_dim1 = 0, ptclgd_dim2 = 0,
ptclgd_offset = 0, ptcaux_dim1 = 0, ptcaux_dim2 = 0, ptcaux_dim3 = 0,
ptcaux_offset = 0, i__1 = 0, i__2 = 0, i__3 = 0;
/* Local variables */
integer kdim, nd, ii, jj, ibb;
integer kdim = 0, nd = 0, ii = 0, jj = 0, ibb = 0;
/* ***********************************************************************
*/

View File

@@ -15,6 +15,8 @@
// commercial license or contractual agreement.
#include <math.h>
#include <AdvApp2Var_ApproxF2var.hxx>
#include <AdvApp2Var_Context.hxx>
#include <Standard_ConstructionError.hxx>
@@ -108,7 +110,7 @@ myNb2DSS(nb2Dss),
myNb3DSS(nb3Dss)
{
Standard_Integer ErrorCode=0,NbPntU=0,JDegU=0,NbPntV=0,JDegV=0;
Standard_Integer ncfl;
Standard_Integer ncfl = 0;
// myNbURoot,myJDegU
ncfl = nlimu;
@@ -120,7 +122,7 @@ myJDegU = JDegU;
if (iu>-1) NbPntU = myNbURoot - 2;
// myJMaxU
Standard_Integer i,j,size = JDegU-2*iu-1;
Standard_Integer i = 0,j = 0,size = JDegU-2*iu-1;
Handle (TColStd_HArray1OfReal) JMaxU =
new TColStd_HArray1OfReal(1,size);
Standard_Real *JU_array =
@@ -223,7 +225,7 @@ for (j=1;j<=4;j++) {
}
}
if (iu>-1||iv>-1) {
Standard_Real tolmin, poids, hmax[4];
Standard_Real tolmin = NAN, poids = NAN, hmax[4];
hmax[0] = 0;
hmax[1] = 1;
hmax[2] = 1.5;

View File

@@ -45,11 +45,11 @@ AdvApp2Var_Framework::AdvApp2Var_Framework()
AdvApp2Var_Framework::AdvApp2Var_Framework(const AdvApp2Var_SequenceOfNode& Frame,
const AdvApp2Var_SequenceOfStrip& UFrontier,
const AdvApp2Var_SequenceOfStrip& VFrontier)
const AdvApp2Var_SequenceOfStrip& VFrontier) : myNodeConstraints(Frame), myUConstraints(UFrontier), myVConstraints(VFrontier)
{
myNodeConstraints = Frame;
myUConstraints = UFrontier;
myVConstraints = VFrontier;
}
//==========================================================================================
@@ -92,7 +92,7 @@ Standard_Integer AdvApp2Var_Framework::FirstNode(const GeomAbs_IsoType Type,
const Standard_Integer IndexIso,
const Standard_Integer IndexStrip) const
{
Standard_Integer NbIso,Index;
Standard_Integer NbIso = 0,Index = 0;
NbIso = myUConstraints.Length()+1;
if (Type==GeomAbs_IsoU) {
Index = NbIso * (IndexStrip-1) + IndexIso;
@@ -113,7 +113,7 @@ Standard_Integer AdvApp2Var_Framework::LastNode(const GeomAbs_IsoType Type,
const Standard_Integer IndexIso,
const Standard_Integer IndexStrip) const
{
Standard_Integer NbIso,Index;
Standard_Integer NbIso = 0,Index = 0;
NbIso = myUConstraints.Length()+1;
if (Type==GeomAbs_IsoU) {
Index = NbIso * IndexStrip + IndexIso;

View File

@@ -116,9 +116,9 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
AdvApp2Var_Node& NodeEnd)
{
// fixed values
Standard_Integer NBCRMX=1, NBCRBE;
Standard_Integer NBCRMX=1, NBCRBE = 0;
// data stored in the Context
Standard_Integer NDIMEN, NBSESP, NDIMSE;
Standard_Integer NDIMEN = 0, NBSESP = 0, NDIMSE = 0;
NDIMEN = Conditions.TotalDimension();
NBSESP = Conditions.TotalNumberSSP();
// Attention : works only in 3D
@@ -176,7 +176,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
// data relative to the position of iso (front or cut line)
Handle (TColStd_HArray1OfReal) HEPSAPR = new TColStd_HArray1OfReal(1,NBSESP);
Standard_Integer iesp;
Standard_Integer iesp = 0;
switch(myPosition) {
case 0 :
for (iesp=1;iesp<=NBSESP;iesp++) {
@@ -247,7 +247,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
// the approximations
//
Standard_Integer IERCOD=0, NCOEFF=0;
Standard_Integer iapp,ncfapp,ierapp;
Standard_Integer iapp = 0,ncfapp = 0,ierapp = 0;
// Standard_Integer id,ic,ideb;
for (iapp=0;iapp<=IDERIV;iapp++) {
// approximation of the derivative of order iapp
@@ -291,7 +291,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
if (NCOEFF<=ncfapp) NCOEFF=ncfapp;
if (ierapp==-1) IERCOD = -1;
// return constraints of order 0 to IORDRE of extremities
Standard_Integer ider, jpos=HCONTR1->Lower();
Standard_Integer ider = 0, jpos=HCONTR1->Lower();
for (ider=0; ider<=IORDRE;ider++) {
gp_Pnt pt(HCONTR1->Value(jpos),
HCONTR1->Value(jpos+1),

File diff suppressed because it is too large Load Diff

View File

@@ -39,11 +39,11 @@ AdvApp2Var_Network::AdvApp2Var_Network()
AdvApp2Var_Network::AdvApp2Var_Network(const AdvApp2Var_SequenceOfPatch& Net,
const TColStd_SequenceOfReal& TheU,
const TColStd_SequenceOfReal& TheV)
const TColStd_SequenceOfReal& TheV) : myNet(Net), myUParameters(TheU), myVParameters(TheV)
{
myNet=Net;
myUParameters=TheU;
myVParameters=TheV;
}
//==========================================================================================
@@ -75,7 +75,7 @@ void AdvApp2Var_Network::UpdateInU(const Standard_Real CuttingValue)
{
// insertion du nouveau parametre de decoupe
Standard_Integer i=1,j;
Standard_Integer i=1,j = 0;
while (myUParameters.Value(i)<CuttingValue) {
i++;
}

View File

@@ -22,6 +22,8 @@
// by: Joelle CHAUVET / Jean-Marc LACHAUME
// Initialisation de myCritValue pour OSF
#include <math.h>
#include <AdvApp2Var_ApproxF2var.hxx>
#include <AdvApp2Var_Context.hxx>
#include <AdvApp2Var_Criterion.hxx>
@@ -109,21 +111,21 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
{
// data stored in the Context
Standard_Integer NDIMEN, ISOFAV;
Standard_Integer NDIMEN = 0, ISOFAV = 0;
NDIMEN = Conditions.TotalDimension();
// Attention : works only for 3D
ISOFAV = Conditions.FavorIso();
// data related to the patch to be discretized
Standard_Integer NBPNTU, NBPNTV;
Standard_Integer NBPNTU = 0, NBPNTV = 0;
Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV;
Handle (TColStd_HArray1OfReal) HUROOT = Conditions.URoots();
Handle (TColStd_HArray1OfReal) HVROOT = Conditions.VRoots();
Standard_Real * UROOT;
Standard_Real * UROOT = nullptr;
UROOT = (Standard_Real *) &HUROOT ->ChangeArray1()(HUROOT ->Lower());
NBPNTU = (Conditions.URoots())->Length();
if (myOrdInU>-1) NBPNTU -= 2;
Standard_Real * VROOT;
Standard_Real * VROOT = nullptr;
VROOT = (Standard_Real *) &HVROOT ->ChangeArray1()(HVROOT ->Lower());
NBPNTV = (Conditions.VRoots())->Length();
if (myOrdInV>-1) NBPNTV -= 2;
@@ -135,8 +137,8 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
new TColStd_HArray1OfReal(1,SIZE*4);
HCOINS->Init(0.);
Standard_Integer iu,iv;
Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho,valnorm;
Standard_Integer iu = 0,iv = 0;
Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho = NAN,valnorm = NAN;
for (iu=0;iu<=myOrdInU;iu++) {
for (iv=0;iv<=myOrdInV;iv++) {
@@ -209,7 +211,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
( (Constraints.IsoU(myU1,myV0,myV1)).DifTab() ) ->Array1();
// normalization
Standard_Integer ideb1,ideb2,ideb3,ideb4,jj;
Standard_Integer ideb1 = 0,ideb2 = 0,ideb3 = 0,ideb4 = 0,jj = 0;
for (iu=1;iu<=IORDRU;iu++) {
rho = pow(du,iu);
ideb1 = HSU0->Lower() + iu*SIZE -1;
@@ -402,8 +404,8 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
const AdvApp2Var_Framework& Constraints)
{
// data stored in the Context
Standard_Integer NDIMEN;
Standard_Integer IERCOD, NCFLMU, NCFLMV, NDegU, NDegV;
Standard_Integer NDIMEN = 0;
Standard_Integer IERCOD = 0, NCFLMU = 0, NCFLMV = 0, NDegU = 0, NDegV = 0;
NDIMEN = Conditions.TotalDimension();
// Attention : works only for 3D
NCFLMU = Conditions.ULimit();
@@ -443,9 +445,9 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
HCFU1->Init( (Constraints.IsoU(myU1,myV0,myV1)).NbCoeff() );
// normalization of Isos U
Standard_Integer iu,iv;
Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho,valnorm;
Standard_Integer ideb0,ideb1,jj;
Standard_Integer iu = 0,iv = 0;
Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho = NAN,valnorm = NAN;
Standard_Integer ideb0 = 0,ideb1 = 0,jj = 0;
for (iu=1;iu<=IORDRU;iu++) {
rho = pow(du,iu);
@@ -532,7 +534,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
}
// add constraints at the corners
Standard_Integer ideb;
Standard_Integer ideb = 0;
SIZE=NDIMEN*(IORDRU+2)*(IORDRV+2);
Handle (TColStd_HArray1OfReal) HCOINS =
new TColStd_HArray1OfReal(1,SIZE*4);
@@ -590,8 +592,8 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
Standard_Real *FACT =
(Standard_Real *) &HFACT ->ChangeArray1()(HFACT ->Lower());
Standard_Integer idim,ncf0,ncf1,iun=1;
Standard_Real *Is;
Standard_Integer idim = 0,ncf0 = 0,ncf1 = 0,iun=1;
Standard_Real *Is = nullptr;
// add extremities of isos U
for (iu=1;iu<=IORDRU+1;iu++) {
@@ -656,10 +658,10 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
{
Standard_Integer NBSESP = 1, iesp;
Standard_Integer iu,iv;
Standard_Integer NBSESP = 1, iesp = 0;
Standard_Integer iu = 0,iv = 0;
Standard_Real errU,errV,error,hmax[4];
Standard_Real errU = NAN,errV = NAN,error = NAN,hmax[4];
hmax[0] = 0;
hmax[1] = 1;
hmax[2] = 1.5;
@@ -718,7 +720,7 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
((Constraints.IsoU(myU1,myV0,myV1)).MaxErrors())->Value(iesp,1));
// calculate max errors at the corners
Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1,err2,err3,err4;
Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1 = NAN,err2 = NAN,err3 = NAN,err4 = NAN;
for (iu=0;iu<=myOrdInU;iu++) {
for (iv=0;iv<=myOrdInV;iv++) {
error = (Constraints.Node(myU0,myV0))->Error(iu,iv);
@@ -766,9 +768,9 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
{
// data stored in the Context
Standard_Integer NDIMEN, NBSESP, NDIMSE;
Standard_Integer NBPNTU, NBPNTV, NCFLMU, NCFLMV, NDJACU, NDJACV;
Standard_Integer NDegU, NDegV, NJacU, NJacV;
Standard_Integer NDIMEN = 0, NBSESP = 0, NDIMSE = 0;
Standard_Integer NBPNTU = 0, NBPNTV = 0, NCFLMU = 0, NCFLMV = 0, NDJACU = 0, NDJACV = 0;
Standard_Integer NDegU = 0, NDegV = 0, NJacU = 0, NJacV = 0;
NDIMEN = Conditions.TotalDimension();
NBSESP = Conditions.TotalNumberSSP();
NDIMSE = 3;
@@ -787,7 +789,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
// data relative to the processed patch
Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV,
NDMINU = 1, NDMINV = 1, NCOEFU, NCOEFV;
NDMINU = 1, NDMINV = 1, NCOEFU = 0, NCOEFV = 0;
// NDMINU and NDMINV depend on the nb of coeff of neighboring isos
// and of the required order of continuity
NDMINU = Max(1,2*IORDRU+1);
@@ -807,7 +809,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
new TColStd_HArray1OfReal(1,NBSESP);
Handle (TColStd_HArray1OfReal) HEPSFRO =
new TColStd_HArray1OfReal(1,NBSESP*8);
Standard_Integer iesp;
Standard_Integer iesp = 0;
for (iesp=1;iesp<=NBSESP;iesp++) {
HEPSAPR->SetValue(iesp,(Conditions.IToler())->Value(iesp));
HEPSFRO->SetValue(iesp,(Conditions.FToler())->Value(iesp,1));
@@ -937,7 +939,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
&myNbCoeffInV);
// transposition (NCFLMU,NCFLMV,NDIMEN)Fortran-C++
Standard_Integer aIU, aIN, dim, ii, jj;
Standard_Integer aIU = 0, aIN = 0, dim = 0, ii = 0, jj = 0;
for (dim=1; dim<=NDIMEN; dim++){
aIN = (dim-1)*NCFLMU*NCFLMV;
for (ii=1; ii<=NCFLMU; ii++) {

View File

@@ -14,6 +14,7 @@
// AdvApp2Var_SysBase.cxx
#include <assert.h>
#include <cmath>
#include <math.h>
#include <string.h>
#include <AdvApp2Var_SysBase.hxx>
#include <AdvApp2Var_Data.hxx>
@@ -273,7 +274,7 @@ int AdvApp2Var_SysBase::macrai4_(integer *nbelem,
/* ***********************************************************************
*/
integer iunit;
integer iunit = 0;
iunit = sizeof(integer);
@@ -372,10 +373,10 @@ int macrbrk_()
int AdvApp2Var_SysBase::macrchk_()
{
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Local variables */
integer i__, j;
integer i__ = 0, j = 0;
/* ***********************************************************************
*/
@@ -557,7 +558,7 @@ int AdvApp2Var_SysBase::macrdi4_(integer *nbelem,
/* > */
/* ***********************************************************************
*/
integer iunit;
integer iunit = 0;
iunit = sizeof(integer);
/* Function Body */
@@ -713,7 +714,7 @@ int macrgfl_(intptr_t *iadfld,
integer ifois = 1;
char cbid[1] = {};
integer ibid, ienr;
integer ibid = 0, ienr = 0;
integer novfl = 0;
/* ***********************************************************************
@@ -849,7 +850,7 @@ int macrmsg_(const char *,//crout,
{
/* Local variables */
integer inum;
integer inum = 0;
char /*cfm[80],*/ cln[3];
/* ***********************************************************************
@@ -1152,7 +1153,7 @@ int magtlog_(const char *cnmlog,
/* Local variables */
char cbid[255];
integer ibid, ier;
integer ibid = 0, ier = 0;
/* **********************************************************************
@@ -1307,12 +1308,12 @@ int AdvApp2Var_SysBase::maitbr8_(integer *itaill,
};
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Local variables */
integer i__;
integer i__ = 0;
doublereal buffx[63];
integer nbfois, noffst, nreste, nufois;
integer nbfois = 0, noffst = 0, nreste = 0, nufois = 0;
/* ***********************************************************************
*/
@@ -1552,7 +1553,7 @@ int maostrb_()
//=======================================================================
int maostrd_()
{
integer imod;
integer imod = 0;
/* ***********************************************************************
*/
@@ -1615,12 +1616,12 @@ int maoverf_(integer *nbentr,
integer ifois = 0;
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Local variables */
integer ibid;
integer ibid = 0;
doublereal buff[63];
integer ioct, indic, nrest, icompt;
integer ioct = 0, indic = 0, nrest = 0, icompt = 0;
/* ***********************************************************************
*/
@@ -1789,7 +1790,7 @@ int maoverf_(integer *nbentr,
/* Loop. The upper limit is the integer value of the logarithm of base 2
*/
/* of NBENTR/NLONGR. */
i__1 = (integer) (log((real) (*nbentr) / (float)63.) / log((float)2.))
i__1 = (integer) (std::log((real) (*nbentr) / (float)63.) / std::log((float)2.))
;
for (ibid = 1; ibid <= i__1; ++ibid) {
@@ -1943,14 +1944,14 @@ int mcrcomm_(integer *kop,
integer ntab = 0;
/* System generated locals */
integer i__1, i__2;
integer i__1 = 0, i__2 = 0;
/* Local variables */
intptr_t ideb;
intptr_t ideb = 0;
doublereal dtab[32000];
intptr_t itab[160] /* was [4][40] */;
intptr_t ipre;
integer i__, j, k;
intptr_t ipre = 0;
integer i__ = 0, j = 0, k = 0;
/************************************************************************
@@ -2118,12 +2119,12 @@ int AdvApp2Var_SysBase::mcrdelt_(integer *iunit,
integer *iercod)
{
integer ibid;
doublereal xbid;
integer noct, iver, ksys, i__, n, nrang,
ibyte, ier;
intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/
integer kop;
integer ibid = 0;
doublereal xbid = NAN;
integer noct = 0, iver = 0, ksys = 0, i__ = 0, n = 0, nrang = 0,
ibyte = 0, ier = 0;
intptr_t iadfd = 0, iadff = 0, iaddr = 0, loc = 0; /* Les adrresses en long*/
integer kop = 0;
/* ***********************************************************************
*/
@@ -2516,14 +2517,14 @@ int AdvApp2Var_SysBase::mcrlist_(integer *ier) const
{
/* System generated locals */
integer i__1;
integer i__1 = 0;
/* Builtin functions */
/* Local variables */
char cfmt[1];
doublereal dfmt;
integer ifmt, i__, nufmt, ntotal;
doublereal dfmt = NAN;
integer ifmt = 0, i__ = 0, nufmt = 0, ntotal = 0;
char subrou[7];
@@ -2664,15 +2665,15 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
{
integer i__1, i__2;
integer i__1 = 0, i__2 = 0;
/* Local variables */
doublereal dfmt;
integer ifmt, iver;
doublereal dfmt = NAN;
integer ifmt = 0, iver = 0;
char subr[7];
integer ksys , ibyte, irest, ier;
intptr_t iadfd, iadff, iaddr,lofset, loc;
integer izu;
integer ksys = 0 , ibyte = 0, irest = 0, ier = 0;
intptr_t iadfd = 0, iadff = 0, iaddr = 0,lofset = 0, loc = 0;
integer izu = 0;
/* **********************************************************************
@@ -3064,7 +3065,7 @@ void AdvApp2Var_SysBase::miraz_(integer *taille,
//=======================================================================
integer AdvApp2Var_SysBase::mnfndeb_()
{
integer ret_val;
integer ret_val = 0;
ret_val = 0;
return ret_val;
} /* mnfndeb_ */
@@ -3077,7 +3078,7 @@ int AdvApp2Var_SysBase::msifill_(integer *nbintg,
integer *ivecin,
integer *ivecou)
{
integer nocte;
integer nocte = 0;
/* ***********************************************************************
*/
@@ -3132,7 +3133,7 @@ int AdvApp2Var_SysBase::msrfill_(integer *nbreel,
doublereal *vecent,
doublereal * vecsor)
{
integer nocte;
integer nocte = 0;
/* ***********************************************************************
@@ -3309,7 +3310,7 @@ void AdvApp2Var_SysBase::mvriraz_(integer *taille,
void *adt)
{
integer offset;
integer offset = 0;
offset = *taille * 8 ;
/* printf(" adt %d long %d\n",adt,offset); */
memset(adt , '\0' , offset) ;

View File

@@ -140,7 +140,7 @@ private:
mitem icore[MAX_ALLOC_NB];
integer ncore;
unsigned char lprot;
} mcrgene_;
} mcrgene_{};
/* Contains statistics on allocation requests.
Index 0 corresponds to static_allocation, 1 - to heap allocation.
@@ -151,7 +151,7 @@ private:
*/
struct {
integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
} mcrstac_;
} mcrstac_{};
};
#endif

View File

@@ -21,6 +21,8 @@
// facilement approchable ont de petites erreurs.
// Modified PMN 15/04/1997 : Gestion fine de la continuite aux lieux de decoupes
#include <math.h>
#include <AdvApprox_ApproxAFunction.hxx>
#include <AdvApprox_DichoCutting.hxx>
#include <AdvApprox_EvaluatorFunction.hxx>
@@ -138,13 +140,13 @@ static void PrepareConvert(const Standard_Integer NumCurves,
{
// Declaration
Standard_Boolean isCi;
Standard_Integer icurve, idim, iordre, ii,
Standard_Boolean isCi = 0;
Standard_Integer icurve = 0, idim = 0, iordre = 0, ii = 0,
Dimension=Num1DSS + 2*Num2DSS + 3*Num3DSS,
NbSpace = Num1DSS + Num2DSS + Num3DSS;
Standard_Real diff, moy, facteur1, facteur2, normal1, normal2, eps;
Standard_Real *Res1, *Res2, *Val1, *Val2;
Standard_Real *Coef1, *Coef2;
Standard_Real diff = NAN, moy = NAN, facteur1 = NAN, facteur2 = NAN, normal1 = NAN, normal2 = NAN, eps = NAN;
Standard_Real *Res1 = nullptr, *Res2 = nullptr, *Val1 = nullptr, *Val2 = nullptr;
Standard_Real *Coef1 = nullptr, *Coef2 = nullptr;
Standard_Integer RealDegree = Max(MaxDegree + 1, 2 * ContinuityOrder + 2);
gp_Vec V1,V2;
@@ -194,7 +196,7 @@ static void PrepareConvert(const Standard_Integer NumCurves,
Standard_Real f2_dividend = PolynomialIntervals(icurve+1,2)-PolynomialIntervals(icurve+1,1);
Standard_Real f1_divizor = TrueIntervals(icurve+1)-TrueIntervals(icurve);
Standard_Real f2_divizor = TrueIntervals(icurve+2)-TrueIntervals(icurve+1);
Standard_Real fract1, fract2;
Standard_Real fract1 = NAN, fract2 = NAN;
if( Abs(f1_divizor) < Toler ) // this is to avoid divizion by zero
//in this case fract1 = 5.14755758946803e-85
@@ -419,7 +421,7 @@ void AdvApprox_ApproxAFunction::Approximation(
Standard_Integer& ErrorCode)
{
// Standard_Real EpsPar = Precision::Confusion();
Standard_Integer IDIM, NUPIL,TheDeg;
Standard_Integer IDIM = 0, NUPIL = 0,TheDeg = 0;
#ifdef OCCT_DEBUG
Standard_Integer NDIMEN = TotalDimension;
#endif
@@ -465,7 +467,7 @@ void AdvApprox_ApproxAFunction::Approximation(
//--> NDJAC est le degre de "travail" dans la base orthogonale.
Standard_Integer NbGaussPoints, WorkDegree;
Standard_Integer NbGaussPoints = 0, WorkDegree = 0;
PLib::JacobiParameters(Continuity, NumMaxCoeffs-1, code_precis,
NbGaussPoints, WorkDegree);
@@ -483,8 +485,8 @@ void AdvApprox_ApproxAFunction::Approximation(
//C**********************************************************************
Handle(PLib_JacobiPolynomial) JacobiBase = new (PLib_JacobiPolynomial) (WorkDegree, Continuity);
//Portage HP le compilateur refuse le debranchement
Standard_Integer IS ;
Standard_Boolean goto_fin_de_boucle;
Standard_Integer IS = 0 ;
Standard_Boolean goto_fin_de_boucle = 0;
Standard_Integer MaxDegree = NumMaxCoeffs-1;
AdvApprox_SimpleApprox Approx (TotalDimension, TotalNumSS,
Continuity,
@@ -531,8 +533,8 @@ void AdvApprox_ApproxAFunction::Approximation(
else
{
//-> ...sinon on essai de decouper l' intervalle courant en 2...
Standard_Real TMIL;
Standard_Boolean Large;
Standard_Real TMIL = NAN;
Standard_Boolean Large = 0;
Large = CutTool.Value(TABINT[NumCurves], TABINT[NumCurves+1],
TMIL);
@@ -581,7 +583,7 @@ void AdvApprox_ApproxAFunction::Approximation(
TColStd_Array1OfReal Coefficients(0,(TheDeg+1)*TotalDimension-1);
JacobiBase->ToCoefficients (TotalDimension, TheDeg,
HJacCoeff->Array1(), Coefficients);
Standard_Integer i,j, f = (TheDeg+1)*TotalDimension;
Standard_Integer i = 0,j = 0, f = (TheDeg+1)*TotalDimension;
for (i=0,j=(NumCurves-1)*TotalDimension*NumMaxCoeffs+1;
i<f; i++, j++) {
CoefficientArray.SetValue(j, Coefficients.Value(i));
@@ -693,15 +695,15 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS,
myNumSubSpaces[2] = Num3DSS ;
Standard_Integer TotalNumSS =
Num1DSS + Num2DSS + Num3DSS,
ii,
jj,
kk,
index,
dim_index,
local_index;
ii = 0,
jj = 0,
kk = 0,
index = 0,
dim_index = 0,
local_index = 0;
Standard_Integer TotalDimension =
myNumSubSpaces[0] + 2 * myNumSubSpaces[1] + 3 * myNumSubSpaces[2] ;
Standard_Real error_value ;
Standard_Real error_value = NAN ;
Standard_Integer ContinuityOrder=0 ;
switch (myContinuity) {
@@ -754,7 +756,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS,
//
Standard_Integer ErrorCode = 0,
NumCurves,
NumCurves = 0,
size =
myMaxSegments * NumMaxCoeffs * TotalDimension ;
Handle(TColStd_HArray1OfInteger) NumCoeffPerCurvePtr =
@@ -961,7 +963,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS,
void AdvApprox_ApproxAFunction::Poles(const Standard_Integer Index,
TColgp_Array1OfPnt& P) const
{
Standard_Integer ii ;
Standard_Integer ii = 0 ;
for (ii = P.Lower() ; ii <= P.Upper() ; ii++) {
P.SetValue(ii,my3DPoles->Value(ii,Index)) ;
}
@@ -987,7 +989,7 @@ Standard_Integer AdvApprox_ApproxAFunction::NbPoles() const
void AdvApprox_ApproxAFunction::Poles2d(const Standard_Integer Index,
TColgp_Array1OfPnt2d& P) const
{
Standard_Integer ii ;
Standard_Integer ii = 0 ;
for (ii = P.Lower() ; ii <= P.Upper() ; ii++) {
P.SetValue(ii,my2DPoles->Value(ii,Index)) ;
}
@@ -1000,7 +1002,7 @@ void AdvApprox_ApproxAFunction::Poles2d(const Standard_Integer Index,
void AdvApprox_ApproxAFunction::Poles1d(const Standard_Integer Index,
TColStd_Array1OfReal& P) const
{
Standard_Integer ii ;
Standard_Integer ii = 0 ;
for (ii = P.Lower() ; ii <= P.Upper() ; ii++) {
P.SetValue(ii,my1DPoles->Value(ii,Index)) ;
}
@@ -1089,7 +1091,7 @@ Standard_Real AdvApprox_ApproxAFunction::AverageError(
void AdvApprox_ApproxAFunction::Dump(Standard_OStream& o) const
{
Standard_Integer ii;
Standard_Integer ii = 0;
o << "Dump of ApproxAFunction" << std::endl;
if (myNumSubSpaces[0] > 0) {
o << "Error(s) 1d = " << std::endl;

View File

@@ -138,7 +138,7 @@ private:
Standard_EXPORT void Perform (const Standard_Integer Num1DSS, const Standard_Integer Num2DSS, const Standard_Integer Num3DSS, const AdvApprox_Cutting& CutTool);
Standard_Integer myNumSubSpaces[3];
Standard_Integer myNumSubSpaces[3]{};
Handle(TColStd_HArray1OfReal) my1DTolerances;
Handle(TColStd_HArray1OfReal) my2DTolerances;
Handle(TColStd_HArray1OfReal) my3DTolerances;
@@ -154,7 +154,7 @@ private:
Handle(TColgp_HArray2OfPnt) my3DPoles;
Handle(TColStd_HArray1OfReal) myKnots;
Handle(TColStd_HArray1OfInteger) myMults;
Standard_Integer myDegree;
Standard_Integer myDegree{};
Standard_Address myEvaluator;
Handle(TColStd_HArray1OfReal) my1DMaxError;
Handle(TColStd_HArray1OfReal) my1DAverageError;

View File

@@ -15,6 +15,8 @@
// commercial license or contractual agreement.
#include <math.h>
#include <AdvApprox_PrefAndRec.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
@@ -22,12 +24,10 @@
AdvApprox_PrefAndRec::AdvApprox_PrefAndRec(const TColStd_Array1OfReal& RecCut,
const TColStd_Array1OfReal& PrefCut,
const Standard_Real Weight):
myRecCutting(1, RecCut.Length()),
myPrefCutting(1, PrefCut.Length()),
myRecCutting(RecCut),
myPrefCutting(PrefCut),
myWeight(Weight)
{
myRecCutting = RecCut;
myPrefCutting = PrefCut;
if (myWeight <= 1) { throw Standard_DomainError("PrefAndRec : Weight is too small");}
}
@@ -37,8 +37,8 @@ Standard_Boolean AdvApprox_PrefAndRec::Value(const Standard_Real a,
{
// longueur minimum d'un intervalle parametrique : 10*PConfusion()
Standard_Real lgmin = 10 * Precision::PConfusion();
Standard_Integer i;
Standard_Real cut, mil=(a+b)/2, dist;
Standard_Integer i = 0;
Standard_Real cut = NAN, mil=(a+b)/2, dist = NAN;
Standard_Boolean isfound = Standard_False;
cut = mil;

View File

@@ -15,14 +15,14 @@
// commercial license or contractual agreement.
#include <math.h>
#include <AdvApprox_PrefCutting.hxx>
#include <Precision.hxx>
AdvApprox_PrefCutting::AdvApprox_PrefCutting(const TColStd_Array1OfReal& CutPnts):
myPntOfCutting(1, CutPnts.Length())
{
myPntOfCutting = CutPnts;
}
myPntOfCutting(CutPnts)
{}
Standard_Boolean AdvApprox_PrefCutting::Value(const Standard_Real a,
const Standard_Real b,
@@ -31,8 +31,8 @@ Standard_Boolean AdvApprox_PrefCutting::Value(const Standard_Real a,
// longueur minimum d'un intervalle parametrique : PConfusion()
// pour F(U,V) : EPS1=1.e-9 (cf.MMEPS1)
Standard_Real lgmin = 10 * Precision::PConfusion();
Standard_Integer i;
Standard_Real cut, mil=(a+b)/2,
Standard_Integer i = 0;
Standard_Real cut = NAN, mil=(a+b)/2,
dist = Abs((a-b)/2);
cut = mil;
for ( i=myPntOfCutting.Lower(); i<= myPntOfCutting.Upper(); i++) {

View File

@@ -16,6 +16,8 @@
#define No_Standard_OutOfRange
#include <math.h>
#include <AdvApprox_EvaluatorFunction.hxx>
#include <AdvApprox_SimpleApprox.hxx>
#include <math_Vector.hxx>
@@ -90,7 +92,7 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi
// ======= the computation of Pp(t) = Rr(t) + W(t)*Qq(t) =======
done = Standard_False;
Standard_Integer i,idim,k,numss;
Standard_Integer i = 0,idim = 0,k = 0,numss = 0;
Standard_Integer Dimension = myTotalDimension;
AdvApprox_EvaluatorFunction& Evaluator =
@@ -106,10 +108,10 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi
FirstLast[1] = Last;
math_Vector Result(1,myTotalDimension);
Standard_Integer ErrorCode,derive,i_idim;
Standard_Integer ErrorCode = 0,derive = 0,i_idim = 0;
Standard_Real Fact=(Last-First)/2;
Standard_Real *pResult = (Standard_Real*) &Result.Value(1);
Standard_Real param;
Standard_Real param = NAN;
for (param = First, derive = myNivConstr;
derive >= 0 ; derive--) {
@@ -148,7 +150,7 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi
Standard_Real* Coef1 = (Standard_Real*) &(myCoeff->ChangeArray1().Value(0));
derive = 0;
Standard_Real ti, tip, tin, alin = (Last-First)/2, blin = (Last+First)/2.;
Standard_Real ti = NAN, tip = NAN, tin = NAN, alin = (Last-First)/2, blin = (Last+First)/2.;
i_idim = myTotalDimension;
for (i=1; i<=myNbGaussPoints/2; i++) {
@@ -234,8 +236,8 @@ void AdvApprox_SimpleApprox::Perform(const TColStd_Array1OfInteger& LocalDimensi
// the computing of NewDegree
TColStd_Array1OfReal JacCoeff(0, myTotalDimension*(myWorkDegree+1)-1);
Standard_Real MaxErr,AverageErr;
Standard_Integer Dim, RangSS, RangCoeff, RangJacCoeff, RangDim, NewDegree, NewDegreeMax = 0;
Standard_Real MaxErr = NAN,AverageErr = NAN;
Standard_Integer Dim = 0, RangSS = 0, RangCoeff = 0, RangJacCoeff = 0, RangDim = 0, NewDegree = 0, NewDegreeMax = 0;
myMaxError = new TColStd_HArray1OfReal (1,myTotalNumSS);
myAverageError = new TColStd_HArray1OfReal (1,myTotalNumSS);
@@ -377,7 +379,7 @@ Standard_Real AdvApprox_SimpleApprox::AverageError(const Standard_Integer Index)
void AdvApprox_SimpleApprox::Dump(Standard_OStream& o) const
{
Standard_Integer ii;
Standard_Integer ii = 0;
o << "Dump of SimpleApprox " << std::endl;
for (ii=1; ii <= myTotalNumSS; ii++) {
o << "Error " << MaxError(ii) << std::endl;

View File

@@ -101,7 +101,7 @@ private:
Handle(TColStd_HArray1OfReal) myTabPoints;
Handle(TColStd_HArray2OfReal) myTabWeights;
Standard_Address myEvaluator;
Standard_Integer myDegree;
Standard_Integer myDegree{};
Handle(TColStd_HArray1OfReal) myCoeff;
Handle(TColStd_HArray2OfReal) myFirstConstr;
Handle(TColStd_HArray2OfReal) myLastConstr;

View File

@@ -2070,7 +2070,7 @@ void InvMMatrix(const Standard_Integer classe,
math_Matrix& InvM)
{
if (classe > 24) throw Standard_DimensionError("InvMMatrix: classe > 24");
Standard_Integer i, j, k = 0, Som = 0;
Standard_Integer i = 0, j = 0, k = 0, Som = 0;
for (i = 2; i < classe; i++) {
Som += (i)*(i);
}

View File

@@ -416,7 +416,7 @@ void IBPMatrix(const Standard_Integer classe, math_Matrix& IBPMa)
{
if (classe > 26) throw Standard_DimensionError("IBPMatrix: classe > 26");
// math_Matrix IBPMa(1, classe-2, 1, classe-2);
Standard_Integer i, j, k = 0, Som = 0;
Standard_Integer i = 0, j = 0, k = 0, Som = 0;
for (i = 1; i < classe-2; i++) {
Som += (i)*(i);
}

View File

@@ -3277,7 +3277,7 @@ void MMatrix(const Standard_Integer classe,
math_Matrix& M)
{
if (classe > 24) throw Standard_DimensionError("MMatrix: classe > 24");
Standard_Integer i, j, k = 0, Som = 0;
Standard_Integer i = 0, j = 0, k = 0, Som = 0;
for (i = 2; i < classe; i++) {
Som += (i)*(i);
}

View File

@@ -354,7 +354,7 @@ void IBTMatrix(const Standard_Integer classe, math_Matrix& IBTMa)
{
if (classe > 26) throw Standard_DimensionError("IBTMatrix: classe > 26");
// math_Matrix IBTMa(1, classe-4, 1, classe-4);
Standard_Integer i, j, k = 0, Som = 0;
Standard_Integer i = 0, j = 0, k = 0, Som = 0;
for (i = 1; i < classe-4; i++) {
Som += (i)*(i);
}

View File

@@ -1238,11 +1238,11 @@ void VBernstein(const Standard_Integer classe,
if (nbpoints > 24) throw Standard_DimensionError("VBernstein: nbpoints > 24");
// math_Matrix VB(classe, nbpoints);
Standard_Integer i, j, k = 0, Som;
Standard_Integer i = 0, j = 0, k = 0, Som = 0;
// 300 = 1+2+ ... +24 points.
Som = (Standard_Integer )( 300*((classe-1)*classe/2.-1) + classe * (nbpoints-1)*nbpoints/2.);
const Standard_Real *tmpVB;
const Standard_Real *tmpVB = nullptr;
tmpVB = VBMatrix + Som;
for (i = 1; i <= classe; i++) {
for (j = 1; j <= nbpoints; j++) {

View File

@@ -18,6 +18,8 @@
#define No_Standard_OutOfRange
#define No_Standard_RangeError
#endif
#include <math.h>
#include <AppCont_LeastSquare.hxx>
#include <math.hxx>
@@ -42,7 +44,7 @@ void AppCont_LeastSquare::FixSingleBorderPoint(const AppCont_Function& the
NCollection_Array1<gp_Pnt2d> aTabP2d(1, Max (myNbP2d, 1)), aPrevP2d(1, Max (myNbP2d, 1));
Standard_Real aMult = ((theU - theU0) > (theU1 - theU)) ? 1.0: -1.0;
Standard_Real aStartParam = theU,
aCurrParam, aPrevDist = 1.0, aCurrDist = 1.0;
aCurrParam = NAN, aPrevDist = 1.0, aCurrDist = 1.0;
Standard_Real du = -(theU1 - theU0) / 2.0 * aMult;
Standard_Real eps = Epsilon(1.);
@@ -103,14 +105,14 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP,
myPoles(1, Deg + 1, 1, 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints(), 0.0),
myParam(1, myNbPoints),
myVB(1, Deg+1, 1, myNbPoints),
myPerInfo(1, 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints() )
myPerInfo(1, 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints() ), myDone(Standard_False), myDegre(Deg), myNbdiscret(myNbPoints)
{
myDone = Standard_False;
myDegre = Deg;
Standard_Integer i, j, k, c, i2;
Standard_Integer i = 0, j = 0, k = 0, c = 0, i2 = 0;
Standard_Integer classe = Deg + 1, cl1 = Deg;
Standard_Real U, dU, Coeff, Coeff2;
Standard_Real IBij, IBPij;
Standard_Real U = NAN, dU = NAN, Coeff = NAN, Coeff2 = NAN;
Standard_Real IBij = NAN, IBPij = NAN;
Standard_Integer FirstP = 1, LastP = myNbPoints;
Standard_Integer nbcol = 3 * SSP.GetNbOf3dPoints() + 2 * SSP.GetNbOf2dPoints();
@@ -119,8 +121,8 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP,
AppParCurves_Constraint myFirstC = FirstCons, myLastC = LastCons;
SSP.GetNumberOfPoints(myNbP, myNbP2d);
Standard_Integer i2plus1, i2plus2;
myNbdiscret = myNbPoints;
Standard_Integer i2plus1 = 0, i2plus2 = 0;
NCollection_Array1<gp_Pnt> aTabP(1, Max (myNbP, 1));
NCollection_Array1<gp_Pnt2d> aTabP2d(1, Max (myNbP2d, 1));
NCollection_Array1<gp_Vec> aTabV(1, Max (myNbP, 1));
@@ -133,7 +135,7 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP,
myPerInfo(aDimIdx).myPeriod);
}
Standard_Boolean Ok;
Standard_Boolean Ok = 0;
if (myFirstC == AppParCurves_TangencyPoint)
{
Ok = SSP.D1(U0, aTabV2d, aTabV);
@@ -469,7 +471,7 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP,
const AppParCurves_MultiCurve& AppCont_LeastSquare::Value()
{
Standard_Integer i, j, j2;
Standard_Integer i = 0, j = 0, j2 = 0;
gp_Pnt Pt;
gp_Pnt2d Pt2d;
Standard_Integer ideb = 1, ifin = myDegre+1;
@@ -504,8 +506,8 @@ void AppCont_LeastSquare::Error(Standard_Real& F,
Standard_Real& MaxE3d,
Standard_Real& MaxE2d) const
{
Standard_Integer i, j, k, c, i2, classe = myDegre + 1;
Standard_Real Coeff, err3d = 0.0, err2d = 0.0;
Standard_Integer i = 0, j = 0, k = 0, c = 0, i2 = 0, classe = myDegre + 1;
Standard_Real Coeff = NAN, err3d = 0.0, err2d = 0.0;
Standard_Integer ncol = myPoints.UpperCol() - myPoints.LowerCol() + 1;
math_Matrix MyPoints(1, myNbdiscret, 1, ncol);
@@ -531,7 +533,7 @@ void AppCont_LeastSquare::Error(Standard_Real& F,
}
}
Standard_Real e1, e2, e3;
Standard_Real e1 = NAN, e2 = NAN, e3 = NAN;
for (i = 1; i <= myNbdiscret; i++)
{
i2 = 1;

View File

@@ -68,7 +68,7 @@ private:
NCollection_Array1<PeriodicityInfo> myPerInfo;
Standard_Boolean myDone;
Standard_Integer myDegre;
Standard_Integer myNbdiscret, myNbP, myNbP2d;
Standard_Integer myNbdiscret, myNbP{}, myNbP2d{};
};
#endif

View File

@@ -15,6 +15,8 @@
// commercial license or contractual agreement.
#include <math.h>
#include <AppDef_LinearCriteria.hxx>
#include <AppDef_MultiLine.hxx>
#include <AppDef_MyLineTool.hxx>
@@ -218,7 +220,7 @@ Handle(FEmTool_HAssemblyTable) AppDef_LinearCriteria::AssemblyTable() const
Handle(TColStd_HArray1OfInteger) GlobIndex, Aux;
Standard_Integer i, el = 1, dim = 1, NbGlobVar = 0, gi0;
Standard_Integer i = 0, el = 1, dim = 1, NbGlobVar = 0, gi0 = 0;
// For dim = 1
// For first element (el = 1)
@@ -288,7 +290,7 @@ Handle(TColStd_HArray2OfInteger) AppDef_LinearCriteria::DependenceTable() const
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(1, Dim, 1, Dim, 0);
Standard_Integer i;
Standard_Integer i = 0;
for(i=1; i <= Dim; i++) DepTab->SetValue(i,i,1);
return DepTab;
@@ -315,8 +317,8 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min,
TColStd_Array1OfReal& Knots = myCurve->Knots();
Handle(TColStd_HArray2OfReal) Coeff;
Standard_Integer el, deg = 0, curdeg, i;
Standard_Real UFirst, ULast;
Standard_Integer el = 0, deg = 0, curdeg = 0, i = 0;
Standard_Real UFirst = NAN, ULast = NAN;
J1 = J2 = J3 = 0.;
for(el = 1; el <= NbElm; el++) {
@@ -451,8 +453,8 @@ void AppDef_LinearCriteria::ErrorValues(Standard_Real& MaxError,
gp_Pnt2d P2d;
gp_Pnt P3d;
Standard_Integer i, ipnt, c0 = 0;
Standard_Real SqrDist, Dist;
Standard_Integer i = 0, ipnt = 0, c0 = 0;
Standard_Real SqrDist = NAN, Dist = NAN;
MaxError = QuadraticError = AverageError = 0.;
@@ -510,11 +512,11 @@ void AppDef_LinearCriteria::Hessian(const Standard_Integer Element,
math_Matrix AuxH(0, H.RowNumber()-1, 0, H.ColNumber()-1, 0.);
TColStd_Array1OfReal& Knots = myCurve->Knots();
Standard_Real UFirst, ULast;
Standard_Real UFirst = NAN, ULast = NAN;
UFirst = Knots(Element); ULast = Knots(Element + 1);
Standard_Integer icrit;
Standard_Integer icrit = 0;
// Quality criterion part of Hessian
@@ -530,12 +532,12 @@ void AppDef_LinearCriteria::Hessian(const Standard_Integer Element,
AuxH.Init(0.);
Standard_Real coeff = (ULast - UFirst)/2., curcoeff, poid;
Standard_Integer ipnt, ii, degH = 2 * Order+1;
Standard_Real coeff = (ULast - UFirst)/2., curcoeff = NAN, poid = NAN;
Standard_Integer ipnt = 0, ii = 0, degH = 2 * Order+1;
Handle(PLib_Base) myBase = myCurve->Base();
Standard_Integer k1, k2, i, j, i0 = H.LowerRow(), j0 = H.LowerCol(), i1, j1,
Standard_Integer k1 = 0, k2 = 0, i = 0, j = 0, i0 = H.LowerRow(), j0 = H.LowerCol(), i1 = 0, j1 = 0,
di = myPntWeight.Lower() - myParameters->Lower();
//BuilCache
@@ -603,8 +605,8 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element,
TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d));
TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d));
Standard_Boolean In3d;
Standard_Integer IndPnt, IndCrd;
Standard_Boolean In3d = 0;
Standard_Integer IndPnt = 0, IndCrd = 0;
if(Dimension <= 3*myNbP3d) {
In3d = Standard_True;
@@ -622,7 +624,7 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element,
}
TColStd_Array1OfReal& Knots = myCurve->Knots();
Standard_Real UFirst, ULast, Pnt;
Standard_Real UFirst = NAN, ULast = NAN, Pnt = NAN;
UFirst = Knots(Element); ULast = Knots(Element + 1);
Standard_Real coeff = (ULast-UFirst)/2;
@@ -632,9 +634,9 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element,
Handle(PLib_Base) myBase = myCurve->Base();
Standard_Integer MxDeg = myBase->WorkDegree();
Standard_Real curcoeff;
Standard_Real curcoeff = NAN;
Standard_Integer degH = 2 * Order + 1;
Standard_Integer ipnt, k, i, ii, i0 = G.Lower(),
Standard_Integer ipnt = 0, k = 0, i = 0, ii = 0, i0 = G.Lower(),
di = myPntWeight.Lower() - myParameters->Lower();
if (myE != Element) BuildCache(Element);
@@ -686,7 +688,7 @@ void AppDef_LinearCriteria::InputVector(const math_Vector& X,
Handle(TColStd_HArray1OfInteger) GlobIndex;
Standard_Integer el, dim, i, i0 = X.Lower() - 1;
Standard_Integer el = 0, dim = 0, i = 0, i0 = X.Lower() - 1;
for(el = 1; el <= NbElm; el++) {
for(dim = 1; dim <= NbDim; dim++) {
@@ -751,9 +753,9 @@ void AppDef_LinearCriteria::SetWeight(const TColStd_Array1OfReal& Weight)
//=======================================================================
void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element)
{
Standard_Real t;
Standard_Real UFirst, ULast;
Standard_Integer ipnt;
Standard_Real t = NAN;
Standard_Real UFirst = NAN, ULast = NAN;
Standard_Integer ipnt = 0;
UFirst = myCurve->Knots()(Element);
ULast = myCurve->Knots()(Element + 1);
@@ -770,7 +772,7 @@ void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element)
if (IF != 0) {
Handle(PLib_Base) myBase = myCurve->Base();
Standard_Integer order = myBase->WorkDegree()+1, ii;
Standard_Integer order = myBase->WorkDegree()+1, ii = 0;
myCache = new TColStd_HArray1OfReal (1, (IL-IF+1)*(order));
ii =1;
@@ -778,7 +780,7 @@ void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element)
Standard_Real * cache = &myCache->ChangeValue(ii);
TColStd_Array1OfReal BasicValue(cache[0], 0, order-1);
t = myParameters->Value(ipnt);
Standard_Real coeff = 2./(ULast - UFirst), c0 = -(ULast + UFirst)/2., s;
Standard_Real coeff = 2./(ULast - UFirst), c0 = -(ULast + UFirst)/2., s = NAN;
s = (t + c0) * coeff;
myBase->D0(s, BasicValue);
}

View File

@@ -96,10 +96,10 @@ private:
Handle(TColStd_HArray1OfReal) myParameters;
Handle(TColStd_HArray1OfReal) myCache;
Handle(FEmTool_ElementaryCriterion) myCriteria[3];
Standard_Real myEstimation[3];
Standard_Real myEstimation[3]{};
Standard_Real myQuadraticWeight;
Standard_Real myQualityWeight;
Standard_Real myPercent[3];
Standard_Real myPercent[3]{};
TColStd_Array1OfReal myPntWeight;
Handle(FEmTool_Curve) myCurve;
Standard_Real myLength;

View File

@@ -31,20 +31,20 @@ AppDef_MultiLine::AppDef_MultiLine (const Standard_Integer NbMult)
}
AppDef_MultiLine::AppDef_MultiLine (const AppDef_Array1OfMultiPointConstraint& tabMultiP)
AppDef_MultiLine::AppDef_MultiLine (const AppDef_Array1OfMultiPointConstraint& tabMultiP) : tabMult(new AppDef_HArray1OfMultiPointConstraint (1, tabMultiP.Length()))
{
tabMult = new AppDef_HArray1OfMultiPointConstraint (1, tabMultiP.Length());
Standard_Integer i, Lower = tabMultiP.Lower();
Standard_Integer i = 0, Lower = tabMultiP.Lower();
for (i = 1; i <= tabMultiP.Length(); i++) {
tabMult->SetValue(i, tabMultiP.Value(Lower+i-1));
}
}
AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt& tabP3d)
AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt& tabP3d) : tabMult(new AppDef_HArray1OfMultiPointConstraint (1, tabP3d.Length()))
{
tabMult = new AppDef_HArray1OfMultiPointConstraint (1, tabP3d.Length());
Standard_Integer i, Lower = tabP3d.Lower();
Standard_Integer i = 0, Lower = tabP3d.Lower();
for (i = 1; i <= tabP3d.Length(); i++) {
AppDef_MultiPointConstraint MP(1, 0);
MP.SetPoint(1, tabP3d(Lower+i-1));
@@ -54,10 +54,10 @@ AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt& tabP3d)
AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt2d& tabP2d)
AppDef_MultiLine::AppDef_MultiLine (const TColgp_Array1OfPnt2d& tabP2d) : tabMult(new AppDef_HArray1OfMultiPointConstraint (1, tabP2d.Length()))
{
tabMult = new AppDef_HArray1OfMultiPointConstraint (1, tabP2d.Length());
Standard_Integer i, Lower = tabP2d.Lower();
Standard_Integer i = 0, Lower = tabP2d.Lower();
for (i = 1; i <= tabP2d.Length(); i++) {
AppDef_MultiPointConstraint MP(0, 1);
MP.SetPoint2d(1, tabP2d(Lower+i-1));

View File

@@ -77,7 +77,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec.Lower();
Standard_Integer i = 0, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
tabTang->SetValue(i, tabVec.Value(Lower+i-1));
}
@@ -116,7 +116,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec.Lower();
Standard_Integer i = 0, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
tabTang->SetValue(i, tabVec.Value(Lower+i-1));
}
@@ -139,7 +139,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint (
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
Standard_Integer i, Lower = tabVec.Lower();
Standard_Integer i = 0, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
tabTang->SetValue(i, tabVec.Value(Lower+i-1));
}
@@ -158,7 +158,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint
}
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
Standard_Integer i, Lower = tabVec.Lower();
Standard_Integer i = 0, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
tabTang->SetValue(i, tabVec.Value(Lower+i-1));
}
@@ -183,7 +183,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint
}
tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec2d.Lower();
Standard_Integer i = 0, Lower = tabVec2d.Lower();
for (i = 1; i <= tabVec2d.Length(); i++) {
tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1));
}
@@ -204,7 +204,7 @@ AppDef_MultiPointConstraint::AppDef_MultiPointConstraint
}
tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec2d.Lower();
Standard_Integer i = 0, Lower = tabVec2d.Lower();
for (i = 1; i <= tabVec2d.Length(); i++) {
tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1));
}

View File

@@ -73,7 +73,7 @@ void AppDef_MyLineTool::Value(const AppDef_MultiLine& ML,
TColgp_Array1OfPnt2d& tabPt2d)
{
AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex);
Standard_Integer i, nbp2d = MPC.NbPoints2d(), low2d = tabPt2d.Lower();
Standard_Integer i = 0, nbp2d = MPC.NbPoints2d(), low2d = tabPt2d.Lower();
Standard_Integer nbp3d = MPC.NbPoints(), low = tabPt.Lower();
for (i = 1; i <= nbp3d; i++) {
tabPt(i+low-1) = MPC.Point(i);
@@ -123,7 +123,7 @@ Standard_Boolean AppDef_MyLineTool::Tangency(const AppDef_MultiLine& ML,
{
AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex);
if (MPC.IsTangencyPoint()) {
Standard_Integer i, nbp3d = MPC.NbPoints(), low = tabV.Lower();
Standard_Integer i = 0, nbp3d = MPC.NbPoints(), low = tabV.Lower();
Standard_Integer nbp2d = MPC.NbPoints2d(), low2d = tabV2d.Lower();
for (i = 1; i <= nbp3d; i++) {
tabV(i+low-1) = MPC.Tang(i);
@@ -204,7 +204,7 @@ Standard_Boolean AppDef_MyLineTool::Curvature(const AppDef_MultiLine& ML,
{
AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex);
if (MPC.IsCurvaturePoint()) {
Standard_Integer i, nbp3d = MPC.NbPoints(), low = tabV.Lower();
Standard_Integer i = 0, nbp3d = MPC.NbPoints(), low = tabV.Lower();
Standard_Integer nbp2d = MPC.NbPoints2d(), low2d = tabV2d.Lower();
for (i = 1; i <= nbp3d; i++) {
tabV(i+low-1) = MPC.Curv(i);

View File

@@ -17,6 +17,8 @@
// Approximation d une MultiLine de points decrite par le tool MLineTool.
// avec criteres variationnels
#include <math.h>
#include <AppDef_MultiLine.hxx>
#include <AppDef_Variational.hxx>
#include <AppParCurves_MultiBSpCurve.hxx>
@@ -145,7 +147,7 @@ myWithCutting(WithCutting)
//
// Table of Points initialization
//
Standard_Integer ipoint,jp2d,jp3d,index;
Standard_Integer ipoint = 0,jp2d = 0,jp3d = 0,index = 0;
TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d));
TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d));
gp_Pnt2d P2d;
@@ -212,8 +214,8 @@ myWithCutting(WithCutting)
void AppDef_Variational::Init()
{
Standard_Integer ipoint,jp2d,jp3d,index,jndex;
Standard_Integer CurMultyPoint;
Standard_Integer ipoint = 0,jp2d = 0,jp3d = 0,index = 0,jndex = 0;
Standard_Integer CurMultyPoint = 0;
TColgp_Array1OfVec TabV3d(1, Max(1,myNbP3d));
TColgp_Array1OfVec2d TabV2d(1, Max(1,myNbP2d));
TColgp_Array1OfVec TabV3dcurv(1, Max(1,myNbP3d));
@@ -233,7 +235,7 @@ void AppDef_Variational::Init()
//
// Table of types initialization
Standard_Integer iconstr;
Standard_Integer iconstr = 0;
index=1;
jndex=1;
CurMultyPoint = 1;
@@ -412,7 +414,7 @@ void AppDef_Variational::Init()
CurMultyPoint += myNbP3d * 6 + myNbP2d * 2;
}
// OverConstraint Detection
Standard_Integer MaxSeg;
Standard_Integer MaxSeg = 0;
if(myWithCutting == Standard_True) MaxSeg = myMaxSegment ;
else MaxSeg = 1;
if (((myMaxDegree-myNivCont)*MaxSeg-myNbPassPoints-2*myNbTangPoints-3*myNbCurvPoints) < 0 )
@@ -439,7 +441,7 @@ void AppDef_Variational::Approximate()
if (myIsCreated == Standard_False ) throw StdFail_NotDone();
Standard_Real WQuadratic, WQuality;
Standard_Real WQuadratic = NAN, WQuality = NAN;
TColStd_Array1OfReal Ecarts(myFirstPoint, myLastPoint);
@@ -459,7 +461,7 @@ void AppDef_Variational::Approximate()
//---------------------------------------------------------------------
Standard_Integer jp2d,jp3d,index,ipole,
Standard_Integer jp2d = 0,jp3d = 0,index = 0,ipole = 0,
NbElem = TheCurve->NbElements();
TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d));
@@ -490,7 +492,7 @@ void AppDef_Variational::Approximate()
TheCurve->GetPolynom(CoeffPtr->ChangeArray1());
Standard_Integer ii;
Standard_Integer ii = 0;
for(ii = 1; ii <= NbElem; ii++)
NbCoeffPtr->SetValue(ii, TheCurve->Degree(ii)+1);
@@ -699,7 +701,7 @@ void AppDef_Variational::Distance(math_Matrix& mat)
{
if (myIsDone == Standard_False) throw StdFail_NotDone();
Standard_Integer ipoint,jp2d,jp3d,index;
Standard_Integer ipoint = 0,jp2d = 0,jp3d = 0,index = 0;
TColgp_Array1OfPnt TabP3d(1,Max(1,myNbP3d));
TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d));
Standard_Integer j0 = mat.LowerCol() - myFirstPoint;
@@ -1150,22 +1152,22 @@ void AppDef_Variational::TheMotor(
Handle(TColStd_HArray1OfReal) CurrentTi, NewTi, OldTi;
Handle(TColStd_HArray2OfInteger) Dependence;
Standard_Boolean lestim, lconst, ToOptim, iscut;
Standard_Boolean lestim = 0, lconst = 0, ToOptim = 0, iscut = 0;
Standard_Boolean isnear = Standard_False, again = Standard_True;
Standard_Integer NbEst, ICDANA, NumPnt, Iter;
Standard_Integer NbEst = 0, ICDANA = 0, NumPnt = 0, Iter = 0;
Standard_Integer MaxNbEst =5;
Standard_Real VOCRI[3] = {BigValue, BigValue, BigValue}, EROLD = BigValue,
VALCRI[3], ERRMAX = BigValue, ERRMOY, ERRQUA;
Standard_Real CBLONG, LNOLD;
VALCRI[3], ERRMAX = BigValue, ERRMOY = NAN, ERRQUA = NAN;
Standard_Real CBLONG = NAN, LNOLD = NAN;
Standard_Integer NbrPnt = myLastPoint - myFirstPoint + 1;
Standard_Integer NbrConstraint = myNbPassPoints + myNbTangPoints + myNbCurvPoints;
Handle(FEmTool_Curve) CCurrent, COld, CNew;
Standard_Real EpsLength = SmallValue;
Standard_Real EpsDeg;
Standard_Real EpsDeg = NAN;
Standard_Real e1, e2, e3;
Standard_Real J1min, J2min, J3min;
Standard_Integer iprog;
Standard_Real e1 = NAN, e2 = NAN, e3 = NAN;
Standard_Real J1min = NAN, J2min = NAN, J3min = NAN;
Standard_Integer iprog = 0;
// (0) Init
@@ -1368,7 +1370,7 @@ void AppDef_Variational::TheMotor(
if ( (ERRMAX > WQuality) && (ERRMAX > 2*EROLD)) iregre++;
if ( (EROLD > WQuality) && (ERRMAX <= 0.5*EROLD)) iregre--;
}
Standard_Real E1, E2, E3;
Standard_Real E1 = NAN, E2 = NAN, E3 = NAN;
J->GetEstimation(E1, E2, E3);
if ( (VALCRI[0] > E1) && (VALCRI[0] > 1.1*VOCRI[0])) iregre++;
if ( (VALCRI[1] > E2) && (VALCRI[1] > 1.1*VOCRI[1])) iregre++;
@@ -1413,7 +1415,7 @@ void AppDef_Variational::TheMotor(
if ((CurrentTi->Value(1)!= 0.) ||
(CurrentTi->Value(NbrPnt)!= 1.)) {
Standard_Real t, DelatT =
Standard_Real t = NAN, DelatT =
1.0 /(CurrentTi->Value(NbrPnt)-CurrentTi->Value(1));
for (Standard_Integer ii=2; ii<NbrPnt; ii++) {
t = (CurrentTi->Value(ii)-CurrentTi->Value(1))*DelatT;
@@ -1489,7 +1491,7 @@ void AppDef_Variational::Optimization(Handle(AppDef_SmoothCriterion)& J,
math_Matrix H(0, MxDeg, 0, MxDeg);
math_Vector G(0, MxDeg), Sol(1, A.NbGlobVar());
Standard_Integer el, dim;
Standard_Integer el = 0, dim = 0;
A.GetAssemblyTable(AssTable);
Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints;
@@ -1532,8 +1534,8 @@ void AppDef_Variational::Optimization(Handle(AppDef_SmoothCriterion)& J,
// Updating Curve and reduction of degree
Standard_Integer Newdeg;
Standard_Real MaxError;
Standard_Integer Newdeg = 0;
Standard_Real MaxError = NAN;
if(NbConstr == 0) {
for(el = 1; el <= NbElm; el++) {
@@ -1543,7 +1545,7 @@ void AppDef_Variational::Optimization(Handle(AppDef_SmoothCriterion)& J,
else {
TColStd_Array1OfReal& TabInt = Curve->Knots();
Standard_Integer Icnt = 1, p0 = Parameters.Lower() - myFirstPoint, point;
Standard_Integer Icnt = 1, p0 = Parameters.Lower() - myFirstPoint, point = 0;
for(el = 1; el <= NbElm; el++) {
while((Icnt < NbConstr) &&
(Parameters(p0 + myTypConstraints->Value(2 * Icnt - 1)) <= TabInt(el))) Icnt++;
@@ -1573,11 +1575,11 @@ void AppDef_Variational::Project(const Handle(FEmTool_Curve)& C,
MaxErr = QuaErr = AveErr = 0.;
Standard_Integer Ipnt, NItCv, Iter, i, i0 = -myDimension, d0 = Distance.Lower() - 1;
Standard_Integer Ipnt = 0, NItCv = 0, Iter = 0, i = 0, i0 = -myDimension, d0 = Distance.Lower() - 1;
Standard_Real TNew, Dist, T0, Dist0, F1, F2, Aux, DF, Ecart;
Standard_Real TNew = NAN, Dist = NAN, T0 = NAN, Dist0 = NAN, F1 = NAN, F2 = NAN, Aux = NAN, DF = NAN, Ecart = NAN;
Standard_Boolean EnCour;
Standard_Boolean EnCour = 0;
TColStd_Array1OfReal ValOfC(1, myDimension), FirstDerOfC(1, myDimension),
SecndDerOfC(1, myDimension);
@@ -1684,8 +1686,8 @@ void AppDef_Variational::ACR(Handle(FEmTool_Curve)& Curve,
Standard_Integer NbrPnt = Ti.Length(), TiFirst = Ti.Lower(), TiLast = Ti.Upper(),
KFirst = Knots.Lower(), KLast = Knots.Upper();
Standard_Real CbLong, DeltaT, VTest, UNew, UOld, DU, TPara, TOld, DTInv, Ratio;
Standard_Integer ipnt, ii, IElm, IOld, POld, PCnt, ICnt=0;
Standard_Real CbLong = NAN, DeltaT = NAN, VTest = NAN, UNew = NAN, UOld = NAN, DU = NAN, TPara = NAN, TOld = NAN, DTInv = NAN, Ratio = NAN;
Standard_Integer ipnt = 0, ii = 0, IElm = 0, IOld = 0, POld = 0, PCnt = 0, ICnt=0;
Standard_Integer NbCntr = myNbPassPoints + myNbTangPoints + myNbCurvPoints;
// (1) Calcul de la longueur de courbe
@@ -1806,7 +1808,7 @@ static Standard_Integer NearIndex(const Standard_Real T,
if(T < TabPar(Loi)) { Flag = -1; return Loi;}
if(T > TabPar(Upi)) { Flag = 1; return Upi;}
Standard_Integer Ibeg = Loi, Ifin = Upi, Imidl;
Standard_Integer Ibeg = Loi, Ifin = Upi, Imidl = 0;
while(Ibeg + 1 != Ifin) {
Imidl = (Ibeg + Ifin) / 2;
@@ -1840,9 +1842,9 @@ static void GettingKnots(const TColStd_Array1OfReal& TabPar,
TColStd_Array1OfReal& OldKnots = InCurve->Knots();
Standard_Integer NbMaxOld = InCurve->NbElements();
Standard_Integer NbMax = NewKnots.Upper(), Ipt, Ipt1, Ipt2;
Standard_Integer el = 0, i1 = OldKnots.Lower(), i0 = i1 - 1, Flag;
Standard_Real TPar;
Standard_Integer NbMax = NewKnots.Upper(), Ipt = 0, Ipt1 = 0, Ipt2 = 0;
Standard_Integer el = 0, i1 = OldKnots.Lower(), i0 = i1 - 1, Flag = 0;
Standard_Real TPar = NAN;
while((NbElm < NbMax) && (el < NbMaxOld)) {
@@ -1904,7 +1906,7 @@ void AppDef_Variational::SplitCurve(const Handle(FEmTool_Curve)& InCurve,
TColStd_Array1OfReal& OutKnots = OutCurve->Knots();
TColStd_Array1OfReal& InKnots = InCurve->Knots();
Standard_Integer i, i0 = OutKnots.Lower();
Standard_Integer i = 0, i0 = OutKnots.Lower();
for(i = InKnots.Lower(); i <= InKnots.Upper(); i++) OutKnots(i) = InKnots(i);
for(i = NbElmOld + 1; i <= NbElm; i++) OutKnots(i + i0) = NewKnots(i);
@@ -1927,13 +1929,13 @@ void AppDef_Variational::InitSmoothCriterion()
Standard_Real Length;
Standard_Real Length = NAN;
InitParameters(Length);
mySmoothCriterion->SetParameters(myParameters);
Standard_Real E1, E2, E3;
Standard_Real E1 = NAN, E2 = NAN, E3 = NAN;
InitCriterionEstimations(Length, E1, E2, E3);
/*
@@ -1946,7 +1948,7 @@ void AppDef_Variational::InitSmoothCriterion()
mySmoothCriterion->EstLength() = Length;
mySmoothCriterion->SetEstimation(E1, E2, E3);
Standard_Real WQuadratic, WQuality;
Standard_Real WQuadratic = NAN, WQuality = NAN;
if(!myWithMinMax && myTolerance != 0.)
WQuality = myTolerance;
@@ -1968,7 +1970,7 @@ void AppDef_Variational::InitSmoothCriterion()
Handle(PLib_Base) TheBase = new PLib_HermitJacobi(myMaxDegree, myContinuity);
Handle(FEmTool_Curve) TheCurve;
Standard_Integer NbElem;
Standard_Integer NbElem = 0;
Standard_Real CurvTol = Eps2 * Length / myNbPoints;
// Decoupe de l'intervalle en fonction des contraintes
@@ -2006,8 +2008,8 @@ void AppDef_Variational::InitParameters(Standard_Real& Length)
const Standard_Real Eps1 = Precision::Confusion() * .01;
Standard_Real aux, dist;
Standard_Integer i, i0, i1 = 0, ipoint;
Standard_Real aux = NAN, dist = NAN;
Standard_Integer i = 0, i0 = 0, i1 = 0, ipoint = 0;
Length = 0.;
@@ -2136,7 +2138,7 @@ void AppDef_Variational::InitCriterionEstimations(const Standard_Real Length,
Delta = .5 * (myParameters->Value(myLastPoint) - myParameters->Value(myLastPoint - 1));
if(Delta <= Eps1) Delta = 1.;
Standard_Real aux;
Standard_Real aux = NAN;
if(CurrPoint == 1) {
@@ -2179,7 +2181,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt,
math_Vector& VTang) const
{
Standard_Integer i ;
Standard_Integer i = 0 ;
const Standard_Real Eps1 = Precision::Confusion() * .01;
const Standard_Real EpsNorm = 1.e-9;
@@ -2207,7 +2209,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt,
Standard_Real V2 = 0.;
if(V1 > Eps1) V2 = Pnt3.Subtracted(Pnt2).Norm();
if(V2 > Eps1) {
Standard_Real d = V1 / (V1 + V2), d1;
Standard_Real d = V1 / (V1 + V2), d1 = NAN;
d1 = 1. / (d * (1 - d)); d *= d;
VTang = ((d - 1.) * Pnt1 + Pnt2 - d * Pnt3) * d1;
}
@@ -2240,7 +2242,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt,
Standard_Real V2 = 0.;
if(V1 > Eps1) V2 = Pnt3.Subtracted(Pnt2).Norm();
if(V2 > Eps1) {
Standard_Real d = V1 / (V1 + V2), d1;
Standard_Real d = V1 / (V1 + V2), d1 = NAN;
d1 = 1. / (d * (1 - d)); d *= d - 2;
VTang = ((d + 1.) * Pnt1 - Pnt2 - d * Pnt3) * d1;
}
@@ -2332,13 +2334,13 @@ void AppDef_Variational::EstSecnd(const Standard_Integer ipnt,
const Standard_Real Length,
math_Vector& VScnd) const
{
Standard_Integer i ;
Standard_Integer i = 0 ;
const Standard_Real Eps = 1.e-9;
Standard_Real Wpnt = 1.;
Standard_Real aux;
Standard_Real aux = NAN;
if(ipnt == myFirstPoint)
aux = myParameters->Value(ipnt + 1) - myParameters->Value(ipnt);
@@ -2411,7 +2413,7 @@ void AppDef_Variational::InitCutting(const Handle(PLib_Base)& aBase,
{
// Definition of number of elements
Standard_Integer ORCMx = -1, NCont = 0, i, kk, NbElem;
Standard_Integer ORCMx = -1, NCont = 0, i = 0, kk = 0, NbElem = 0;
Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints;
for(i = 1; i <= NbConstr; i++) {
@@ -2534,15 +2536,15 @@ void AppDef_Variational::Adjusting(
/* Local variables */
Standard_Integer iter, ipnt;
Standard_Real ecart, emold, erold, tpara;
Standard_Real vocri[4], j1cibl, vtest, vseuil;
Standard_Integer i, numint, flag;
Standard_Integer iter = 0, ipnt = 0;
Standard_Real ecart = NAN, emold = NAN, erold = NAN, tpara = NAN;
Standard_Real vocri[4], j1cibl = NAN, vtest = NAN, vseuil = NAN;
Standard_Integer i = 0, numint = 0, flag = 0;
TColStd_Array1OfReal tbpoid(myFirstPoint, myLastPoint);
Standard_Boolean loptim, lrejet;
Standard_Boolean loptim = 0, lrejet = 0;
Handle(AppDef_SmoothCriterion) JNew;
Handle(FEmTool_Curve) CNew;
Standard_Real E1, E2, E3;
Standard_Real E1 = NAN, E2 = NAN, E3 = NAN;
/* (0.b) Initialisations */
@@ -2694,12 +2696,12 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv
V1((Standard_Real*)&G1(0), 0, MxDeg),
V2((Standard_Real*)&G2(0), 0, MxDeg);
Standard_Integer IndexOfConstraint, Ng3d, Ng2d, NBeg2d, NPass, NgPC1,
NTang3d, NTang2d,
Point, TypOfConstr,
Standard_Integer IndexOfConstraint = 0, Ng3d = 0, Ng2d = 0, NBeg2d = 0, NPass = 0, NgPC1 = 0,
NTang3d = 0, NTang2d = 0,
Point = 0, TypOfConstr = 0,
p0 = Parameters.Lower() - myFirstPoint,
curel = 1, el, i, ipnt, ityp, j, k, pnt, curdim,
jt, Ntheta = 6 * myNbP3d + 2 * myNbP2d;
curel = 1, el = 0, i = 0, ipnt = 0, ityp = 0, j = 0, k = 0, pnt = 0, curdim = 0,
jt = 0, Ntheta = 6 * myNbP3d + 2 * myNbP2d;
Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints;
// Ng3d = 3 * NbConstr + 2 * myNbTangPoints + 5 * myNbCurvPoints;
@@ -2715,13 +2717,13 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv
TColStd_Array1OfReal& Intervals = Curve->Knots();
Standard_Real t, R1, R2;
Standard_Real t = NAN, R1 = NAN, R2 = NAN;
Handle(PLib_Base) myBase = Curve->Base();
Handle(PLib_HermitJacobi) myHermitJacobi = Handle(PLib_HermitJacobi)::DownCast (myBase);
Standard_Integer Order = myHermitJacobi->NivConstr() + 1;
Standard_Real UFirst, ULast, coeff, c0, mfact, mfact1;
Standard_Real UFirst = NAN, ULast = NAN, coeff = NAN, c0 = NAN, mfact = NAN, mfact1 = NAN;
A.NullifyConstraint();
@@ -2960,7 +2962,7 @@ Standard_Boolean AppDef_Variational::InitTthetaF(const Standard_Integer ndimen,
gp_Vec T, V;
gp_Vec theta1, theta2;
gp_Vec F;
Standard_Real XX, XY, YY, XZ, YZ, ZZ;
Standard_Real XX = NAN, XY = NAN, YY = NAN, XZ = NAN, YZ = NAN, ZZ = NAN;
if ((typcon == AppParCurves_TangencyPoint)||(typcon == AppParCurves_CurvaturePoint))
{

View File

@@ -254,11 +254,11 @@ private:
Standard_Integer myNbPoints;
Handle(TColStd_HArray1OfReal) myTabPoints;
Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
Standard_Integer myNbConstraints;
Standard_Integer myNbConstraints{};
Handle(TColStd_HArray1OfReal) myTabConstraints;
Standard_Integer myNbPassPoints;
Standard_Integer myNbTangPoints;
Standard_Integer myNbCurvPoints;
Standard_Integer myNbPassPoints{};
Standard_Integer myNbTangPoints{};
Standard_Integer myNbCurvPoints{};
Handle(TColStd_HArray1OfInteger) myTypConstraints;
Handle(TColStd_HArray1OfReal) myTtheta;
Handle(TColStd_HArray1OfReal) myTfthet;
@@ -270,15 +270,15 @@ private:
Standard_Integer myNivCont;
Standard_Boolean myWithMinMax;
Standard_Boolean myWithCutting;
Standard_Real myPercent[3];
Standard_Real myCriterium[4];
Standard_Real myPercent[3]{};
Standard_Real myCriterium[4]{};
Handle(AppDef_SmoothCriterion) mySmoothCriterion;
Handle(TColStd_HArray1OfReal) myParameters;
Handle(TColStd_HArray1OfReal) myKnots;
AppParCurves_MultiBSpCurve myMBSpCurve;
Standard_Real myMaxError;
Standard_Integer myMaxErrorIndex;
Standard_Real myAverageError;
Standard_Real myMaxError{};
Standard_Integer myMaxErrorIndex{};
Standard_Real myAverageError{};
Standard_Boolean myIsCreated;
Standard_Boolean myIsDone;
Standard_Boolean myIsOverConstr;

View File

@@ -16,6 +16,8 @@
#define No_Standard_OutOfRange
#include <math.h>
#include <AppParCurves.hxx>
#include <BSplCLib.hxx>
#include <math_Matrix.hxx>
@@ -25,8 +27,8 @@ void AppParCurves::BernsteinMatrix(const Standard_Integer NbPoles,
const math_Vector& U,
math_Matrix& A) {
Standard_Integer i, j, id;
Standard_Real u0, u1, y0, y1, xs;
Standard_Integer i = 0, j = 0, id = 0;
Standard_Real u0 = NAN, u1 = NAN, y0 = NAN, y1 = NAN, xs = NAN;
Standard_Integer first = U.Lower(), last = U.Upper();
math_Vector B(1, NbPoles-1);
@@ -62,8 +64,8 @@ void AppParCurves::Bernstein(const Standard_Integer NbPoles,
math_Matrix& A,
math_Matrix& DA) {
Standard_Integer i, j, id, Ndeg = NbPoles-1;
Standard_Real u0, u1, y0, y1, xs, bj, bj1;
Standard_Integer i = 0, j = 0, id = 0, Ndeg = NbPoles-1;
Standard_Real u0 = NAN, u1 = NAN, y0 = NAN, y1 = NAN, xs = NAN, bj = NAN, bj1 = NAN;
Standard_Integer first = U.Lower(), last = U.Upper();
math_Vector B(1, NbPoles-1);
@@ -101,9 +103,9 @@ void AppParCurves::Bernstein(const Standard_Integer NbPoles,
void AppParCurves::SecondDerivativeBernstein(const Standard_Real U,
math_Vector& DDA) {
// Standard_Real U1 = 1-U, Y0, Y1, Xs;
Standard_Real Y0, Y1, Xs;
Standard_Real Y0 = NAN, Y1 = NAN, Xs = NAN;
Standard_Integer NbPoles = DDA.Length();
Standard_Integer id, j, N4, deg = NbPoles-1;
Standard_Integer id = 0, j = 0, N4 = 0, deg = NbPoles-1;
N4 = deg*(deg-1);
math_Vector B(1, deg-1);
B(1) = 1.;
@@ -155,13 +157,13 @@ void AppParCurves::SplineFunction(const Standard_Integer nbpoles,
math_IntegerVector& index)
{
// Standard_Real U, NewU, co, diff, t1, t2;
Standard_Real U, NewU;
Standard_Real U = NAN, NewU = NAN;
// gp_Pnt2d Pt, P0;
// gp_Vec2d V1;
// Standard_Integer i, j, k, iter, in, ik, deg1 = deg+1;
Standard_Integer i, j, deg1 = deg+1;
Standard_Integer i = 0, j = 0, deg1 = deg+1;
// Standard_Integer oldkindex, kindex, theindex, ttindex;
Standard_Integer oldkindex, kindex, theindex;
Standard_Integer oldkindex = 0, kindex = 0, theindex = 0;
math_Vector locpoles(1 , deg1);
math_Vector locdpoles(1 , deg1);
Standard_Integer firstp = Parameters.Lower(), lastp = Parameters.Upper();
@@ -174,8 +176,8 @@ void AppParCurves::SplineFunction(const Standard_Integer nbpoles,
oldkindex = 1;
Standard_Integer pp, qq;
Standard_Real Saved, Inverse, LocalInverse, locqq, locdqq, val;
Standard_Integer pp = 0, qq = 0;
Standard_Real Saved = NAN, Inverse = NAN, LocalInverse = NAN, locqq = NAN, locdqq = NAN, val = NAN;
for (i = firstp; i <= lastp; i++) {
U = Parameters(i);

View File

@@ -25,10 +25,10 @@ AppParCurves_ConstraintCouple::
AppParCurves_ConstraintCouple::
AppParCurves_ConstraintCouple(const Standard_Integer TheIndex,
const AppParCurves_Constraint Cons)
const AppParCurves_Constraint Cons) : myIndex(TheIndex), myConstraint(Cons)
{
myIndex = TheIndex;
myConstraint = Cons;
}

View File

@@ -32,7 +32,7 @@
static Standard_Integer ComputeDegree(const TColStd_Array1OfInteger& mults,
const Standard_Integer nbPoles)
{
Standard_Integer i, sum = 0;
Standard_Integer i = 0, sum = 0;
for (i = mults.Lower(); i <= mults.Upper(); i++) {
sum += mults(i);
}
@@ -73,13 +73,13 @@ AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve
(const AppParCurves_Array1OfMultiPoint& tabMU,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults):
AppParCurves_MultiCurve(tabMU)
AppParCurves_MultiCurve(tabMU), myknots(new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper())), mymults(new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper())), myDegree(ComputeDegree(Mults,NbPoles()))
{
myknots = new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper());
myknots->ChangeArray1() = Knots;
mymults = new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper());
mymults->ChangeArray1() = Mults;
myDegree = ComputeDegree(Mults,NbPoles());
}
@@ -92,13 +92,13 @@ AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve
(const AppParCurves_MultiCurve& SC,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults):
AppParCurves_MultiCurve(SC)
AppParCurves_MultiCurve(SC), myknots(new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper())), mymults(new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper())), myDegree(ComputeDegree(Mults,NbPoles()))
{
myknots = new TColStd_HArray1OfReal(Knots.Lower(), Knots.Upper());
myknots->ChangeArray1() = Knots;
mymults = new TColStd_HArray1OfInteger(Mults.Lower(), Mults.Upper());
mymults->ChangeArray1() = Mults;
myDegree = ComputeDegree(Mults,NbPoles());
}

View File

@@ -27,17 +27,17 @@
AppParCurves_MultiCurve::AppParCurves_MultiCurve() {}
AppParCurves_MultiCurve::AppParCurves_MultiCurve (const Standard_Integer NbPol)
AppParCurves_MultiCurve::AppParCurves_MultiCurve (const Standard_Integer NbPol) : tabPoint(new AppParCurves_HArray1OfMultiPoint(1, NbPol))
{
tabPoint = new AppParCurves_HArray1OfMultiPoint(1, NbPol);
}
AppParCurves_MultiCurve::AppParCurves_MultiCurve (const AppParCurves_Array1OfMultiPoint& tabMU)
AppParCurves_MultiCurve::AppParCurves_MultiCurve (const AppParCurves_Array1OfMultiPoint& tabMU) : tabPoint(new AppParCurves_HArray1OfMultiPoint(1, tabMU.Length()))
{
tabPoint = new AppParCurves_HArray1OfMultiPoint(1, tabMU.Length());
Standard_Integer i, Lower = tabMU.Lower();
Standard_Integer i = 0, Lower = tabMU.Lower();
for (i = 1; i <= tabMU.Length(); i++) {
tabPoint->SetValue(i, tabMU.Value(Lower+i-1));
}

View File

@@ -32,10 +32,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint()
AppParCurves_MultiPoint::AppParCurves_MultiPoint (const Standard_Integer NbPoles,
const Standard_Integer NbPoles2d)
const Standard_Integer NbPoles2d) : nbP(NbPoles), nbP2d(NbPoles2d)
{
nbP = NbPoles;
nbP2d = NbPoles2d;
if (nbP != 0) {
Handle(TColgp_HArray1OfPnt) tab3d =
new TColgp_HArray1OfPnt(1, NbPoles);
@@ -50,10 +50,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint (const Standard_Integer NbPoles
AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP)
AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP) : nbP2d(0), nbP(tabP.Length())
{
nbP2d = 0;
nbP = tabP.Length();
Handle(TColgp_HArray1OfPnt) tab3d =
new TColgp_HArray1OfPnt(1, nbP);
ttabPoint = tab3d;
@@ -66,10 +66,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP)
AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tabP2d)
AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tabP2d) : nbP(0), nbP2d(tabP2d.Length())
{
nbP = 0;
nbP2d = tabP2d.Length();
Handle(TColgp_HArray1OfPnt2d) tab2d =
new TColgp_HArray1OfPnt2d(1, nbP2d);
ttabPoint2d = tab2d;
@@ -82,10 +82,10 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt2d& tab
AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tabP,
const TColgp_Array1OfPnt2d& tabP2d)
const TColgp_Array1OfPnt2d& tabP2d) : nbP(tabP.Length()), nbP2d(tabP2d.Length())
{
nbP = tabP.Length();
nbP2d = tabP2d.Length();
Handle(TColgp_HArray1OfPnt) t3d =
new TColgp_HArray1OfPnt(1, nbP);
ttabPoint = t3d;
@@ -95,7 +95,7 @@ AppParCurves_MultiPoint::AppParCurves_MultiPoint(const TColgp_Array1OfPnt& tab
ttabPoint2d = t2d;
TColgp_Array1OfPnt& P3d = tabPoint->ChangeArray1();
Standard_Integer i, Lower = tabP.Lower();
Standard_Integer i = 0, Lower = tabP.Lower();
for (i = 1; i <= nbP; i++) {
P3d.SetValue(i, tabP.Value(Lower+i-1));
}

View File

@@ -34,16 +34,16 @@ class Approx_Curve2d_Eval : public AdvApprox_EvaluatorFunction
Standard_Real First, Standard_Real Last)
: fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Adaptor2d_Curve2d) fonct;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_Curve2d_Eval::Evaluate (Standard_Integer *Dimension,
@@ -96,7 +96,7 @@ void Approx_Curve2d_Eval::Evaluate (Standard_Integer *Dimension,
}
}
Approx_Curve2d::Approx_Curve2d(const Handle(Adaptor2d_Curve2d)& C2D,const Standard_Real First,const Standard_Real Last,const Standard_Real TolU,const Standard_Real TolV,const GeomAbs_Shape Continuity,const Standard_Integer MaxDegree,const Standard_Integer MaxSegments)
Approx_Curve2d::Approx_Curve2d(const Handle(Adaptor2d_Curve2d)& C2D,const Standard_Real First,const Standard_Real Last,const Standard_Real TolU,const Standard_Real TolV,const GeomAbs_Shape Continuity,const Standard_Integer MaxDegree,const Standard_Integer MaxSegments) : myMaxError2dU(0), myMaxError2dV(0)
{
C2D->Trim(First,Last,Precision::PConfusion());
@@ -115,8 +115,8 @@ void Approx_Curve2d_Eval::Evaluate (Standard_Integer *Dimension,
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
myMaxError2dU = 0;
myMaxError2dV = 0;
Approx_Curve2d_Eval ev (C2D, First, Last);
AdvApprox_ApproxAFunction aApprox (Num1DSS, Num2DSS, Num3DSS,

View File

@@ -38,16 +38,16 @@ class Approx_Curve3d_Eval : public AdvApprox_EvaluatorFunction
Standard_Real First, Standard_Real Last)
: fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Adaptor3d_Curve) fonct;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_Curve3d_Eval::Evaluate (Standard_Integer *Dimension,
@@ -105,7 +105,7 @@ Approx_Curve3d::Approx_Curve3d(const Handle(Adaptor3d_Curve)& Curve,
const Standard_Real Tol3d,
const GeomAbs_Shape Order,
const Standard_Integer MaxSegments,
const Standard_Integer MaxDegree)
const Standard_Integer MaxDegree) : myMaxError(0)
{
// Initialisation of input parameters of AdvApprox
@@ -127,7 +127,7 @@ Approx_Curve3d::Approx_Curve3d(const Handle(Adaptor3d_Curve)& Curve,
AdvApprox_PrefAndRec CutTool(CutPnts_C2,CutPnts_C3);
myMaxError = 0;
Approx_Curve3d_Eval ev (Curve, First, Last);
AdvApprox_ApproxAFunction aApprox (Num1DSS, Num2DSS, Num3DSS,

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Approx_CurveOnSurface.hxx>
#include <Adaptor2d_Curve2d.hxx>
@@ -55,17 +57,17 @@ class Approx_CurveOnSurface_Eval : public AdvApprox_EvaluatorFunction
: fonct(theFunc), fonct2d(theFunc2d)
{ StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Adaptor3d_Curve) fonct;
Handle(Adaptor2d_Curve2d) fonct2d;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_CurveOnSurface_Eval::Evaluate (Standard_Integer *Dimension,
@@ -154,16 +156,16 @@ class Approx_CurveOnSurface_Eval3d : public AdvApprox_EvaluatorFunction
Standard_Real First, Standard_Real Last)
: fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Adaptor3d_Curve) fonct;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_CurveOnSurface_Eval3d::Evaluate (Standard_Integer *Dimension,
@@ -235,16 +237,16 @@ class Approx_CurveOnSurface_Eval2d : public AdvApprox_EvaluatorFunction
Standard_Real First, Standard_Real Last)
: fonct2d(theFunc2d) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Adaptor2d_Curve2d) fonct2d;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_CurveOnSurface_Eval2d::Evaluate (Standard_Integer *Dimension,
@@ -381,8 +383,8 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments,
Handle( Adaptor2d_Curve2d ) TrimmedC2D = myC2D->Trim( myFirst, myLast, Precision::PConfusion() );
Standard_Boolean isU, isForward;
Standard_Real aParam;
Standard_Boolean isU = 0, isForward = 0;
Standard_Real aParam = NAN;
if (theOnly3d && isIsoLine(TrimmedC2D, isU, aParam, isForward))
{
if (buildC3dOnIsoLine(TrimmedC2D, isU, aParam, isForward))
@@ -404,7 +406,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments,
Approx_CurveOnSurface_Eval3d Eval3dCvOnSurf (HCOnS, myFirst, myLast);
Approx_CurveOnSurface_Eval2d Eval2dCvOnSurf ( TrimmedC2D, myFirst, myLast);
Approx_CurveOnSurface_Eval EvalCvOnSurf (HCOnS, TrimmedC2D, myFirst, myLast);
AdvApprox_EvaluatorFunction* EvalPtr;
AdvApprox_EvaluatorFunction* EvalPtr = nullptr;
if ( theOnly3d ) EvalPtr = &Eval3dCvOnSurf;
else if ( theOnly2d ) EvalPtr = &Eval2dCvOnSurf;
else EvalPtr = &EvalCvOnSurf;
@@ -414,7 +416,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments,
Num1DSS = 2;
OneDTol = new TColStd_HArray1OfReal(1,Num1DSS);
Standard_Real TolU, TolV;
Standard_Real TolU = NAN, TolV = NAN;
TolU = mySurf->UResolution(myTol) / 2.;
TolV = mySurf->VResolution(myTol) / 2.;
@@ -445,7 +447,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments,
ThreeDTol->Init(myTol/2);
}
AdvApprox_Cutting* CutTool;
AdvApprox_Cutting* CutTool = nullptr;
if (aContinuity <= myC2D->Continuity() &&
aContinuity <= mySurf->UContinuity() &&
@@ -556,7 +558,7 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments,
//function : isIsoLine
//purpose :
//=============================================================================
Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
Standard_Boolean& theIsU,
Standard_Real& theParam,
Standard_Boolean& theIsForward) const
@@ -638,7 +640,7 @@ Standard_Boolean Approx_CurveOnSurface::isIsoLine(const Handle(Adaptor2d_Curve2d
//function : buildC3dOnIsoLine
//purpose :
//=============================================================================
Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
const Standard_Boolean theIsU,
const Standard_Real theParam,
const Standard_Boolean theIsForward)
@@ -659,7 +661,7 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d
gp_Pnt2d aL2d = theC2D->Value(theC2D->LastParameter());
Standard_Boolean isToTrim = Standard_True;
Standard_Real U1, U2, V1, V2;
Standard_Real U1 = NAN, U2 = NAN, V1 = NAN, V2 = NAN;
aSurf->Bounds(U1, U2, V1, V2);
if (theIsU)

View File

@@ -85,7 +85,7 @@ protected:
//! @param theParam Line parameter.
//! @param theIsForward Flag indicating forward parameterization on a isoline.
//! @return Standard_True when 2d curve is a line and Standard_False otherwise.
Standard_Boolean isIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean isIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
Standard_Boolean& theIsU,
Standard_Real& theParam,
Standard_Boolean& theIsForward) const;
@@ -97,7 +97,7 @@ protected:
//! @param theParam Line parameter.
//! @param theIsForward Flag indicating forward parameterization on a isoline.
//! @return Standard_True when 3d curve is built and Standard_False otherwise.
Standard_Boolean buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d) theC2D,
Standard_Boolean buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& theC2D,
const Standard_Boolean theIsU,
const Standard_Real theParam,
const Standard_Boolean theIsForward);

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Approx_CurvilinearParameter.hxx>
#include <Adaptor2d_Curve2d.hxx>
@@ -73,16 +75,16 @@ class Approx_CurvilinearParameter_EvalCurv : public AdvApprox_EvaluatorFunction
Standard_Real First, Standard_Real Last)
: fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Approx_CurvlinFunc) fonct;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_CurvilinearParameter_EvalCurv::Evaluate (Standard_Integer * Dimension,
@@ -95,7 +97,7 @@ void Approx_CurvilinearParameter_EvalCurv::Evaluate (Standard_Integer * Dimensio
*ErrorCode = 0;
Standard_Real S = *Param;
TColStd_Array1OfReal Res(0, 2);
Standard_Integer i;
Standard_Integer i = 0;
// Dimension is incorrect
if (*Dimension != 3) {
@@ -126,7 +128,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
const GeomAbs_Shape Order,
const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments)
: myMaxError2d1(0.0),
: myCase(1), myMaxError2d1(0.0),
myMaxError2d2(0.0)
{
#ifdef OCCT_DEBUG_CHRONO
@@ -134,7 +136,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
uparam_count = 0;
InitChron(chr_total);
#endif
myCase = 1;
// Initialisation of input parameters of AdvApprox
Standard_Integer Num1DSS=0, Num2DSS=0, Num3DSS=1;
@@ -212,16 +214,16 @@ class Approx_CurvilinearParameter_EvalCurvOnSurf : public AdvApprox_EvaluatorFun
Standard_Real First, Standard_Real Last)
: fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Approx_CurvlinFunc) fonct;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_CurvilinearParameter_EvalCurvOnSurf::Evaluate (Standard_Integer * Dimension,
@@ -234,7 +236,7 @@ void Approx_CurvilinearParameter_EvalCurvOnSurf::Evaluate (Standard_Integer * Di
*ErrorCode = 0;
Standard_Real S = *Param;
TColStd_Array1OfReal Res(0, 4);
Standard_Integer i;
Standard_Integer i = 0;
// Dimension is incorrect
if (*Dimension != 5) {
@@ -265,21 +267,21 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
const Standard_Real Tol,
const GeomAbs_Shape Order,
const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments)
const Standard_Integer MaxSegments) : myCase(2)
{
#ifdef OCCT_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0;
InitChron(chr_total);
#endif
myCase = 2;
// Initialisation of input parameters of AdvApprox
Standard_Integer Num1DSS=2, Num2DSS=0, Num3DSS=1, i;
Standard_Integer Num1DSS=2, Num2DSS=0, Num3DSS=1, i = 0;
Handle(TColStd_HArray1OfReal) OneDTol = new TColStd_HArray1OfReal(1,Num1DSS);
Standard_Real TolV,TolW;
Standard_Real TolV = NAN,TolW = NAN;
ToleranceComputation(C2D,Surf,10,Tol,TolV,TolW);
OneDTol->SetValue(1,TolV);
@@ -373,16 +375,16 @@ class Approx_CurvilinearParameter_EvalCurvOn2Surf : public AdvApprox_EvaluatorFu
Standard_Real First, Standard_Real Last)
: fonct(theFunc) { StartEndSav[0] = First; StartEndSav[1] = Last; }
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Handle(Approx_CurvlinFunc) fonct;
Standard_Real StartEndSav[2];
Standard_Real StartEndSav[2]{};
};
void Approx_CurvilinearParameter_EvalCurvOn2Surf::Evaluate (Standard_Integer * Dimension,
@@ -395,7 +397,7 @@ void Approx_CurvilinearParameter_EvalCurvOn2Surf::Evaluate (Standard_Integer * D
*ErrorCode = 0;
Standard_Real S = *Param;
TColStd_Array1OfReal Res(0, 6);
Standard_Integer i;
Standard_Integer i = 0;
// Dimension is incorrect
if (*Dimension != 7) {
@@ -428,23 +430,23 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_
const Standard_Real Tol,
const GeomAbs_Shape Order,
const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments)
const Standard_Integer MaxSegments) : myCase(3)
{
Standard_Integer i;
Standard_Integer i = 0;
#ifdef OCCT_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0;
uparam_count = 0;
InitChron(chr_total);
#endif
myCase = 3;
// Initialisation of input parameters of AdvApprox
Standard_Integer Num1DSS=4, Num2DSS=0, Num3DSS=1;
Handle(TColStd_HArray1OfReal) OneDTol = new TColStd_HArray1OfReal(1,Num1DSS);
Standard_Real TolV,TolW;
Standard_Real TolV = NAN,TolW = NAN;
ToleranceComputation(C2D1,Surf1,10,Tol,TolV,TolW);
OneDTol->SetValue(1,TolV);
OneDTol->SetValue(2,TolW);

View File

@@ -90,7 +90,7 @@ private:
Handle(Geom2d_BSplineCurve) myCurve2d1;
Standard_Real myMaxError2d1;
Handle(Geom2d_BSplineCurve) myCurve2d2;
Standard_Real myMaxError2d2;
Standard_Real myMaxError2d2{};
};

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Approx_CurvlinFunc.hxx>
#include <Adaptor2d_Curve2d.hxx>
@@ -43,7 +45,7 @@ Standard_IMPORT void ResultChron( OSD_Chronometer & ch, Standard_Real & time);
static Standard_Real cubic(const Standard_Real X, const Standard_Real *Xi, const Standard_Real *Yi)
{
Standard_Real I1, I2, I3, I21, I22, I31, Result;
Standard_Real I1 = NAN, I2 = NAN, I3 = NAN, I21 = NAN, I22 = NAN, I31 = NAN, Result = NAN;
I1 = (Yi[0] - Yi[1])/(Xi[0] - Xi[1]);
I2 = (Yi[1] - Yi[2])/(Xi[1] - Xi[2]);
@@ -68,7 +70,7 @@ static void findfourpoints(const Standard_Real ,
const Standard_Real prevU, Standard_Real *Xi,
Standard_Real *Yi)
{
Standard_Integer i, j;
Standard_Integer i = 0, j = 0;
Standard_Integer NbInt = Si->Length() - 1;
if (NbInt < 3) throw Standard_ConstructionError("Approx_CurvlinFunc::GetUParameter");
@@ -193,8 +195,8 @@ void Approx_CurvlinFunc::Init()
void Approx_CurvlinFunc::Init(Adaptor3d_Curve& C, Handle(TColStd_HArray1OfReal)& Si,
Handle(TColStd_HArray1OfReal)& Ui) const
{
Standard_Real Step, FirstU, LastU;
Standard_Integer i, j, k, NbInt, NbIntC3;
Standard_Real Step = NAN, FirstU = NAN, LastU = NAN;
Standard_Integer i = 0, j = 0, k = 0, NbInt = 0, NbIntC3 = 0;
FirstU = C.FirstParameter();
LastU = C.LastParameter();
@@ -260,7 +262,7 @@ Standard_Integer Approx_CurvlinFunc::NbIntervals(const GeomAbs_Shape S) const
CurOnSur.Load(mySurf1);
return CurOnSur.NbIntervals(S);
case 3:
Standard_Integer NbInt;
Standard_Integer NbInt = 0;
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
NbInt = CurOnSur.NbIntervals(S);
@@ -284,7 +286,7 @@ Standard_Integer Approx_CurvlinFunc::NbIntervals(const GeomAbs_Shape S) const
void Approx_CurvlinFunc::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
{
Adaptor3d_CurveOnSurface CurOnSur;
Standard_Integer i;
Standard_Integer i = 0;
switch(myCase) {
case 1:
@@ -296,7 +298,7 @@ void Approx_CurvlinFunc::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape
CurOnSur.Intervals(T, S);
break;
case 3:
Standard_Integer NbInt;
Standard_Integer NbInt = 0;
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
NbInt = CurOnSur.NbIntervals(S);
@@ -324,7 +326,7 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
if (First < 0 || Last >1) throw Standard_OutOfRange("Approx_CurvlinFunc::Trim");
if ((Last - First) < Tol) return;
Standard_Real FirstU, LastU;
Standard_Real FirstU = NAN, LastU = NAN;
Adaptor3d_CurveOnSurface CurOnSur;
Handle(Adaptor3d_CurveOnSurface) HCurOnSur;
@@ -373,7 +375,7 @@ void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Las
void Approx_CurvlinFunc::Length()
{
Adaptor3d_CurveOnSurface CurOnSur;
Standard_Real FirstU, LastU;
Standard_Real FirstU = NAN, LastU = NAN;
switch(myCase){
case 1:
@@ -408,7 +410,7 @@ void Approx_CurvlinFunc::Length()
Standard_Real Approx_CurvlinFunc::Length(Adaptor3d_Curve& C, const Standard_Real FirstU, const Standard_Real LastU) const
{
Standard_Real Length;
Standard_Real Length = NAN;
Length = GCPnts_AbscissaPoint::Length(C, FirstU, LastU, myTolLen);
return Length;
@@ -422,7 +424,7 @@ Standard_Real Approx_CurvlinFunc::GetLength() const
Standard_Real Approx_CurvlinFunc::GetSParameter(const Standard_Real U) const
{
Standard_Real S=0, S1, S2;
Standard_Real S=0, S1 = NAN, S2 = NAN;
Adaptor3d_CurveOnSurface CurOnSur;
switch (myCase) {
@@ -452,8 +454,8 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
const Standard_Real S,
const Standard_Integer NumberOfCurve) const
{
Standard_Real deltaS, base, U, Length;
Standard_Integer NbInt, NInterval, i;
Standard_Real deltaS = NAN, base = NAN, U = NAN, Length = NAN;
Standard_Integer NbInt = 0, NInterval = 0, i = 0;
Handle(TColStd_HArray1OfReal) InitUArray, InitSArray;
#ifdef OCCT_DEBUG_CHRONO
InitChron(chr_uparam);
@@ -495,7 +497,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
deltaS = (S - InitSArray->Value(NInterval))*Length;
// to find an initial point
Standard_Real Xi[4], Yi[4], UGuess;
Standard_Real Xi[4], Yi[4], UGuess = NAN;
findfourpoints(S, NInterval, InitSArray, InitUArray, myPrevS, myPrevU, Xi, Yi);
UGuess = cubic(S , Xi, Yi);
@@ -515,7 +517,7 @@ Standard_Real Approx_CurvlinFunc::GetUParameter(Adaptor3d_Curve& C,
Standard_Real Approx_CurvlinFunc::GetSParameter(Adaptor3d_Curve& C, const Standard_Real U, const Standard_Real Len) const
{
Standard_Real S, Origin;
Standard_Real S = NAN, Origin = NAN;
Origin = C.FirstParameter();
S = myFirstS + Length(C, Origin, U)/Len;
@@ -528,7 +530,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase1(const Standard_Real S, const Stan
gp_Pnt C;
gp_Vec dC_dU, dC_dS, d2C_dU2, d2C_dS2;
Standard_Real U, Mag, dU_dS, d2U_dS2;
Standard_Real U = NAN, Mag = NAN, dU_dS = NAN, d2U_dS2 = NAN;
U = GetUParameter (*myC3D, S, 1);
@@ -575,7 +577,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase2(const Standard_Real S, const Stan
{
if(myCase != 2) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase2");
Standard_Boolean Done;
Standard_Boolean Done = 0;
Done = EvalCurOnSur(S, Order, Result, 1);
@@ -587,7 +589,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCase3(const Standard_Real S, const Stan
if(myCase != 3) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase3");
TColStd_Array1OfReal tmpRes1(0, 4), tmpRes2(0, 4);
Standard_Boolean Done;
Standard_Boolean Done = 0;
Done = EvalCurOnSur(S, Order, tmpRes1, 1);
@@ -628,7 +630,7 @@ Standard_Boolean Approx_CurvlinFunc::EvalCurOnSur(const Standard_Real S, const S
else
throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCurOnSur");
Standard_Real Mag, dU_dS, d2U_dS2, dV_dU, dW_dU, dV_dS, dW_dS, d2V_dS2, d2W_dS2, d2V_dU2, d2W_dU2;
Standard_Real Mag = NAN, dU_dS = NAN, d2U_dS2 = NAN, dV_dU = NAN, dW_dU = NAN, dV_dS = NAN, dW_dS = NAN, d2V_dS2 = NAN, d2W_dS2 = NAN, d2V_dU2 = NAN, d2W_dU2 = NAN;
gp_Pnt2d C2D;
gp_Pnt C;
gp_Vec2d dC2D_dU, d2C2D_dU2;

View File

@@ -115,13 +115,13 @@ private:
Standard_Integer myCase;
Standard_Real myFirstS;
Standard_Real myLastS;
Standard_Real myFirstU1;
Standard_Real myLastU1;
Standard_Real myFirstU2;
Standard_Real myLastU2;
Standard_Real myLength;
Standard_Real myLength1;
Standard_Real myLength2;
Standard_Real myFirstU1{};
Standard_Real myLastU1{};
Standard_Real myFirstU2{};
Standard_Real myLastU2{};
Standard_Real myLength{};
Standard_Real myLength1{};
Standard_Real myLength2{};
Standard_Real myTolLen;
Standard_Real myPrevS;
Standard_Real myPrevU;

View File

@@ -52,9 +52,9 @@ static void DEBUG(const AppParCurves_MultiCurve& MC) {
Approx_MCurvesToBSpCurve::Approx_MCurvesToBSpCurve()
Approx_MCurvesToBSpCurve::Approx_MCurvesToBSpCurve() : myDone(Standard_False)
{
myDone = Standard_False;
}
void Approx_MCurvesToBSpCurve::Reset()
@@ -78,7 +78,7 @@ void Approx_MCurvesToBSpCurve::Perform
(const AppParCurves_SequenceOfMultiCurve& TheSeq)
{
Standard_Integer i, j, deg=0;
Standard_Integer i = 0, j = 0, deg=0;
Standard_Integer nbcu = TheSeq.Length();
AppParCurves_MultiCurve CU;
Standard_Integer nbpolesspl=0, nbknots=0;
@@ -167,8 +167,8 @@ void Approx_MCurvesToBSpCurve::Perform
}
Standard_Integer kpol = 1, kpoles3d=1, kpoles2d=1;
Standard_Integer mydegre, k;
Standard_Integer first, last, Inc, thefirst;
Standard_Integer mydegre = 0, k = 0;
Standard_Integer first = 0, last = 0, Inc = 0, thefirst = 0;
if (nb3d != 0) thefirst = 1;
else thefirst = 2;

View File

@@ -14,6 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <Approx_SameParameter.hxx>
#include <Adaptor2d_Curve2d.hxx>
@@ -46,12 +48,12 @@ public:
Poles(thePoles),
HCurve2d(theHCurve2d) {}
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
const TColStd_Array1OfReal& FlatKnots;
@@ -119,7 +121,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue,
gp_Pnt a_point;
gp_Vec vector, d1, d2;
Standard_Real func, func_derivative,
Standard_Real func = NAN, func_derivative = NAN,
param = InitValue;
Status = Standard_False;
do
@@ -236,7 +238,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
Standard_Real t = unsurnn*i;
Standard_Real tc3d = pc3d[0]*(1.0 - t) + pc3d[nbp - 1] * t; // weight function.
gp_Pnt Pc3d = c3d->Value(tc3d);
Standard_Real tcons;
Standard_Real tcons = NAN;
BSplCLib::Eval(tc3d, Standard_False, 0, extrap_mode[0],
aDegree, FlatKnots, 1, (Standard_Real&)Poles(1), tcons);
@@ -276,11 +278,11 @@ Approx_SameParameter::Approx_SameParameter(const Handle(Geom_Curve)& C3D,
const Standard_Real Tol)
: myDeltaMin(Precision::PConfusion()),
mySameParameter(Standard_True),
myDone(Standard_False)
myDone(Standard_False), myHCurve2d(new Geom2dAdaptor_Curve(C2D)), myC3d(new GeomAdaptor_Curve(C3D)), mySurf(new GeomAdaptor_Surface(S))
{
myHCurve2d = new Geom2dAdaptor_Curve(C2D);
myC3d = new GeomAdaptor_Curve(C3D);
mySurf = new GeomAdaptor_Surface(S);
Build(Tol);
}
@@ -294,11 +296,11 @@ Approx_SameParameter::Approx_SameParameter(const Handle(Adaptor3d_Curve)& C3D,
const Standard_Real Tol)
: myDeltaMin(Precision::PConfusion()),
mySameParameter(Standard_True),
myDone(Standard_False)
myDone(Standard_False), myHCurve2d(new Geom2dAdaptor_Curve(C2D)), myC3d(C3D), mySurf(S)
{
myC3d = C3D;
mySurf = S;
myHCurve2d = new Geom2dAdaptor_Curve(C2D);
Build(Tol);
}
@@ -312,11 +314,11 @@ Approx_SameParameter::Approx_SameParameter(const Handle(Adaptor3d_Curve)& C3D,
const Standard_Real Tol)
: myDeltaMin(Precision::PConfusion()),
mySameParameter(Standard_True),
myDone(Standard_False)
myDone(Standard_False), myHCurve2d(C2D), myC3d(C3D), mySurf(S)
{
myC3d = C3D;
mySurf = S;
myHCurve2d = C2D;
Build(Tol);
}
@@ -657,7 +659,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D
Projector.Initialize (*myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol);
Standard_Integer count = 1;
Standard_Real previousp = theData.myC3dPF, initp=0, curp;
Standard_Real previousp = theData.myC3dPF, initp=0, curp = NAN;
Standard_Real bornesup = theData.myC3dPL - myDeltaMin;
Standard_Boolean isProjOk = Standard_False;
for (Standard_Integer ii = 1; ii < theData.myNbPnt; ii++)
@@ -813,7 +815,7 @@ Standard_Boolean Approx_SameParameter::Interpolate(const Approx_SameParameter_Da
thePoles(ii) = theData.myPC2d[ii - 2];
aParameters(ii) = theFlatKnots(ii+2) = theData.myPC3d[ii - 2];
}
Standard_Integer inversion_problem;
Standard_Integer inversion_problem = 0;
BSplCLib::Interpolate(3,theFlatKnots,aParameters,ContactOrder,
1,thePoles(1),inversion_problem);
if(inversion_problem)
@@ -842,7 +844,7 @@ Standard_Boolean Approx_SameParameter::IncreaseNbPoles(const TColStd_Array1OfRea
const Standard_Integer aDegree = 3;
const Standard_Integer DerivativeRequest = 0;
Standard_Integer extrap_mode[2] = {aDegree, aDegree};
Standard_Real eval_result;
Standard_Real eval_result = NAN;
Standard_Real *PolesArray = (Standard_Real *) &thePoles(thePoles.Lower());
Standard_Integer newcount = 0;
for (Standard_Integer ii = 0; ii < theData.myNbPnt; ii++)

View File

@@ -186,7 +186,7 @@ private:
Standard_Boolean mySameParameter;
Standard_Boolean myDone;
Standard_Real myTolReached;
Standard_Real myTolReached{};
Handle(Geom2d_Curve) myCurve2d;
Handle(Adaptor2d_Curve2d) myHCurve2d;
Handle(Adaptor3d_Curve) myC3d;

View File

@@ -15,6 +15,8 @@
// commercial license or contractual agreement.
#include <math.h>
#include <AdvApprox_ApproxAFunction.hxx>
#include <AdvApprox_DichoCutting.hxx>
#include <AdvApprox_PrefAndRec.hxx>
@@ -37,12 +39,12 @@ class Approx_SweepApproximation_Eval : public AdvApprox_EvaluatorFunction
Approx_SweepApproximation_Eval (Approx_SweepApproximation& theTool)
: Tool(theTool) {}
virtual void Evaluate (Standard_Integer *Dimension,
void Evaluate (Standard_Integer *Dimension,
Standard_Real StartEnd[2],
Standard_Real *Parameter,
Standard_Integer *DerivativeRequest,
Standard_Real *Result, // [Dimension]
Standard_Integer *ErrorCode);
Standard_Integer *ErrorCode) override;
private:
Approx_SweepApproximation &Tool;
@@ -60,14 +62,14 @@ void Approx_SweepApproximation_Eval::Evaluate (Standard_Integer *,/*Dimension*/
}
Approx_SweepApproximation::
Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func)
Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func) : myFunc(Func), myParam(0), myOrder(-1), first(1.e100), last(-1.e100), done(Standard_False)
{
myFunc = Func;
// Init of variables of control
myParam = 0;
myOrder = -1;
first = 1.e100; last = -1.e100;
done = Standard_False;
}
void Approx_SweepApproximation::Perform(const Standard_Real First,
@@ -80,8 +82,8 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
const Standard_Integer Degmax,
const Standard_Integer Segmax)
{
Standard_Integer NbPolSect, NbKnotSect, ii;
Standard_Real Tol, Tol3dMin = Tol3d, The3D2DTol=0 ;
Standard_Integer NbPolSect = 0, NbKnotSect = 0, ii = 0;
Standard_Real Tol = NAN, Tol3dMin = Tol3d, The3D2DTol=0 ;
GeomAbs_Shape continuity = Continuity;
// (1) Characteristics of a section
@@ -107,7 +109,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
if (ThreeDTol->Value(ii) < Tol3dMin) Tol3dMin = ThreeDTol->Value(ii);
if (myFunc->IsRational()) {
Standard_Real Size;
Standard_Real Size = NAN;
Num1DSS = NbPolSect;
TColStd_Array1OfReal Wmin(1, Num1DSS);
myFunc->GetMinimalWeight(Wmin);
@@ -129,7 +131,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
else {
// for 2d define affinity using resolutions, to
// avoid homogenuous tolerance of approximation (u/v and 2d/3d)
Standard_Real res, tolu, tolv;
Standard_Real res = NAN, tolu = NAN, tolv = NAN;
TwoDTol = new (TColStd_HArray1OfReal) (1, Num2DSS);
AAffin = new (Approx_HArray1OfGTrsf2d) (1, Num2DSS);
The3D2DTol= 0.9*BoundTol; // 10% of security
@@ -175,7 +177,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
// Checks if myFunc->D2 is implemented
if (continuity >= GeomAbs_C2) {
Standard_Boolean B;
Standard_Boolean B = 0;
B = myFunc->D2(First, First, Last,
myPoles->ChangeArray1(), myDPoles->ChangeArray1(),
myD2Poles->ChangeArray1(),
@@ -187,7 +189,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
}
// Checks if myFunc->D1 is implemented
if (continuity == GeomAbs_C1) {
Standard_Boolean B;
Standard_Boolean B = 0;
B = myFunc->D1(First, First, Last,
myPoles->ChangeArray1(), myDPoles->ChangeArray1(),
myPoles2d->ChangeArray1(), myDPoles2d->ChangeArray1(),
@@ -267,7 +269,7 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
if (done) {
// --> Fill Champs of the surface ----
Standard_Integer ii, jj;
Standard_Integer ii = 0, jj = 0;
vdeg = Approx.Degree();
// Unfortunately Adv_Approx stores the transposition of the required
@@ -279,7 +281,7 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
(1, Num3DSS, 1, Approx.NbPoles());
if (Num1DSS == Num3DSS) {
Standard_Real wpoid;
Standard_Real wpoid = NAN;
gp_Pnt P;
for (ii=1; ii <=Num3DSS; ii++) {
for (jj=1; jj <=Approx.NbPoles() ; jj++) {
@@ -384,7 +386,7 @@ Standard_Boolean Approx_SweepApproximation::D0(const Standard_Real Param,
const Standard_Real Last,
Standard_Real& Result)
{
Standard_Integer index, ii;
Standard_Integer index = 0, ii = 0;
Standard_Boolean Ok=Standard_True;
Standard_Real * LocalResult = &Result;
@@ -448,7 +450,7 @@ Standard_Boolean Approx_SweepApproximation::D1(const Standard_Real Param,
{
gp_XY Vcoord;
gp_Vec Vaux;
Standard_Integer index, ii;
Standard_Integer index = 0, ii = 0;
Standard_Boolean Ok=Standard_True;
Standard_Real * LocalResult = &Result;
@@ -525,7 +527,7 @@ Standard_Boolean Approx_SweepApproximation::D2(const Standard_Real Param,
{
gp_XY Vcoord;
gp_Vec Vaux;
Standard_Integer index, ii;
Standard_Integer index = 0, ii = 0;
Standard_Boolean Ok=Standard_True;
Standard_Real * LocalResult = &Result;
@@ -642,8 +644,8 @@ Surface(TColgp_Array2OfPnt& TPoles,
Standard_Real Approx_SweepApproximation::MaxErrorOnSurf() const
{
Standard_Integer ii;
Standard_Real MaxError = 0, err;
Standard_Integer ii = 0;
Standard_Real MaxError = 0, err = NAN;
if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
if (myFunc->IsRational()) {
@@ -666,8 +668,8 @@ Standard_Real Approx_SweepApproximation::MaxErrorOnSurf() const
Standard_Real Approx_SweepApproximation::AverageErrorOnSurf() const
{
Standard_Integer ii;
Standard_Real MoyError = 0, err;
Standard_Integer ii = 0;
Standard_Real MoyError = 0, err = NAN;
if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
if (myFunc->IsRational()) {

View File

@@ -164,12 +164,12 @@ private:
Handle(Approx_SweepFunction) myFunc;
Standard_Boolean done;
Standard_Integer Num1DSS;
Standard_Integer Num2DSS;
Standard_Integer Num3DSS;
Standard_Integer udeg;
Standard_Integer vdeg;
Standard_Integer deg2d;
Standard_Integer Num1DSS{};
Standard_Integer Num2DSS{};
Standard_Integer Num3DSS{};
Standard_Integer udeg{};
Standard_Integer vdeg{};
Standard_Integer deg2d{};
Handle(TColgp_HArray2OfPnt) tabPoles;
Handle(TColStd_HArray2OfReal) tabWeights;
Handle(TColStd_HArray1OfReal) tabUKnots;

View File

@@ -11,6 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <ApproxInt_KnotTools.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
@@ -45,8 +47,8 @@ static Standard_Real EvalCurv(const Standard_Real dim,
// V1^V2 is outer product of two vectors:
// P(i,j) = V1(i)*V2(j) - V1(j)*V2(i);
Standard_Real mp = 0.;
Standard_Integer i, j;
Standard_Real p;
Standard_Integer i = 0, j = 0;
Standard_Real p = NAN;
for(i = 1; i < dim; ++i)
{
for(j = 0; j < i; ++j)
@@ -100,7 +102,7 @@ void ApproxInt_KnotTools::BuildCurvature(
{
// Arrays are allocated for max theDim = 7: 1 3d curve + 2 2d curves.
Standard_Real Val[21], Par[3], Res[21];
Standard_Integer i, j, m, ic;
Standard_Integer i = 0, j = 0, m = 0, ic = 0;
Standard_Integer dim = theDim;
//
theMaxCurv = 0.;
@@ -189,7 +191,7 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
Standard_Real aMaxCurv = 0.;
BuildCurvature(theCoords, theDim, thePars, aCurv, aMaxCurv);
//
Standard_Integer i, j, dim = theDim;
Standard_Integer i = 0, j = 0, dim = theDim;
#ifdef APPROXINT_KNOTTOOLS_DEBUG
std::cout << "Discrete curvature array is" << std::endl;
for(i = aCurv.Lower(); i <= aCurv.Upper(); ++i)
@@ -250,7 +252,7 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
#endif
//III: Put knots in monotone intervals of curvature.
Standard_Boolean Ok;
Standard_Boolean Ok = 0;
i = 1;
do
{
@@ -280,7 +282,7 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray<Standard_
icm = (anInd - aCurv.Lower()) * theDim;
NCollection_LocalArray<Standard_Real> V1(theDim), V2(theDim);
Standard_Real mp = 0., m1 = 0., m2 = 0.;
Standard_Real p;
Standard_Real p = NAN;
for(Standard_Integer k = 0; k < theDim; ++k)
{
V1[k] = theCoords[icm + k] - theCoords[ici + k];
@@ -482,7 +484,7 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI(const Standard_Integer theI,
}
//
Standard_Real curv = 0.5*(theCurv(anInd) + theCurv(anInd1));
Standard_Integer mid = 0, j, jj;
Standard_Integer mid = 0, j = 0, jj = 0;
const Standard_Real aLimitCurvatureChange = 3.0;
for(j = anInd+1; j < anInd1; ++j)
{
@@ -532,9 +534,9 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI(const Standard_Integer theI,
ici1 = (anInd1 - theCurv.Lower()) * theDim,
icm = (mid - theCurv.Lower()) * theDim;
NCollection_LocalArray<Standard_Real> V1(theDim), V2(theDim);
Standard_Integer i;
Standard_Integer i = 0;
Standard_Real mp = 0., m1 = 0., m2 = 0.;
Standard_Real p;
Standard_Real p = NAN;
for(i = 0; i < theDim; ++i)
{
V1[i] = theCoords[icm + i] - theCoords[ici + i];
@@ -596,7 +598,7 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
aDim += 2;
NCollection_LocalArray<Standard_Real> aCoords(thePars.Length()*aDim);
Standard_Integer i, j;
Standard_Integer i = 0, j = 0;
for(i = thePars.Lower(); i <= thePars.Upper(); ++i)
{
j = (i - thePars.Lower()) * aDim;
@@ -654,7 +656,7 @@ void ApproxInt_KnotTools::BuildKnots(const TColgp_Array1OfPnt& thePntsXYZ,
//=======================================================================
static Standard_Real MaxParamRatio(const math_Vector& thePars)
{
Standard_Integer i;
Standard_Integer i = 0;
Standard_Real aMaxRatio = 0.;
//
for (i = thePars.Lower() + 1; i < thePars.Upper(); ++i)
@@ -694,7 +696,7 @@ Approx_ParametrizationType ApproxInt_KnotTools::DefineParType(
TColgp_Array1OfPnt2d aPntU1V1(theFpar, theLpar);
TColgp_Array1OfPnt2d aPntU2V2(theFpar, theLpar);
Standard_Integer i, j;
Standard_Integer i = 0, j = 0;
for (i = theFpar; i <= theLpar; ++i)
{

View File

@@ -40,9 +40,9 @@ Quantity_Color MatraGray (Quantity_NOC_MATRAGRAY);
}
Aspect_Background::Aspect_Background (const Quantity_Color& AColor) {
Aspect_Background::Aspect_Background (const Quantity_Color& AColor) : MyColor(AColor) {
MyColor = AColor;
}

View File

@@ -80,7 +80,7 @@ void Aspect_CircularGrid::Compute(const Standard_Real X,
Standard_Real cs=0,sn=0;
Standard_Boolean done = Standard_False;
Standard_Integer nmax = 2*myDivisionNumber;
Standard_Integer nquad,qmax;
Standard_Integer nquad = 0,qmax = 0;
if( ra == 0. ) {
nquad = 4; qmax = nmax/nquad;

View File

@@ -56,9 +56,9 @@ private:
Standard_Real myRadiusStep;
Standard_Integer myDivisionNumber;
Standard_Real myAlpha;
Standard_Real myA1;
Standard_Real myB1;
Standard_Real myAlpha{};
Standard_Real myA1{};
Standard_Real myB1{};
};

14
src/Aspect/Aspect_DisplayConnection.cxx Executable file → Normal file
View File

@@ -27,13 +27,13 @@ IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient)
// function : Aspect_DisplayConnection
// purpose :
// =======================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection()
Aspect_DisplayConnection::Aspect_DisplayConnection() : myDisplay(NULL), myDefVisualInfo(NULL), myDefFBConfig(NULL), myIsOwnDisplay(false)
{
#if defined(HAVE_XLIB)
myDisplay = NULL;
myDefVisualInfo = NULL;
myDefFBConfig = NULL;
myIsOwnDisplay = false;
OSD_Environment anEnv ("DISPLAY");
myDisplayName = anEnv.Value();
Init (NULL);
@@ -67,9 +67,9 @@ Aspect_DisplayConnection::Aspect_DisplayConnection (const TCollection_AsciiStrin
: myDisplay (NULL),
myDefVisualInfo (NULL),
myDefFBConfig (NULL),
myIsOwnDisplay (false)
myDisplayName(theDisplayName), myIsOwnDisplay (false)
{
myDisplayName = theDisplayName;
Init (NULL);
}

View File

@@ -16,23 +16,23 @@
#include <Aspect_GradientBackground.hxx>
Aspect_GradientBackground::Aspect_GradientBackground () {
Aspect_GradientBackground::Aspect_GradientBackground () : MyGradientMethod(Aspect_GradientFillMethod_None) {
Quantity_Color Black (Quantity_NOC_BLACK);
SetColor( Black );
MyColor2 = Black;
MyGradientMethod = Aspect_GradientFillMethod_None;
}
Aspect_GradientBackground::Aspect_GradientBackground( const Quantity_Color& AColor1,
const Quantity_Color& AColor2,
const Aspect_GradientFillMethod AMethod )
const Aspect_GradientFillMethod AMethod ) : MyColor2(AColor2), MyGradientMethod(AMethod)
{
SetColor( AColor1 );
MyColor2 = AColor2;
MyGradientMethod = AMethod;
}

View File

@@ -75,12 +75,12 @@ private:
Standard_Real myYStep;
Standard_Real myFirstAngle;
Standard_Real mySecondAngle;
Standard_Real a1;
Standard_Real b1;
Standard_Real c1;
Standard_Real a2;
Standard_Real b2;
Standard_Real c2;
Standard_Real a1{};
Standard_Real b1{};
Standard_Real c1{};
Standard_Real a2{};
Standard_Real b2{};
Standard_Real c2{};
};

View File

@@ -170,7 +170,7 @@ protected:
Aspect_Background MyBackground;
Aspect_GradientBackground MyGradientBackground;
Aspect_FillMethod MyBackgroundFillMethod;
Standard_Boolean MyIsVirtual;
Standard_Boolean MyIsVirtual{};
};

View File

@@ -260,7 +260,7 @@ protected:
protected: //! @name 3d mouse input variables
bool my3dMouseButtonState[32];//!< cached button state
bool my3dMouseButtonState[32]{};//!< cached button state
NCollection_Vec3<bool> my3dMouseNoRotate; //!< ignore 3d mouse rotation axes
NCollection_Vec3<bool> my3dMouseToReverse; //!< reverse 3d mouse rotation axes
float my3dMouseAccelTrans; //!< acceleration ratio for translation event

View File

@@ -12,6 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <math.h>
#include <BOPAlgo_ArgumentAnalyzer.hxx>
#include <BOPAlgo_BuilderFace.hxx>
#include <BOPAlgo_CheckerSI.hxx>
@@ -345,7 +347,7 @@ void BOPAlgo_ArgumentAnalyzer::TestTypes()
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences(const Message_ProgressRange& theRange)
{
Message_ProgressScope aPS(theRange, NULL, (!myShape1.IsNull() && !myShape2.IsNull() ? 2 : 1));
Standard_Integer ii;
Standard_Integer ii = 0;
//
for(ii = 0; ii < 2; ii++) {
const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
@@ -358,7 +360,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences(const Message_ProgressRange
continue;
}
//
Standard_Integer n1, n2;
Standard_Integer n1 = 0, n2 = 0;
BOPDS_MapIteratorOfMapOfPair aItMPK;
TopTools_ListOfShape anArgs;
BOPAlgo_CheckerSI aChecker;
@@ -812,8 +814,8 @@ void BOPAlgo_ArgumentAnalyzer::TestMergeEdge()
// ================================================================================
void BOPAlgo_ArgumentAnalyzer::TestContinuity()
{
Standard_Integer i, j, aNbS;
Standard_Real f, l;
Standard_Integer i = 0, j = 0, aNbS = 0;
Standard_Real f = NAN, l = NAN;
TopExp_Explorer aExp;
//
for (i = 0; i < 2; ++i) {
@@ -869,8 +871,8 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity()
// ================================================================================
void BOPAlgo_ArgumentAnalyzer::TestCurveOnSurface()
{
Standard_Integer i;
Standard_Real aT, aD, aTolE;
Standard_Integer i = 0;
Standard_Real aT = NAN, aD = NAN, aTolE = NAN;
TopExp_Explorer aExpF, aExpE;
//
for(i = 0; i < 2; i++) {

View File

@@ -120,8 +120,8 @@ BOPAlgo_Operation BOPAlgo_BOP::Operation()const
//=======================================================================
void BOPAlgo_BOP::CheckData()
{
Standard_Integer i, j, aNbArgs, aNbTools;
Standard_Boolean bFuse;
Standard_Integer i = 0, j = 0, aNbArgs = 0, aNbTools = 0;
Standard_Boolean bFuse = 0;
TopTools_ListIteratorOfListOfShape aItLS;
//
if (!(myOperation==BOPAlgo_COMMON ||
@@ -178,7 +178,7 @@ void BOPAlgo_BOP::CheckData()
continue;
}
Standard_Integer iDMin, iDMax;
Standard_Integer iDMin = 0, iDMax = 0;
BOPTools_AlgoTools::Dimensions(aS, iDMin, iDMax);
if (iDMin < iDimMin[i])
@@ -355,7 +355,7 @@ void BOPAlgo_BOP::BuildResult(const TopAbs_ShapeEnum theType)
void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange)
{
Handle(NCollection_BaseAllocator) aAllocator;
BOPAlgo_PaveFiller* pPF;
BOPAlgo_PaveFiller* pPF = nullptr;
TopTools_ListIteratorOfListOfShape aItLS;
//
GetReport()->Clear();
@@ -585,8 +585,8 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange)
}
// B. Common, Cut, Cut21
//
Standard_Integer i, j, aNb, iDim;
Standard_Boolean bCheckEdges, bContains, bCut21, bCommon;
Standard_Integer i = 0, j = 0, aNb = 0, iDim = 0;
Standard_Boolean bCheckEdges = 0, bContains = 0, bCut21 = 0, bCommon = 0;
TopTools_ListIteratorOfListOfShape aItLS;
//
// prepare the building elements of arguments to get its splits
@@ -662,7 +662,7 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange)
//
// compare the maps and make the result
//
Standard_Integer iDimMin, iDimMax;
Standard_Integer iDimMin = 0, iDimMax = 0;
//
iDimMin = Min(myDims[0], myDims[1]);
bCommon = (myOperation == BOPAlgo_COMMON);
@@ -755,7 +755,7 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange)
return;
}
// The squats around degenerated edges
Standard_Integer nVD;
Standard_Integer nVD = 0;
TopTools_IndexedMapOfShape aMVC;
//
// 1. Vertices of aC
@@ -841,7 +841,7 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange)
return;
}
//
Standard_Integer i;
Standard_Integer i = 0;
TopAbs_ShapeEnum aType, aT1, aT2;
TopTools_ListOfShape aLSC, aLCB;
TopTools_ListIteratorOfListOfShape aItLS, aItLSIm, aItLCB;
@@ -1044,7 +1044,7 @@ void BOPAlgo_BOP::BuildSolid(const Message_ProgressRange& theRange)
//
// Find solids in input arguments sharing faces with other solids
TopTools_MapOfShape aMTSols;
Standard_Integer i, aNb = aMFS.Extent();
Standard_Integer i = 0, aNb = aMFS.Extent();
for (i = 1; i < aNb; ++i) {
const TopTools_ListOfShape& aLSols = aMFS(i);
if (aLSols.Extent() > 1) {
@@ -1505,7 +1505,7 @@ void RemoveDuplicates(TopTools_ListOfShape& theContainers,
// compare the contents of the containers and find duplicates
TopTools_MapOfShape aDuplicates;
//
Standard_Integer i, j, aNb = aContents.Extent();
Standard_Integer i = 0, j = 0, aNb = aContents.Extent();
for (i = 1; i <= aNb; ++i) {
const TopoDS_Shape& aCi = aContents.FindKey(i);
if (aDuplicates.Contains(aCi)) {

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