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

Compare commits

..

1 Commits

Author SHA1 Message Date
craffael
61f7249b4c 31667: target_link_libraries with public interface for cmake >= 3 2020-07-16 11:12:39 +02:00
534 changed files with 5042 additions and 9120 deletions

View File

@@ -123,6 +123,16 @@ if ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
elseif(MINGW)
# Set default release optimization option to O2 instead of O3, since in
# some OCCT related examples, this gives significantly smaller binaries
# at comparable performace with MinGW-w64.
string (REGEX MATCH "-O3" IS_O3_CXX "${CMAKE_CXX_FLAGS_RELEASE}")
if (IS_O3_CXX)
string (REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
else()
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
endif()
add_definitions(-D_WIN32_WINNT=0x0501)
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")

View File

@@ -323,7 +323,7 @@ endif()
# Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
# Add VTK_OPENGL2_BACKEND definition.
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX)
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
add_definitions(-DVTK_OPENGL2_BACKEND)
foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
@@ -346,10 +346,10 @@ else()
endif()
endif()
if (BUILD_SHARED_LIBS)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.0.0")
# Declare the dependencies public so that all code that uses this library automatically also links with the dependencies
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
elseif (BUILD_SHARED_LIBS)
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
endif()

View File

@@ -66,15 +66,10 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
endif()
unset (IS_VTK_9XX)
if (VTK_FOUND)
message ("VTK version (${VTK_VERSION})")
if(VTK_MAJOR_VERSION EQUAL 8 AND VTK_MINOR_VERSION GREATER 9 OR VTK_MAJOR_VERSION GREATER 8)
set (IS_VTK_9XX 1)
else()
# add compiler flags, preprocessor definitions, include and link dirs
include (${VTK_USE_FILE})
endif()
# add compiler flags, preprocessor definitions, include and link dirs
include (${VTK_USE_FILE})
if (VTK_LIBRARIES)
@@ -86,83 +81,79 @@ if (VTK_FOUND)
# endif()
foreach (VTK_LIBRARY ${VTK_LIBRARIES})
if (IS_VTK_9XX)
string (REGEX MATCH "^VTK::" IS_VTK_LIBRARY ${VTK_LIBRARY})
else()
string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
endif()
if (NOT IS_VTK_LIBRARY OR NOT TARGET ${VTK_LIBRARY})
continue()
endif()
# get paths from corresponding variables
if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
endif()
if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
endif()
if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
if (NOT WIN32)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
if (IS_VTK_LIBRARY AND TARGET ${VTK_LIBRARY})
# get paths from corresponding variables
if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
endif()
endif()
# get paths from corresponding properties
get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
if (TARGET_VTK_IMPORT_CONFS)
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# todo: choose configuration in connection with the build type
#if (CMAKE_BUILD_TYPE)
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
# endforeach()
#endif()
# Work-around against link failure in case if VTK contains dependency
# on DirectX: its run-time is always present on Windows, but SDK can
# be absent on current workstation, while not actually needed for
# OCCT linking.
# VTK 6.1 for VC 10
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
endif()
endif()
# VTK 6.1 for VC 12, 14
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
if (NOT WIN32)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
endif()
endif()
endif()
get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
endif()
# get paths from corresponding properties
get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
if (TARGET_VTK_IMPORT_CONFS)
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
if (WIN32)
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
else()
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
# todo: choose configuration in connection with the build type
#if (CMAKE_BUILD_TYPE)
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
# endforeach()
#endif()
# Work-around against link failure in case if VTK contains dependency
# on DirectX: its run-time is always present on Windows, but SDK can
# be absent on current workstation, while not actually needed for
# OCCT linking.
# VTK 6.1 for VC 10
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
endif()
endif()
# VTK 6.1 for VC 12, 14
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
endif()
endif()
get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
endif()
get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
if (WIN32)
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
else()
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
endif()
endif()
endif()
endif()
endif()
@@ -196,7 +187,6 @@ if (VTK_FOUND)
endif()
endif()
# endif()
endif()
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})

View File

@@ -66,6 +66,6 @@ void OcctJni_MsgPrinter::send (const TCollection_AsciiString& theString,
}
jstring aJStr = myJEnv->NewStringUTF ((theString + "\n").ToCString());
myJEnv->CallVoidMethod (myJObj, myJMet, aJStr);
myJEnv->CallObjectMethod (myJObj, myJMet, aJStr);
myJEnv->DeleteLocalRef (aJStr);
}

View File

@@ -54,14 +54,16 @@ vbsdf s -absorpCoeff 6
# setup first inner box
box c 0.3 0.3 0.2
vdisplay -noupdate c
vlocation -noupdate c -reset -rotate 0 0 0 0 0 1 -30 -translate 0.55 0.3 0.0
vlocation -noupdate c -setLocation 0.55 0.3 0.0
vlocation -noupdate c -rotate 0 0 0 0 0 1 -30
vsetmaterial -noupdate c plastic
vbsdf c -kd 1.0 0.8 0.2 -ks 0.3 -n
# setup second inner box
box g 0.15 0.15 0.3
vdisplay -noupdate g
vlocation -noupdate g -reset -rotate 0 0 0 0 0 1 10 -translate 0.7 0.25 0.2
vlocation -noupdate g -setLocation 0.7 0.25 0.2
vlocation -noupdate g -rotate 0 0 0 0 0 1 10
vsetmaterial -noupdate g glass
vbsdf g -absorpColor 0.8 1.0 0.8
vbsdf g -absorpCoeff 6

View File

@@ -109,13 +109,13 @@ void WasmOcctView::initWindow()
{
myDevicePixelRatio = jsDevicePixelRatio();
myCanvasId = THE_CANVAS_ID;
const char* aTargetId = !myCanvasId.IsEmpty() ? myCanvasId.ToCString() : EMSCRIPTEN_EVENT_TARGET_WINDOW;
const char* aTargetId = !myCanvasId.IsEmpty() ? myCanvasId.ToCString() : NULL;
const EM_BOOL toUseCapture = EM_TRUE;
emscripten_set_resize_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onResizeCallback);
emscripten_set_resize_callback (NULL, this, toUseCapture, onResizeCallback);
emscripten_set_mousedown_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseup_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mousemove_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mousedown_callback (NULL, this, toUseCapture, onMouseCallback);
emscripten_set_mouseup_callback (NULL, this, toUseCapture, onMouseCallback);
emscripten_set_mousemove_callback (NULL, this, toUseCapture, onMouseCallback);
emscripten_set_dblclick_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_click_callback (aTargetId, this, toUseCapture, onMouseCallback);
emscripten_set_mouseenter_callback (aTargetId, this, toUseCapture, onMouseCallback);
@@ -127,9 +127,9 @@ void WasmOcctView::initWindow()
emscripten_set_touchmove_callback (aTargetId, this, toUseCapture, onTouchCallback);
emscripten_set_touchcancel_callback(aTargetId, this, toUseCapture, onTouchCallback);
//emscripten_set_keypress_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyCallback);
emscripten_set_keydown_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyDownCallback);
emscripten_set_keyup_callback (EMSCRIPTEN_EVENT_TARGET_WINDOW, this, toUseCapture, onKeyUpCallback);
//emscripten_set_keypress_callback (NULL, this, toUseCapture, onKeyCallback);
emscripten_set_keydown_callback (NULL, this, toUseCapture, onKeyDownCallback);
emscripten_set_keyup_callback (NULL, this, toUseCapture, onKeyUpCallback);
}
// ================================================================
@@ -396,7 +396,7 @@ EM_BOOL WasmOcctView::onMouseEvent (int theEventType, const EmscriptenMouseEvent
Graphic3d_Vec2i aWinSize;
myView->Window()->Size (aWinSize.x(), aWinSize.y());
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->targetX, theEvent->targetY));
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->canvasX, theEvent->canvasY));
Aspect_VKeyFlags aFlags = 0;
if (theEvent->ctrlKey == EM_TRUE) { aFlags |= Aspect_VKeyFlags_CTRL; }
if (theEvent->shiftKey == EM_TRUE) { aFlags |= Aspect_VKeyFlags_SHIFT; }
@@ -477,7 +477,7 @@ EM_BOOL WasmOcctView::onWheelEvent (int theEventType, const EmscriptenWheelEvent
Graphic3d_Vec2i aWinSize;
myView->Window()->Size (aWinSize.x(), aWinSize.y());
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->mouse.targetX, theEvent->mouse.targetY));
const Graphic3d_Vec2i aNewPos = convertPointToBacking (Graphic3d_Vec2i (theEvent->mouse.canvasX, theEvent->mouse.canvasY));
if (aNewPos.x() < 0 || aNewPos.x() > aWinSize.x()
|| aNewPos.y() < 0 || aNewPos.y() > aWinSize.y())
{

View File

@@ -19,13 +19,6 @@
//! Global viewer instance.
static WasmOcctView aViewer;
//! Dummy main loop callback for a single shot.
extern "C" void onMainLoop()
{
// do nothing here - viewer updates are handled on demand
emscripten_cancel_main_loop();
}
//! File data read event.
extern "C" void onFileDataRead (void* theOpaque, void* theBuffer, int theDataLen)
{
@@ -67,10 +60,6 @@ int main()
Handle(Message_PrinterSystemLog) aJSConsolePrinter = new Message_PrinterSystemLog ("webgl-sample", Message_Trace);
Message::DefaultMessenger()->AddPrinter (aJSConsolePrinter); // open JavaScript console within the Browser to see this output
Message::DefaultMessenger()->Send (TCollection_AsciiString("NbLogicalProcessors: ") + OSD_Parallel::NbLogicalProcessors(), Message_Trace);
// setup a dummy single-shot main loop callback just to shut up a useless Emscripten error message on calling eglSwapInterval()
emscripten_set_main_loop (onMainLoop, -1, 0);
aViewer.run();
Message::DefaultMessenger()->Send (OSD_MemInfo::PrintInfo(), Message_Trace);

View File

@@ -69,7 +69,6 @@ var Module =
printErr: function(theText) {
//var anElement = document.getElementById('output');
//anElement.innerHTML += theText + "<br>";
console.warn(theText);
},
canvas: (function() {
var aCanvas = document.getElementById('canvas');
@@ -86,12 +85,11 @@ fileInput.onchange = function()
var aReader = new FileReader();
aReader.onload = function()
{
var aNameLenBytes = lengthBytesUTF8(aFile.name) + 1;
const aNameBuffer = Module._malloc(aNameLenBytes);
stringToUTF8(aFile.name, aNameBuffer, aNameLenBytes);
var aDataArray = new Uint8Array (aReader.result);
var aNameArray = new Uint8Array (toUtf8Array (aFile.name));
const aDataBuffer = Module._malloc(aDataArray.length);
const aNameBuffer = Module._malloc(aNameArray.length);
Module.HEAPU8.set(aNameArray, aNameBuffer);
Module.HEAPU8.set(aDataArray, aDataBuffer);
Module.ccall('onFileDataRead', null, ['number', 'number', 'number'], [aNameBuffer, aDataBuffer, aDataArray.length]);
Module._free(aDataBuffer);
@@ -100,6 +98,35 @@ fileInput.onchange = function()
};
aReader.readAsArrayBuffer(aFile);
};
//! Convert string into UTF-8 array.
function toUtf8Array (theText)
{
var aRes = [];
for (var aCharIter = 0; aCharIter < theText.length; ++aCharIter)
{
var aCharCode = theText.charCodeAt (aCharIter);
if (aCharCode < 0x80)
{
aRes.push (aCharCode);
}
else if (aCharCode < 0x800)
{
aRes.push (0xc0 | (aCharCode >> 6), 0x80 | (aCharCode & 0x3f));
}
else if (aCharCode < 0xd800 || aCharCode >= 0xe000)
{
aRes.push (0xe0 | (aCharCode >> 12), 0x80 | ((aCharCode>>6) & 0x3f), 0x80 | (aCharCode & 0x3f));
}
else
{
++aCharIter;
aCharCode = 0x10000 + (((aCharCode & 0x3ff)<<10) | (theText.charCodeAt (aCharIter) & 0x3ff));
aRes.push(0xf0 | (aCharCode >>18), 0x80 | ((aCharCode>>12) & 0x3f), 0x80 | ((aCharCode>>6) & 0x3f), 0x80 | (aCharCode & 0x3f));
}
}
return aRes;
}
</script>
<script type="text/javascript" src="occt-webgl-sample.js" charset="utf-8"></script>
</body>

View File

@@ -44,7 +44,6 @@ AIS_RubberBand::AIS_RubberBand()
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (1.0);
@@ -67,7 +66,6 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (1.0);
@@ -93,7 +91,6 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
myDrawer->ShadingAspect()->SetColor (theFillColor);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
myDrawer->ShadingAspect()->SetTransparency (theTransparency);

View File

@@ -119,7 +119,7 @@ AIS_ViewController::AIS_ViewController()
myAnchorPointPrs2->SetZLayer (Graphic3d_ZLayerId_Topmost);
myAnchorPointPrs2->SetMutable (true);
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE4, 0.5, 1.0);
myRubberBand = new AIS_RubberBand (Quantity_NOC_LIGHTBLUE, Aspect_TOL_SOLID, Quantity_NOC_LIGHTBLUE, 0.4, 1.0);
myRubberBand->SetZLayer (Graphic3d_ZLayerId_TopOSD);
myRubberBand->SetTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_2d, Aspect_TOTP_LEFT_UPPER));
myRubberBand->SetDisplayMode (0);

View File

@@ -22,9 +22,7 @@
IMPLEMENT_STANDARD_RTTIEXT(Adaptor3d_HVertex,Standard_Transient)
Adaptor3d_HVertex::Adaptor3d_HVertex ()
: myTol(0.0)
{
}
{}
Adaptor3d_HVertex::Adaptor3d_HVertex (const gp_Pnt2d& P,

View File

@@ -60,17 +60,8 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real&
}
Adaptor3d_TopolTool::Adaptor3d_TopolTool ()
: myNbSamplesU(-1),
myNbSamplesV(-1),
nbRestr(0),
idRestr(0),
Uinf(0.0),
Usup(0.0),
Vinf(0.0),
Vsup(0.0),
nbVtx(0),
idVtx(0)
Adaptor3d_TopolTool::Adaptor3d_TopolTool () : myNbSamplesU(-1),nbRestr(0),idRestr(0)
{
}

View File

@@ -62,18 +62,6 @@ static Standard_Boolean lesparam(const Standard_Integer iordre,
AdvApp2Var_Context::
AdvApp2Var_Context()
: myFav(0),
myOrdU(0),
myOrdV(0),
myLimU(0),
myLimV(0),
myNb1DSS(0),
myNb2DSS(0),
myNb3DSS(0),
myNbURoot(0),
myNbVRoot(0),
myJDegU(0),
myJDegV(0)
{
}

View File

@@ -49,25 +49,7 @@ Standard_EXPORT Standard_Boolean AppBlend_GetContextApproxWithNoTgt();
//purpose :
//=======================================================================
AppBlend_AppSurf::AppBlend_AppSurf ()
: done(Standard_False),
dmin(0),
dmax(0),
tol3d(0.0),
tol2d(0.0),
nbit(0),
udeg(0),
vdeg(0),
knownp(Standard_False),
tol3dreached(0.0),
tol2dreached(0.0),
paramtype(Approx_ChordLength),
continuity(GeomAbs_C2)
{
critweights[0]=0.4;
critweights[1]=0.2;
critweights[2]=0.4;
}
AppBlend_AppSurf::AppBlend_AppSurf ():done(Standard_False) {}
//=======================================================================
@@ -80,21 +62,12 @@ AppBlend_AppSurf::AppBlend_AppSurf (const Standard_Integer Degmin,
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Integer NbIt,
const Standard_Boolean KnownParameters)
: done(Standard_False),
dmin(Degmin),
dmax(Degmax),
tol3d(Tol3d),
tol2d(Tol2d),
nbit(NbIt),
udeg(0),
vdeg(0),
knownp(KnownParameters),
tol3dreached(0.0),
tol2dreached(0.0),
paramtype(Approx_ChordLength),
continuity(GeomAbs_C2)
const Standard_Boolean KnownParameters):
done(Standard_False),dmin(Degmin),dmax(Degmax),
tol3d(Tol3d),tol2d(Tol2d),nbit(NbIt),knownp(KnownParameters)
{
continuity = GeomAbs_C2;
paramtype = Approx_ChordLength;
critweights[0]=0.4;
critweights[1]=0.2;
critweights[2]=0.4;

View File

@@ -54,16 +54,9 @@ AppDef_LinearCriteria::AppDef_LinearCriteria(const AppDef_MultiLine& SSP,
const Standard_Integer FirstPoint,
const Standard_Integer LastPoint):
mySSP(SSP),
myQuadraticWeight(0.0),
myQualityWeight(0.0),
myPntWeight(FirstPoint, LastPoint),
myLength(0.0),
myE(0),
IF(0),
IL(0)
myE(0)
{
memset (myEstimation, 0, sizeof (myEstimation));
memset (myPercent, 0, sizeof (myPercent));
myPntWeight.Init(1.);
}
@@ -360,73 +353,53 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min,
// (critere sureleve => Non minimisation )
for(i = 0; i <= 2; i++)
{
if((ValCri[i] < 0.8 * myEstimation[i]) && (myEstimation[i] > JEsMin[i])) {
if(ICDANA < 1) ICDANA = 1;
if(ValCri[i] < 0.1 * myEstimation[i]) ICDANA = 2;
myEstimation[i] = Max(1.05*ValCri[i], JEsMin[i]);
}
}
// (3) Mise a jours des Estimation
// (critere sous-estimer => mauvais conditionement)
if (ValCri[0] > myEstimation[0] * 2)
{
myEstimation[0] += ValCri[0] * .1;
if (ICDANA == 0)
{
if (ValCri[0] > myEstimation[0] * 10)
{
ICDANA = 2;
}
else
{
ICDANA = 1;
}
if (ValCri[0] > myEstimation[0] * 2) {
myEstimation[0] += ValCri[0] * .1;
if (ICDANA == 0) {
if (ValCri[0] > myEstimation[0] * 10) {
ICDANA = 2;
}
else ICDANA = 1;
}
else {
ICDANA = 2;
}
}
else
{
ICDANA = 2;
if (ValCri[1] > myEstimation[1] * 20) {
myEstimation[1] += ValCri[1] * .1;
if (ICDANA == 0) {
if (ValCri[1] > myEstimation[1] * 100) {
ICDANA = 2;
}
else ICDANA = 1;
}
else {
ICDANA = 2;
}
}
}
if (ValCri[1] > myEstimation[1] * 20)
{
myEstimation[1] += ValCri[1] * .1;
if (ICDANA == 0)
{
if (ValCri[1] > myEstimation[1] * 100)
{
ICDANA = 2;
}
else
{
ICDANA = 1;
}
if (ValCri[2] > myEstimation[2] * 20) {
myEstimation[2] += ValCri[2] * .05;
if (ICDANA == 0) {
if (ValCri[2] > myEstimation[2] * 100) {
ICDANA = 2;
}
else ICDANA = 1;
}
else {
ICDANA = 2;
}
}
else
{
ICDANA = 2;
}
}
if (ValCri[2] > myEstimation[2] * 20)
{
myEstimation[2] += ValCri[2] * .05;
if (ICDANA == 0)
{
if (ValCri[2] > myEstimation[2] * 100)
{
ICDANA = 2;
}
else
{
ICDANA = 1;
}
}
else
{
ICDANA = 2;
}
}
return ICDANA;
}

View File

@@ -16,11 +16,7 @@
#include <AppParCurves_ConstraintCouple.hxx>
AppParCurves_ConstraintCouple::
AppParCurves_ConstraintCouple()
: myIndex(-1),
myConstraint(AppParCurves_NoConstraint)
{
}
AppParCurves_ConstraintCouple() {}
AppParCurves_ConstraintCouple::

View File

@@ -58,11 +58,7 @@ AppParCurves_Gradient::
const Standard_Real Tol3d,
const Standard_Real Tol2d,
const Standard_Integer NbIterations):
ParError(FirstPoint, LastPoint,0.0),
AvError(0.0),
MError3d(0.0),
MError2d(0.0)
{
ParError(FirstPoint, LastPoint,0.0) {
// Standard_Boolean grad = Standard_True;
Standard_Integer j, k, i2, l;

View File

@@ -46,10 +46,7 @@ static Standard_Integer ComputeDegree(const TColStd_Array1OfInteger& mults,
//purpose :
//=======================================================================
AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve()
: myDegree(0)
{
}
AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve() {}
//=======================================================================
@@ -59,8 +56,7 @@ AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve()
AppParCurves_MultiBSpCurve::AppParCurves_MultiBSpCurve
(const Standard_Integer NbPol):
AppParCurves_MultiCurve(NbPol),
myDegree(0)
AppParCurves_MultiCurve(NbPol)
{
}

View File

@@ -25,11 +25,7 @@
#define tabPoint Handle(TColgp_HArray1OfPnt)::DownCast (ttabPoint)
#define tabPoint2d Handle(TColgp_HArray1OfPnt2d)::DownCast (ttabPoint2d)
AppParCurves_MultiPoint::AppParCurves_MultiPoint()
: nbP(0),
nbP2d(0)
{
}
AppParCurves_MultiPoint::AppParCurves_MultiPoint() {}
AppParCurves_MultiPoint::AppParCurves_MultiPoint (const Standard_Integer NbPoles,

View File

@@ -56,9 +56,6 @@ const AppParCurves_Constraint LastC)
myInvOrder = Standard_True;
myHangChecking = Standard_True;
alldone = Standard_False;
tolreached = Standard_False;
currenttol3d = 0.0;
currenttol2d = 0.0;
Perform(Line);
}
@@ -87,9 +84,6 @@ const AppParCurves_Constraint LastC)
myMaxSegments = MAXSEGM;
myInvOrder = Standard_True;
myHangChecking = Standard_True;
tolreached = Standard_False;
currenttol3d = 0.0;
currenttol2d = 0.0;
}
//=======================================================================

View File

@@ -133,8 +133,6 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor3d_
const GeomAbs_Shape Order,
const Standard_Integer MaxDegree,
const Standard_Integer MaxSegments)
: myMaxError2d1(0.0),
myMaxError2d2(0.0)
{
#ifdef OCCT_DEBUG_CHRONO
t_total = t_init = t_approx = t_uparam = 0;

View File

@@ -329,9 +329,7 @@ static Standard_Boolean NonSingularProcessing(const gp_Vec& theDU,
//--------------------------------------------------------------------------------
ApproxInt_ImpPrmSvSurfaces::ApproxInt_ImpPrmSvSurfaces( const TheISurface& ISurf
,const ThePSurface& PSurf):
MyIsTangent(Standard_False),
MyHasBeenComputed(Standard_False),
MyIsTangentbis(Standard_False),
MyHasBeenComputedbis(Standard_False),
MyImplicitFirst(Standard_True),
MyZerImpFunc(PSurf,ISurf)
@@ -340,9 +338,7 @@ ApproxInt_ImpPrmSvSurfaces::ApproxInt_ImpPrmSvSurfaces( const TheISurface& ISurf
//--------------------------------------------------------------------------------
ApproxInt_ImpPrmSvSurfaces::ApproxInt_ImpPrmSvSurfaces( const ThePSurface& PSurf
,const TheISurface& ISurf):
MyIsTangent(Standard_False),
MyHasBeenComputed(Standard_False),
MyIsTangentbis(Standard_False),
MyHasBeenComputedbis(Standard_False),
MyImplicitFirst(Standard_False),
MyZerImpFunc(PSurf,ISurf)

View File

@@ -29,9 +29,7 @@
//--------------------------------------------------------------------------------
ApproxInt_PrmPrmSvSurfaces::ApproxInt_PrmPrmSvSurfaces( const ThePSurface& Surf1
,const ThePSurface& Surf2):
MyIsTangent(Standard_False),
MyHasBeenComputed(Standard_False),
MyIsTangentbis(Standard_False),
MyHasBeenComputedbis(Standard_False),
MyIntersectionOn2S(Surf1,Surf2,TOLTANGENCY)
{

View File

@@ -26,10 +26,7 @@
//=======================================================================
BRepBlend_CurvPointRadInv::BRepBlend_CurvPointRadInv
(const Handle(Adaptor3d_HCurve)& C1,
const Handle(Adaptor3d_HCurve)& C2)
: curv1(C1),
curv2(C2),
choix(0)
const Handle(Adaptor3d_HCurve)& C2) : curv1(C1), curv2(C2)
{
}

View File

@@ -63,8 +63,7 @@ BRepBlend_Extremity::BRepBlend_Extremity (const gp_Pnt& P,
const Standard_Real Tol) :
pt(P),
tang(gp_Vec(0,0,0)),
param(Param),u(W),v(0.0),
tol(Tol),isvtx(Standard_False),
param(Param),u(W),tol(Tol),isvtx(Standard_False),
hastang(Standard_False)
{}

View File

@@ -18,10 +18,7 @@
#include <IntSurf_Transition.hxx>
#include <Standard_DomainError.hxx>
BRepBlend_PointOnRst::BRepBlend_PointOnRst ()
: prm(0.0)
{
}
BRepBlend_PointOnRst::BRepBlend_PointOnRst () {}
BRepBlend_PointOnRst::BRepBlend_PointOnRst(const Handle(Adaptor2d_HCurve2d)& A,

View File

@@ -68,13 +68,10 @@ BRepBlend_RstRstConstRad::BRepBlend_RstRstConstRad
surf1(Surf1), surf2(Surf2), rst1(Rst1), rst2(Rst2),
cons1(Rst1, Surf1), cons2(Rst2, Surf2),
guide(CGuide), tguide(CGuide),
prmrst1(0.0), prmrst2(0.0),
istangent(Standard_True), ray(0.0),
choix(0), normtg(0.0), theD(0.0),
maxang(RealFirst()), minang(RealLast()),
distmin(RealLast()), mySShape(BlendFunc_Rational)
{
}
istangent(Standard_True), maxang(RealFirst()), minang(RealLast()),
distmin(RealLast()),
mySShape(BlendFunc_Rational)
{}
//=======================================================================
//function : NbVariables

View File

@@ -174,13 +174,8 @@ BRepBlend_RstRstLineBuilder::BRepBlend_RstRstLineBuilder
const Handle(Adaptor3d_HSurface)& Surf2,
const Handle(Adaptor2d_HCurve2d)& Rst2,
const Handle(Adaptor3d_TopolTool)& Domain2):
done(Standard_False), sol(1, 2), surf1(Surf1),
domain1(Domain1), surf2(Surf2),
domain2(Domain2), rst1(Rst1), rst2(Rst2),
tolesp(0.0), tolgui(0.0), pasmax(0.0),
fleche(0.0), param(0.0), rebrou(Standard_False),
iscomplete(Standard_False), comptra(Standard_False), sens(0.0),
decrochdeb(Blend_NoDecroch), decrochfin(Blend_NoDecroch)
sol(1,2), surf1(Surf1), domain1(Domain1),
surf2(Surf2), domain2(Domain2), rst1(Rst1), rst2(Rst2)
{
}

View File

@@ -28,12 +28,7 @@
BRepBlend_SurfCurvConstRadInv::BRepBlend_SurfCurvConstRadInv
(const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HCurve)& C,
const Handle(Adaptor3d_HCurve)& Cg)
: surf(S),
curv(C),
guide(Cg),
ray(0.0),
choix(0)
const Handle(Adaptor3d_HCurve)& Cg) : surf(S),curv(C),guide(Cg)
{
}

View File

@@ -27,11 +27,7 @@
//=======================================================================
BRepBlend_SurfPointConstRadInv::BRepBlend_SurfPointConstRadInv
(const Handle(Adaptor3d_HSurface)& S,
const Handle(Adaptor3d_HCurve)& C)
: surf(S),
curv(C),
ray(0.0),
choix(0)
const Handle(Adaptor3d_HCurve)& C) : surf(S), curv(C)
{
}

View File

@@ -66,12 +66,10 @@ BRepBlend_SurfRstConstRad::BRepBlend_SurfRstConstRad
const Handle(Adaptor3d_HCurve)& CGuide):
surf(Surf), surfrst(SurfRst), rst(Rst), cons(Rst,SurfRst),
guide(CGuide), tguide(CGuide),
prmrst(0.0), istangent(Standard_True),
ray(0.0), choix(0), normtg(0.0),
theD(0.), maxang(RealFirst()), minang(RealLast()),
distmin(RealLast()), mySShape(BlendFunc_Rational)
{
}
istangent(Standard_True), theD(0.), maxang(RealFirst()), minang(RealLast()),
distmin(RealLast()),
mySShape(BlendFunc_Rational)
{}
//=======================================================================
//function : NbVariables

View File

@@ -212,13 +212,8 @@ BRepBlend_SurfRstLineBuilder::BRepBlend_SurfRstLineBuilder
const Handle(Adaptor3d_HSurface)& Surf2,
const Handle(Adaptor2d_HCurve2d)& Rst,
const Handle(Adaptor3d_TopolTool)& Domain2):
done(Standard_False), sol(1, 3), surf1(Surf1),
domain1(Domain1), surf2(Surf2), rst(Rst),
domain2(Domain2), tolesp(0.0), tolgui(0.0),
pasmax(0.0), fleche(0.0), param(0.0),
rebrou(Standard_False), iscomplete(Standard_False),
comptra(Standard_False), sens(0.0),
decrochdeb(Standard_False), decrochfin(Standard_False)
sol(1,3),surf1(Surf1), domain1(Domain1),
surf2(Surf2), rst(Rst), domain2(Domain2)
{
}

View File

@@ -581,11 +581,8 @@ Standard_Real BRepBuilderAPI_FastSewing::Compute3DRange()
BRepBuilderAPI_FastSewing::NodeInspector::
NodeInspector(const NCollection_Vector<FS_Vertex>& theVec,
const gp_Pnt& thePnt,
const Standard_Real theTol)
: myVecOfVertexes(theVec),
myPoint(thePnt),
myResID(-1),
myIsFindingEnable(Standard_False)
const Standard_Real theTol):
myVecOfVertexes(theVec), myPoint(thePnt), myResID(-1)
{
mySQToler = theTol*theTol;
}

View File

@@ -82,9 +82,6 @@ static Standard_Boolean CheckThin(const TopoDS_Shape& w,
//=======================================================================
BRepCheck_Face::BRepCheck_Face (const TopoDS_Face& F)
: myIntres(BRepCheck_NoError),
myImbres(BRepCheck_NoError),
myOrires(BRepCheck_NoError)
{
Init(F);
myIntdone = Standard_False;

View File

@@ -111,11 +111,6 @@ inline Standard_Boolean IsOriented(const TopoDS_Shape& S)
//=======================================================================
BRepCheck_Shell::BRepCheck_Shell(const TopoDS_Shell& S)
: myNbori(0),
myCdone(Standard_False),
myCstat(BRepCheck_NoError),
myOdone(Standard_False),
myOstat(BRepCheck_NoError)
{
Init(S);
}

View File

@@ -130,9 +130,6 @@ static Standard_Boolean GetPnt2d(const TopoDS_Vertex &theVertex,
//purpose :
//=======================================================================
BRepCheck_Wire::BRepCheck_Wire(const TopoDS_Wire& W)
: myCdone(Standard_False),
myCstat(BRepCheck_NoError),
myGctrl(Standard_False)
{
Init(W);
}

View File

@@ -31,12 +31,7 @@
//============================================================================
BRepClass3d_Intersector3d::BRepClass3d_Intersector3d()
: U(0.0),
V(0.0),
W(0.0),
done(Standard_False),
hasapoint(Standard_False),
state(TopAbs_UNKNOWN)
: done(Standard_False),hasapoint(Standard_False)
{
}
//============================================================================

View File

@@ -61,8 +61,7 @@ static void Trans(Standard_Real parmin, IntCurveSurface_TransitionOnCurve& tran,
//function : BRepClass3d_SClassifier
//purpose :
//=======================================================================
BRepClass3d_SClassifier::BRepClass3d_SClassifier()
: myState(0)
BRepClass3d_SClassifier::BRepClass3d_SClassifier()
{
}

View File

@@ -96,9 +96,7 @@ void BRepClass3d_SolidClassifier::Load(const TopoDS_Shape& S) {
}
BRepClass3d_SolidClassifier::BRepClass3d_SolidClassifier(const TopoDS_Shape& S)
: aSolidLoaded(Standard_True),
explorer(S),
isaholeinspace(Standard_False)
: aSolidLoaded(Standard_True),explorer(S)
{
#if LBRCOMPT
STAT.NbConstrShape++;

View File

@@ -771,10 +771,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
//purpose :
//=======================================================================
BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer()
: myReject(Standard_True),
myFirstFace(0),
myParamOnEdge(0.0)
BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer()
{
}

View File

@@ -80,12 +80,7 @@ namespace
Standard_Real Distance; //!< Distance between sub-shapes
//! Uninitialized constructor for collection.
BRepExtrema_CheckPair()
: Index1(0),
Index2(0),
Distance(0.0)
{
}
BRepExtrema_CheckPair() {}
//! Creates new pair of sub-shapes.
BRepExtrema_CheckPair (Standard_Integer theIndex1,
@@ -154,7 +149,7 @@ void BRepExtrema_DistShapeShape::DistanceMapMap (const TopTools_IndexedMapOfShap
const TopoDS_Shape& aShape1 = theMap1 (aPair.Index1);
const TopoDS_Shape& aShape2 = theMap2 (aPair.Index2);
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps, myFlag);
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps);
if (aDistTool.IsDone())
{
if (aDistTool.DistValue() < myDistRef - myEps)
@@ -199,7 +194,8 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
myEps (Precision::Confusion()),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (Extrema_ExtFlag_MINMAX)
myFlag (Extrema_ExtFlag_MINMAX),
myAlgo (Extrema_ExtAlgo_Grad)
{
//
}
@@ -210,14 +206,16 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
//=======================================================================
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
const TopoDS_Shape& Shape2,
const Extrema_ExtFlag F)
const Extrema_ExtFlag F,
const Extrema_ExtAlgo A)
: myDistRef (0.0),
myIsDone (Standard_False),
myInnerSol (Standard_False),
myEps (Precision::Confusion()),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (F)
myFlag (F),
myAlgo (A)
{
LoadS1(Shape1);
LoadS2(Shape2);
@@ -232,14 +230,16 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
const TopoDS_Shape& Shape2,
const Standard_Real theDeflection,
const Extrema_ExtFlag F)
const Extrema_ExtFlag F,
const Extrema_ExtAlgo A)
: myDistRef (0.0),
myIsDone (Standard_False),
myInnerSol (Standard_False),
myEps (theDeflection),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (F)
myFlag (F),
myAlgo (A)
{
LoadS1(Shape1);
LoadS2(Shape2);

View File

@@ -18,6 +18,7 @@
#include <BRepExtrema_SeqOfSolution.hxx>
#include <BRepExtrema_SolutionElem.hxx>
#include <BRepExtrema_SupportType.hxx>
#include <Extrema_ExtAlgo.hxx>
#include <Extrema_ExtFlag.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Shape.hxx>
@@ -38,9 +39,9 @@ class BRepExtrema_DistShapeShape
Standard_EXPORT BRepExtrema_DistShapeShape();
//! computation of the minimum distance (value and pair of points) using default deflection <br>
//! Default value is Precision::Confusion(). <br>
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
//! create tool and load both shapes into it <br>
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
void SetDeflection(const Standard_Real theDeflection)
{
@@ -128,6 +129,11 @@ class BRepExtrema_DistShapeShape
myFlag = F;
}
void SetAlgo(const Extrema_ExtAlgo A)
{
myAlgo = A;
}
private:
//! computes the minimum distance between two maps of shapes (Face,Edge,Vertex) <br>
@@ -150,6 +156,7 @@ private:
Standard_Boolean myIsInitS1;
Standard_Boolean myIsInitS2;
Extrema_ExtFlag myFlag;
Extrema_ExtAlgo myAlgo;
Bnd_SeqOfBox myBV1;
Bnd_SeqOfBox myBV2;
Bnd_SeqOfBox myBE1;

View File

@@ -772,7 +772,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Vertex& S1, const TopoDS_Face&
const Standard_Real Dst=B1.Distance(B2);
if ((Dst < myDstRef - myEps) || (fabs(Dst-myDstRef) < myEps))
{
BRepExtrema_ExtPF Ext(S1,S2,myFlag);
BRepExtrema_ExtPF Ext(S1,S2,myFlag,myAlgo);
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
if ( NbExtrema > 0 )
{
@@ -828,7 +828,7 @@ void BRepExtrema_DistanceSS::Perform(const TopoDS_Face& S1, const TopoDS_Vertex&
const Standard_Real Dst=B1.Distance(B2);
if ((Dst < myDstRef - myEps) || (fabs(Dst-myDstRef) < myEps))
{
BRepExtrema_ExtPF Ext(S2,S1,myFlag);
BRepExtrema_ExtPF Ext(S2,S1,myFlag,myAlgo);
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
if ( NbExtrema > 0 )
{

View File

@@ -16,6 +16,7 @@
#include <BRepExtrema_SeqOfSolution.hxx>
#include <Extrema_ExtFlag.hxx>
#include <Extrema_ExtAlgo.hxx>
#include <Precision.hxx>
#include <Standard_DefineAlloc.hxx>
@@ -38,8 +39,9 @@ class BRepExtrema_DistanceSS
BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
const Bnd_Box& B1, const Bnd_Box& B2,
const Standard_Real DstRef,
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F)
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A)
{
Perform(S1, S2, B1, B2);
}
@@ -50,8 +52,9 @@ class BRepExtrema_DistanceSS
BRepExtrema_DistanceSS(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
const Bnd_Box& B1, const Bnd_Box& B2,
const Standard_Real DstRef, const Standard_Real aDeflection,
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F)
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A)
{
Perform(S1, S2, B1, B2);
}
@@ -80,6 +83,11 @@ class BRepExtrema_DistanceSS
{
myFlag = F;
}
//! sets the flag controlling ...
void SetAlgo(const Extrema_ExtAlgo A)
{
myAlgo = A;
}
private:
@@ -122,6 +130,7 @@ class BRepExtrema_DistanceSS
Standard_Boolean myModif;
Standard_Real myEps;
Extrema_ExtFlag myFlag;
Extrema_ExtAlgo myAlgo;
};
#endif

View File

@@ -32,9 +32,9 @@
//=======================================================================
BRepExtrema_ExtPF::BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex, const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag)
const Extrema_ExtFlag TheFlag, const Extrema_ExtAlgo TheAlgo)
{
Initialize(TheFace,TheFlag);
Initialize(TheFace,TheFlag,TheAlgo);
Perform(TheVertex,TheFace);
}
@@ -44,7 +44,7 @@ BRepExtrema_ExtPF::BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex, const TopoD
//=======================================================================
void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag)
const Extrema_ExtFlag TheFlag, const Extrema_ExtAlgo TheAlgo)
{
// cette surface doit etre en champ. Extrema ne fait
// pas de copie et prend seulement un pointeur dessus.
@@ -60,6 +60,7 @@ void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace,
Standard_Real U1, U2, V1, V2;
BRepTools::UVBounds(TheFace, U1, U2, V1, V2);
myExtPS.SetFlag(TheFlag);
myExtPS.SetAlgo(TheAlgo);
myExtPS.Initialize(mySurf, U1, U2, V1, V2, aTolU, aTolV);
}

View File

@@ -21,6 +21,7 @@
#include <Extrema_SequenceOfPOnSurf.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <Extrema_ExtFlag.hxx>
#include <Extrema_ExtAlgo.hxx>
class TopoDS_Vertex;
class TopoDS_Face;
@@ -37,10 +38,12 @@ class BRepExtrema_ExtPF
{}
//! It calculates all the distances. <br>
Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
Standard_EXPORT void Initialize(const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
//! An exception is raised if the fields have not been initialized. <br>
//! Be careful: this method uses the Face only for classify not for the fields. <br>
@@ -76,6 +79,11 @@ class BRepExtrema_ExtPF
myExtPS.SetFlag(F);
}
void SetAlgo(const Extrema_ExtAlgo A)
{
myExtPS.SetAlgo(A);
}
private:
Extrema_ExtPS myExtPS;

View File

@@ -74,9 +74,7 @@ public:
Init (Sbase, Pbase, Skface, Angle, Fuse, Modify);
}
BRepFeat_MakeDPrism()
: myAngle(RealLast()),
myStatusError(BRepFeat_OK)
BRepFeat_MakeDPrism()
{
}

View File

@@ -19,11 +19,7 @@
//purpose :
//=======================================================================
inline BRepFeat_MakeLinearForm::BRepFeat_MakeLinearForm ()
: myBnd(0.0),
myTol(0.0)
{
}
inline BRepFeat_MakeLinearForm::BRepFeat_MakeLinearForm () {}
//=======================================================================

View File

@@ -19,10 +19,7 @@
//purpose :
//=======================================================================
inline BRepFeat_MakePrism::BRepFeat_MakePrism ()
: myStatusError(BRepFeat_OK)
{
}
inline BRepFeat_MakePrism::BRepFeat_MakePrism () {}
//=======================================================================

View File

@@ -19,10 +19,7 @@
//purpose :
//=======================================================================
inline BRepFeat_MakeRevol::BRepFeat_MakeRevol ()
: myStatusError(BRepFeat_OK)
{
}
inline BRepFeat_MakeRevol::BRepFeat_MakeRevol () {}
//=======================================================================

View File

@@ -19,16 +19,7 @@
//purpose :
//=======================================================================
inline BRepFeat_MakeRevolutionForm::BRepFeat_MakeRevolutionForm ()
: myHeight1(0.0),
myHeight2(0.0),
mySliding(Standard_False),
myBnd(0.0),
myTol(0.0),
myAngle1(RealLast()),
myAngle2(RealLast())
{
}
inline BRepFeat_MakeRevolutionForm::BRepFeat_MakeRevolutionForm () {}
//=======================================================================

View File

@@ -19,9 +19,5 @@
//purpose :
//=======================================================================
inline BRepFeat_RibSlot::BRepFeat_RibSlot ()
: myFuse(Standard_False),
mySliding(Standard_False),
myStatusError(BRepFeat_OK)
{
}
inline BRepFeat_RibSlot::BRepFeat_RibSlot ()
{}

View File

@@ -760,11 +760,8 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
TopoDS_Face F;
for (ii=InitialLength+1; ii<=myFaces->ColLength(); ii++) {
for (jj=1; jj<=myFaces->RowLength(); jj++) {
if (myFaces->Value(ii, jj).ShapeType() == TopAbs_FACE)
{
F = TopoDS::Face(myFaces->Value(ii, jj));
if (!F.IsNull()) B.Add(result, F);
}
F = TopoDS::Face(myFaces->Value(ii, jj));
if (!F.IsNull()) B.Add(result, F);
}
}

View File

@@ -24,7 +24,6 @@
//purpose : Constructor
//=======================================================================
BRepGProp_Sinert::BRepGProp_Sinert()
: myEpsilon(0.0)
{
}

View File

@@ -25,7 +25,6 @@
//purpose : Constructor
//=======================================================================
BRepGProp_Vinert::BRepGProp_Vinert()
: myEpsilon(0.0)
{
}

View File

@@ -23,7 +23,6 @@
#include <BRepLib_MakeFace.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <GCPnts.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
@@ -162,10 +161,7 @@ static Standard_Boolean Is2DClosed(const TopoDS_Shape& theShape,
//function : BRepLib_FindSurface
//purpose :
//=======================================================================
BRepLib_FindSurface::BRepLib_FindSurface()
: myTolerance(0.0),
myTolReached(0.0),
isExisted(Standard_False)
BRepLib_FindSurface::BRepLib_FindSurface()
{
}
//=======================================================================
@@ -182,6 +178,39 @@ BRepLib_FindSurface::BRepLib_FindSurface(const TopoDS_Shape& S,
namespace
{
static void fillParams (const TColStd_Array1OfReal& theKnots,
Standard_Integer theDegree,
Standard_Real theParMin,
Standard_Real theParMax,
NCollection_Vector<Standard_Real>& theParams)
{
Standard_Real aPrevPar = theParMin;
theParams.Append (aPrevPar);
Standard_Integer aNbP = Max (theDegree, 1);
for (Standard_Integer i = 1;
(i < theKnots.Length()) && (theKnots (i) < (theParMax - Precision::PConfusion())); ++i)
{
if (theKnots (i + 1) < theParMin + Precision::PConfusion())
continue;
Standard_Real aStep = (theKnots (i + 1) - theKnots (i)) / aNbP;
for (Standard_Integer k = 1; k <= aNbP ; ++k)
{
Standard_Real aPar = theKnots (i) + k * aStep;
if (aPar > theParMax - Precision::PConfusion())
break;
if (aPar > aPrevPar + Precision::PConfusion())
{
theParams.Append (aPar);
aPrevPar = aPar;
}
}
}
theParams.Append (theParMax);
}
static void fillPoints (const BRepAdaptor_Curve& theCurve,
const NCollection_Vector<Standard_Real> theParams,
@@ -329,13 +358,13 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aKnots.SetValue (1, GC->FirstParameter());
aKnots.SetValue (2, GC->LastParameter());
GCPnts::FillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
fillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
break;
}
case GeomAbs_BSplineCurve:
{
Handle(Geom_BSplineCurve) GC = c.BSpline();
GCPnts::FillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
fillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
break;
}
case GeomAbs_Line:
@@ -362,7 +391,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aBounds.SetValue (1, dfUf);
aBounds.SetValue (2, dfUl);
GCPnts::FillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
fillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
}
}

View File

@@ -173,9 +173,7 @@ static Standard_Boolean Project(const Handle(Geom2d_Curve)& C,
//=======================================================================
BRepLib_MakeEdge::BRepLib_MakeEdge()
: myError(BRepLib_PointProjectionFailed)
{
}
{}
//=======================================================================
//function : BRepLib_MakeEdge

View File

@@ -135,12 +135,8 @@ private:
{
public:
BRepLib_BndBoxVertexSelector(const TopTools_IndexedMapOfShape& theMapOfShape)
: BRepLib_BndBoxVertexSelector::Selector(),
myMapOfShape (theMapOfShape),
myTolP(0.0),
myVInd(0)
{
}
: BRepLib_BndBoxVertexSelector::Selector(), myMapOfShape (theMapOfShape)
{}
Standard_Boolean Reject (const Bnd_Box& theBox) const
{

View File

@@ -49,8 +49,6 @@ static void CutSketch (MAT2d_SequenceOfSequenceOfGeometry& Figure,
//purpose : Constructeur vide.
//=============================================================================
BRepMAT2d_BisectingLocus::BRepMAT2d_BisectingLocus()
: isDone(Standard_False),
nbContours(0)
{
}

View File

@@ -47,8 +47,6 @@
//purpose :
//=======================================================================
BRepMAT2d_LinkTopoBilo::BRepMAT2d_LinkTopoBilo()
: current(0),
isEmpty(Standard_True)
{
}

View File

@@ -92,7 +92,6 @@ BRepMesh_Delaun::BRepMesh_Delaun (
myCircles (new NCollection_IncAllocator(
IMeshData::MEMORY_BLOCK_SIZE_HUGE))
{
memset (mySupVert, 0, sizeof (mySupVert));
if (isFillCircles)
{
InitCirclesTool (theCellsCountU, theCellsCountV);
@@ -107,7 +106,6 @@ BRepMesh_Delaun::BRepMesh_Delaun(IMeshData::Array1OfVertexOfDelaun& theVertices)
: myCircles (theVertices.Length(), new NCollection_IncAllocator(
IMeshData::MEMORY_BLOCK_SIZE_HUGE))
{
memset (mySupVert, 0, sizeof (mySupVert));
if ( theVertices.Length() > 2 )
{
myMeshData = new BRepMesh_DataStructureOfDelaun(
@@ -128,7 +126,6 @@ BRepMesh_Delaun::BRepMesh_Delaun(
myCircles ( theVertices.Length(), new NCollection_IncAllocator(
IMeshData::MEMORY_BLOCK_SIZE_HUGE))
{
memset (mySupVert, 0, sizeof (mySupVert));
if ( theVertices.Length() > 2 )
{
Init( theVertices );
@@ -146,7 +143,6 @@ BRepMesh_Delaun::BRepMesh_Delaun(
myCircles ( theVertexIndices.Length(), new NCollection_IncAllocator(
IMeshData::MEMORY_BLOCK_SIZE_HUGE))
{
memset (mySupVert, 0, sizeof (mySupVert));
perform(theVertexIndices);
}
@@ -162,7 +158,6 @@ BRepMesh_Delaun::BRepMesh_Delaun (const Handle (BRepMesh_DataStructureOfDelaun)&
myCircles (theVertexIndices.Length (), new NCollection_IncAllocator(
IMeshData::MEMORY_BLOCK_SIZE_HUGE))
{
memset (mySupVert, 0, sizeof (mySupVert));
perform (theVertexIndices, theCellsCountU, theCellsCountV);
}

View File

@@ -34,8 +34,7 @@ public:
//! Constructor.
BRepMesh_DelaunayDeflectionControlMeshAlgo()
: myMaxSqDeflection(-1.),
myIsAllDegenerated(Standard_False),
myCircles(NULL)
myIsAllDegenerated(Standard_False)
{
}
@@ -108,11 +107,6 @@ private:
//! Contains geometrical data related to node of triangle.
struct TriangleNodeInfo
{
TriangleNodeInfo()
: isFrontierLink(Standard_False)
{
}
gp_XY Point2d;
gp_XYZ Point;
Standard_Boolean isFrontierLink;

View File

@@ -45,12 +45,6 @@ public:
//! Constructor. Initializes empty provider.
BRepMesh_EdgeParameterProvider()
: myIsSameParam(Standard_False),
myFirstParam(0.0),
myOldFirstParam(0.0),
myScale(0.0),
myCurParam(0.0),
myFoundParam(0.0)
{
}

View File

@@ -103,7 +103,6 @@ namespace
BndBox2dTreeSelector(const Standard_Real theTolerance)
: myMaxLoopSize(M_PI * theTolerance * theTolerance),
mySelfSegmentIndex(-1),
mySegment(0),
myIndices(256, new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE))
{
}

View File

@@ -38,9 +38,8 @@ public: //! @name mesher API
gp_Pnt2d* Point2; // / using indices.
Segment()
: EdgePtr(NULL),
Point1(NULL),
Point2(NULL)
: Point1(NULL)
, Point2(NULL)
{
}

View File

@@ -44,10 +44,7 @@ namespace
myParamsForbiddenToRemove(theParamsForbiddenToRemove),
myControlParamsForbiddenToRemove(theControlParamsForbiddenToRemove),
myAllocator(new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE)),
myControlParamsToRemove(new IMeshData::MapOfReal(1, myAllocator)),
myCurrParam(0.0),
myCurrControlParam(0.0),
myPrevControlParam(0.0)
myControlParamsToRemove(new IMeshData::MapOfReal(1, myAllocator))
{
}

View File

@@ -28,7 +28,6 @@ public:
//! Constructor.
BRepMesh_NURBSRangeSplitter()
: mySurfaceType(GeomAbs_OtherSurface)
{
}

View File

@@ -77,7 +77,7 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
if (n == 5)
aDeflection = Draw::Atof(a[4]);
BRepExtrema_DistShapeShape dst(S1 ,S2, aDeflection, Extrema_ExtFlag_MIN);
BRepExtrema_DistShapeShape dst(S1 ,S2, aDeflection);
if (dst.IsDone())
{

View File

@@ -617,9 +617,9 @@ static Standard_Integer getedgeregul
//=======================================================================
static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n < 3 || n > 4) {
if (n < 3 || n > 5) {
di << "Project point on the face.\n";
di << "Usage: projponf face pnt [extrema flag: -min/-max/-minmax]\n";
di << "Usage: projponf face pnt [extrema flag: -min/-max/-minmax] [extrema algo: -g(grad)/-t(tree)]\n";
return 1;
}
// get face
@@ -642,6 +642,7 @@ static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const
//
// get projection options
// default values;
Extrema_ExtAlgo anExtAlgo = Extrema_ExtAlgo_Grad;
Extrema_ExtFlag anExtFlag = Extrema_ExtFlag_MINMAX;
//
for (Standard_Integer i = 3; i < n; ++i) {
@@ -654,6 +655,12 @@ static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const
else if (!strcasecmp(a[i], "-minmax")) {
anExtFlag = Extrema_ExtFlag_MINMAX;
}
else if (!strcasecmp(a[i], "-t")) {
anExtAlgo = Extrema_ExtAlgo_Tree;
}
else if (!strcasecmp(a[i], "-g")) {
anExtAlgo = Extrema_ExtAlgo_Grad;
}
}
//
// get surface
@@ -670,6 +677,7 @@ static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const
GeomAPI_ProjectPointOnSurf aProjPS;
aProjPS.Init(aSurf, aUMin, aUMax, aVMin, aVMax);
// set the options
aProjPS.SetExtremaAlgo(anExtAlgo);
aProjPS.SetExtremaFlag(anExtFlag);
// perform projection
aProjPS.Perform(aP);
@@ -758,7 +766,7 @@ void BRepTest::SurfaceCommands(Draw_Interpretor& theCommands)
theCommands.Add ("getedgeregularity", "getedgeregularity edge face1 [face2]", __FILE__,getedgeregul,g);
theCommands.Add ("projponf",
"projponf face pnt [extrema flag: -min/-max/-minmax]\n"
"projponf face pnt [extrema flag: -min/-max/-minmax] [extrema algo: -g(grad)/-t(tree)]\n"
"\t\tProject point on the face.",
__FILE__, projponf, g);
}

View File

@@ -36,6 +36,7 @@
#include <Geom_Surface.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Vec2d.hxx>
#include <Message_ProgressIndicator.hxx>
#include <OSD_OpenFile.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
@@ -667,11 +668,12 @@ void BRepTools::Dump(const TopoDS_Shape& Sh, Standard_OStream& S)
//=======================================================================
void BRepTools::Write(const TopoDS_Shape& Sh, Standard_OStream& S,
const Handle(Message_ProgressIndicator)& theProgress)
const Handle(Message_ProgressIndicator)& PR)
{
BRepTools_ShapeSet SS;
SS.SetProgress(PR);
SS.Add(Sh);
SS.Write(S, theProgress);
SS.Write(S);
SS.Write(Sh,S);
}
@@ -684,10 +686,11 @@ void BRepTools::Write(const TopoDS_Shape& Sh, Standard_OStream& S,
void BRepTools::Read(TopoDS_Shape& Sh,
std::istream& S,
const BRep_Builder& B,
const Handle(Message_ProgressIndicator)& theProgress)
const Handle(Message_ProgressIndicator)& PR)
{
BRepTools_ShapeSet SS(B);
SS.Read(S, theProgress);
SS.SetProgress(PR);
SS.Read(S);
SS.Read(Sh,S);
}
@@ -698,7 +701,7 @@ void BRepTools::Read(TopoDS_Shape& Sh,
Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
const Standard_CString File,
const Handle(Message_ProgressIndicator)& theProgress)
const Handle(Message_ProgressIndicator)& PR)
{
std::ofstream os;
OSD_OpenStream(os, File, std::ios::out);
@@ -710,10 +713,11 @@ Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
return isGood;
BRepTools_ShapeSet SS;
SS.SetProgress(PR);
SS.Add(Sh);
os << "DBRep_DrawableShape\n"; // for easy Draw read
SS.Write(os, theProgress);
SS.Write(os);
isGood = os.good();
if(isGood )
SS.Write(Sh,os);
@@ -735,7 +739,7 @@ Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
Standard_Boolean BRepTools::Read(TopoDS_Shape& Sh,
const Standard_CString File,
const BRep_Builder& B,
const Handle(Message_ProgressIndicator)& theProgress)
const Handle(Message_ProgressIndicator)& PR)
{
std::filebuf fic;
std::istream in(&fic);
@@ -743,7 +747,8 @@ Standard_Boolean BRepTools::Read(TopoDS_Shape& Sh,
if(!fic.is_open()) return Standard_False;
BRepTools_ShapeSet SS(B);
SS.Read(in, theProgress);
SS.SetProgress(PR);
SS.Read(in);
if(!SS.NbShapes()) return Standard_False;
SS.Read(Sh,in);
return Standard_True;

View File

@@ -40,6 +40,7 @@ class TopoDS_Solid;
class TopoDS_CompSolid;
class TopoDS_Compound;
class TopoDS_Shape;
class Message_ProgressIndicator;
class BRep_Builder;
class BRepTools_WireExplorer;
class BRepTools_Modification;
@@ -206,24 +207,18 @@ public:
Standard_EXPORT static void Dump (const TopoDS_Shape& Sh, Standard_OStream& S);
//! Writes <Sh> on <S> in an ASCII format.
Standard_EXPORT static void Write (const TopoDS_Shape& Sh, Standard_OStream& S,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static void Write (const TopoDS_Shape& Sh, Standard_OStream& S, const Handle(Message_ProgressIndicator)& PR = NULL);
//! Reads a Shape from <S> in returns it in <Sh>.
//! <B> is used to build the shape.
Standard_EXPORT static void Read (TopoDS_Shape& Sh, Standard_IStream& S, const BRep_Builder& B,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static void Read (TopoDS_Shape& Sh, Standard_IStream& S, const BRep_Builder& B, const Handle(Message_ProgressIndicator)& PR = NULL);
//! Writes <Sh> in <File>.
Standard_EXPORT static Standard_Boolean Write
(const TopoDS_Shape& Sh, const Standard_CString File,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static Standard_Boolean Write (const TopoDS_Shape& Sh, const Standard_CString File, const Handle(Message_ProgressIndicator)& PR = NULL);
//! Reads a Shape from <File>, returns it in <Sh>.
//! <B> is used to build the shape.
Standard_EXPORT static Standard_Boolean Read
(TopoDS_Shape& Sh, const Standard_CString File, const BRep_Builder& B,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static Standard_Boolean Read (TopoDS_Shape& Sh, const Standard_CString File, const BRep_Builder& B, const Handle(Message_ProgressIndicator)& PR = NULL);
//! Evals real tolerance of edge <theE>.
//! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
@@ -253,8 +248,18 @@ public:
Standard_EXPORT static void RemoveInternals (TopoDS_Shape& theS,
const Standard_Boolean theForce = Standard_False);
protected:
private:
friend class BRepTools_WireExplorer;
friend class BRepTools_Modification;
friend class BRepTools_Modifier;
@@ -268,4 +273,10 @@ friend class BRepTools_ReShape;
};
#endif // _BRepTools_HeaderFile

View File

@@ -116,7 +116,6 @@ static void CopyRanges (const TopoDS_Shape& toedge, const TopoDS_Shape& fromedge
//=======================================================================
BRepTools_ReShape::BRepTools_ReShape()
: myStatus(-1)
{
myConsiderLocation = Standard_False;
}

View File

@@ -230,7 +230,7 @@ void BRepTools_ShapeSet::AddGeometry(const TopoDS_Shape& S)
//purpose :
//=======================================================================
void BRepTools_ShapeSet::DumpGeometry (Standard_OStream& OS)const
void BRepTools_ShapeSet::DumpGeometry(Standard_OStream& OS)const
{
myCurves2d.Dump(OS);
myCurves.Dump(OS);
@@ -246,32 +246,65 @@ void BRepTools_ShapeSet::DumpGeometry (Standard_OStream& OS)const
//purpose :
//=======================================================================
void BRepTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
const Handle(Message_ProgressIndicator)& theProgress)
void BRepTools_ShapeSet::WriteGeometry(Standard_OStream& OS)
{
//OCC19559
Message_ProgressSentry aPS(theProgress, "Writing geometry", 0, 6, 1);
myCurves2d.Write (OS, theProgress);
if (!aPS.More())
return;
aPS.Next();
myCurves.Write (OS, theProgress);
if (!aPS.More())
return;
aPS.Next();
WritePolygon3D (OS, true, theProgress);
if (!aPS.More())
return;
aPS.Next();
WritePolygonOnTriangulation (OS, true, theProgress);
if (!aPS.More())
return;
aPS.Next();
mySurfaces.Write (OS, theProgress);
if (!aPS.More())
return;
aPS.Next();
WriteTriangulation (OS, true, theProgress);
myCurves2d.SetProgress(GetProgress());
myCurves.SetProgress(GetProgress());
mySurfaces.SetProgress(GetProgress());
if ( !GetProgress().IsNull()) {
if(GetProgress()->UserBreak() ) return;
GetProgress()->NewScope ( 15, "2D Curves" );
}
myCurves2d.Write(OS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 15, "3D Curves" );
}
myCurves.Write(OS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 10, "3D Polygons" );
}
WritePolygon3D(OS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 10, "Polygons On Triangulation" );
}
WritePolygonOnTriangulation(OS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 10, "Surfaces" );
}
mySurfaces.Write(OS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 15, "Triangulations" );
}
WriteTriangulation(OS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
}
}
@@ -280,35 +313,65 @@ void BRepTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
//purpose :
//=======================================================================
void BRepTools_ShapeSet::ReadGeometry (Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress)
void BRepTools_ShapeSet::ReadGeometry(Standard_IStream& IS)
{
//OCC19559
Message_ProgressSentry aPS(theProgress, "Reading geometry", 0, 6, 1);
myCurves2d.Read(IS, theProgress);
if (!aPS.More())
return;
aPS.Next();
myCurves.Read(IS, theProgress);
if (!aPS.More())
return;
aPS.Next();
ReadPolygon3D(IS, theProgress);
if (!aPS.More())
return;
aPS.Next();
ReadPolygonOnTriangulation(IS, theProgress);
if (!aPS.More())
return;
aPS.Next();
mySurfaces.Read(IS, theProgress);
if (!aPS.More())
return;
aPS.Next();
ReadTriangulation(IS, theProgress);
if (!aPS.More())
return;
aPS.Next();
myCurves2d.SetProgress(GetProgress());
myCurves.SetProgress(GetProgress());
mySurfaces.SetProgress(GetProgress());
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->NewScope ( 15, "2D Curves" );
}
myCurves2d.Read(IS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 15, "3D Curves" );
}
myCurves.Read(IS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 10, "3D Polygons" );
}
ReadPolygon3D(IS);
if ( !GetProgress().IsNull() ) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 10, "Polygons On Triangulation" );
}
ReadPolygonOnTriangulation(IS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 10, "Surfaces" );
}
mySurfaces.Read(IS);
if ( !GetProgress().IsNull() ) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
GetProgress()->NewScope ( 15, "Triangulations" );
}
ReadTriangulation(IS);
if ( !GetProgress().IsNull()) {
if( GetProgress()->UserBreak() ) return;
GetProgress()->EndScope();
GetProgress()->Show();
}
}
//=======================================================================
@@ -519,7 +582,8 @@ void BRepTools_ShapeSet::DumpGeometry(const TopoDS_Shape& S,
//purpose :
//=======================================================================
void BRepTools_ShapeSet::WriteGeometry (const TopoDS_Shape& S, Standard_OStream& OS)const
void BRepTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
Standard_OStream& OS)const
{
// Write the geometry
@@ -750,9 +814,9 @@ static GeomAbs_Shape ReadRegularity(Standard_IStream& IS)
//purpose :
//=======================================================================
void BRepTools_ShapeSet::ReadGeometry (const TopAbs_ShapeEnum T,
Standard_IStream& IS,
TopoDS_Shape& S)
void BRepTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
Standard_IStream& IS,
TopoDS_Shape& S)
{
// Read the geometry
@@ -1168,13 +1232,13 @@ void BRepTools_ShapeSet::Check(const TopAbs_ShapeEnum T,
//purpose :
//=======================================================================
void BRepTools_ShapeSet::WritePolygonOnTriangulation (Standard_OStream& OS,
const Standard_Boolean Compact,
const Handle(Message_ProgressIndicator)& theProgress)const
void BRepTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS,
const Standard_Boolean Compact)const
{
Standard_Integer i, j, nbpOntri = myNodes.Extent();
Message_ProgressSentry PS(theProgress, "Polygons On Triangulation", 0, nbpOntri, 1);
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Polygons On Triangulation", 0, nbpOntri, 1);
if (Compact)
OS << "PolygonOnTriangulations " << nbpOntri << "\n";
else {
@@ -1233,8 +1297,7 @@ void BRepTools_ShapeSet::DumpPolygonOnTriangulation(Standard_OStream& OS)const
//purpose :
//=======================================================================
void BRepTools_ShapeSet::ReadPolygonOnTriangulation (Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress)
void BRepTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS)
{
char buffer[255];
IS >> buffer;
@@ -1246,7 +1309,8 @@ void BRepTools_ShapeSet::ReadPolygonOnTriangulation (Standard_IStream& IS,
Handle(Poly_PolygonOnTriangulation) Poly;
IS >> nbpol;
//OCC19559
Message_ProgressSentry PS(theProgress, "Polygons On Triangulation", 0, nbpol, 1);
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Polygons On Triangulation", 0, nbpol, 1);
for (i=1; i<=nbpol&& PS.More(); i++, PS.Next()) {
IS >> nbnodes;
TColStd_Array1OfInteger Nodes(1, nbnodes);
@@ -1287,13 +1351,13 @@ void BRepTools_ShapeSet::ReadPolygonOnTriangulation (Standard_IStream& IS,
//purpose :
//=======================================================================
void BRepTools_ShapeSet::WritePolygon3D (Standard_OStream& OS,
const Standard_Boolean Compact,
const Handle(Message_ProgressIndicator) &theProgress)const
void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS,
const Standard_Boolean Compact)const
{
Standard_Integer i, j, nbpol = myPolygons3D.Extent();
Message_ProgressSentry PS(theProgress, "3D Polygons", 0, nbpol, 1);
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "3D Poligons", 0, nbpol, 1);
if (Compact)
OS << "Polygon3D " << nbpol << "\n";
@@ -1365,8 +1429,7 @@ void BRepTools_ShapeSet::DumpPolygon3D(Standard_OStream& OS)const
//purpose :
//=======================================================================
void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream& IS,
const Handle(Message_ProgressIndicator)& theProgress)
void BRepTools_ShapeSet::ReadPolygon3D(Standard_IStream& IS)
{
char buffer[255];
// Standard_Integer i, j, p, val, nbpol, nbnodes, hasparameters;
@@ -1378,7 +1441,8 @@ void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream&
Handle(Poly_Polygon3D) P;
IS >> nbpol;
//OCC19559
Message_ProgressSentry PS(theProgress, "3D Polygons", 0, nbpol, 1);
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "3D Polygons", 0, nbpol, 1);
for (i=1; i<=nbpol && PS.More(); i++, PS.Next()) {
IS >> nbnodes;
IS >> hasparameters;
@@ -1411,13 +1475,13 @@ void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream&
//=======================================================================
void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
const Standard_Boolean Compact,
const Handle(Message_ProgressIndicator) &theProgress)const
const Standard_Boolean Compact)const
{
Standard_Integer i, j, nbNodes, nbtri = myTriangulations.Extent();
Standard_Integer nbTriangles = 0, n1, n2, n3;
Message_ProgressSentry PS(theProgress, "Triangulations", 0, nbtri, 1);
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Triangulations", 0, nbtri, 1);
if (Compact)
OS << "Triangulations " << nbtri << "\n";
@@ -1514,8 +1578,7 @@ void BRepTools_ShapeSet::DumpTriangulation(Standard_OStream& OS)const
//purpose :
//=======================================================================
void BRepTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress)
void BRepTools_ShapeSet::ReadTriangulation(Standard_IStream& IS)
{
char buffer[255];
// Standard_Integer i, j, val, nbtri;
@@ -1531,7 +1594,8 @@ void BRepTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
IS >> nbtri;
//OCC19559
Message_ProgressSentry PS(theProgress, "Triangulations", 0, nbtri, 1);
Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Triangulations", 0, nbtri, 1);
for (i=1; i<=nbtri && PS.More();i++, PS.Next()) {
IS >> nbNodes >> nbTriangles >> hasUV;

View File

@@ -31,7 +31,6 @@
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <TopAbs_ShapeEnum.hxx>
class BRep_Builder;
class TopoDS_Shape;
@@ -49,12 +48,11 @@ public:
//! Builds an empty ShapeSet.
//! Parameter <isWithTriangles> is added for XML Persistence
Standard_EXPORT BRepTools_ShapeSet (const Standard_Boolean isWithTriangles = Standard_True);
Standard_EXPORT BRepTools_ShapeSet(const Standard_Boolean isWithTriangles = Standard_True);
//! Builds an empty ShapeSet.
//! Parameter <isWithTriangles> is added for XML Persistence
Standard_EXPORT BRepTools_ShapeSet (const BRep_Builder& B,
const Standard_Boolean isWithTriangles = Standard_True);
Standard_EXPORT BRepTools_ShapeSet(const BRep_Builder& B, const Standard_Boolean isWithTriangles = Standard_True);
//! Clears the content of the set.
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
@@ -67,28 +65,21 @@ public:
//! Writes the geometry of me on the stream <OS> in a
//! format that can be read back by Read.
Standard_EXPORT virtual void WriteGeometry
(Standard_OStream& OS,
const Handle(Message_ProgressIndicator) &theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void WriteGeometry (Standard_OStream& OS) Standard_OVERRIDE;
//! Reads the geometry of me from the stream <IS>.
Standard_EXPORT virtual void ReadGeometry
(Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void ReadGeometry (Standard_IStream& IS) Standard_OVERRIDE;
//! Dumps the geometry of <S> on the stream <OS>.
Standard_EXPORT virtual void DumpGeometry
(const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
Standard_EXPORT virtual void DumpGeometry (const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
//! Writes the geometry of <S> on the stream <OS> in a
//! format that can be read back by Read.
Standard_EXPORT virtual void WriteGeometry
(const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
Standard_EXPORT virtual void WriteGeometry (const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
//! Reads the geometry of a shape of type <T> from the
//! stream <IS> and returns it in <S>.
Standard_EXPORT virtual void ReadGeometry
(const TopAbs_ShapeEnum T, Standard_IStream& IS, TopoDS_Shape& S) Standard_OVERRIDE;
Standard_EXPORT virtual void ReadGeometry (const TopAbs_ShapeEnum T, Standard_IStream& IS, TopoDS_Shape& S) Standard_OVERRIDE;
//! Inserts the shape <S2> in the shape <S1>. This
//! method must be redefined to use the correct
@@ -99,17 +90,12 @@ public:
//! Reads the 3d polygons of me
//! from the stream <IS>.
Standard_EXPORT void ReadPolygon3D
(Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress = NULL);
Standard_EXPORT void ReadPolygon3D (Standard_IStream& IS);
//! Writes the 3d polygons
//! on the stream <OS> in a format that can
//! be read back by Read.
Standard_EXPORT void WritePolygon3D
(Standard_OStream& OS,
const Standard_Boolean Compact = Standard_True,
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
Standard_EXPORT void WritePolygon3D (Standard_OStream& OS, const Standard_Boolean Compact = Standard_True) const;
//! Dumps the 3d polygons
//! on the stream <OS>.
@@ -117,17 +103,12 @@ public:
//! Reads the triangulation of me
//! from the stream <IS>.
Standard_EXPORT void ReadTriangulation
(Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress = NULL);
Standard_EXPORT void ReadTriangulation (Standard_IStream& IS);
//! Writes the triangulation
//! on the stream <OS> in a format that can
//! be read back by Read.
Standard_EXPORT void WriteTriangulation
(Standard_OStream& OS,
const Standard_Boolean Compact = Standard_True,
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
Standard_EXPORT void WriteTriangulation (Standard_OStream& OS, const Standard_Boolean Compact = Standard_True) const;
//! Dumps the triangulation
//! on the stream <OS>.
@@ -135,24 +116,30 @@ public:
//! Reads the polygons on triangulation of me
//! from the stream <IS>.
Standard_EXPORT void ReadPolygonOnTriangulation
(Standard_IStream& IS,
const Handle(Message_ProgressIndicator) &theProgress = NULL);
Standard_EXPORT void ReadPolygonOnTriangulation (Standard_IStream& IS);
//! Writes the polygons on triangulation
//! on the stream <OS> in a format that can
//! be read back by Read.
Standard_EXPORT void WritePolygonOnTriangulation
(Standard_OStream& OS,
const Standard_Boolean Compact = Standard_True,
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
Standard_EXPORT void WritePolygonOnTriangulation (Standard_OStream& OS, const Standard_Boolean Compact = Standard_True) const;
//! Dumps the polygons on triangulation
//! on the stream <OS>.
Standard_EXPORT void DumpPolygonOnTriangulation (Standard_OStream& OS) const;
protected:
private:
BRep_Builder myBuilder;
GeomTools_SurfaceSet mySurfaces;
GeomTools_CurveSet myCurves;
@@ -163,6 +150,13 @@ private:
TColStd_IndexedMapOfTransient myNodes;
Standard_Boolean myWithTriangles;
};
#endif // _BRepTools_ShapeSet_HeaderFile

View File

@@ -63,10 +63,7 @@ static Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC,
//function : BRepTools_WireExplorer
//purpose :
//=======================================================================
BRepTools_WireExplorer::BRepTools_WireExplorer()
: myReverse(Standard_False),
myTolU(0.0),
myTolV(0.0)
BRepTools_WireExplorer::BRepTools_WireExplorer()
{
}

View File

@@ -84,13 +84,7 @@ static StatistiquesFClass2d STAT;
BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const Standard_Real TolUV)
: Toluv(TolUV),
Face(aFace),
U1(0.0),
V1(0.0),
U2(0.0),
V2(0.0)
{
: Toluv(TolUV), Face(aFace) {
#if LBRCOMPT
STAT.NbConstrShape++;

View File

@@ -48,12 +48,7 @@ static
//function : BRepTopAdaptor_TopolTool
//purpose :
//=======================================================================
BRepTopAdaptor_TopolTool::BRepTopAdaptor_TopolTool ()
: myFClass2d(NULL),
myU0(0.0),
myV0(0.0),
myDU(0.0),
myDV(0.0)
BRepTopAdaptor_TopolTool::BRepTopAdaptor_TopolTool () : myFClass2d(NULL)
{
myNbSamplesU=-1;
}

View File

@@ -66,18 +66,6 @@ public: //! @name Adding elements in BVH
BVH_Object<NumType, Dimension>::myIsDirty = Standard_True;
}
//! Allows to update the box of the element while the tree is not yet built
virtual void UpdateBox (const Standard_Integer theId, const BVH_Box<NumType, Dimension>& theNewBox)
{
if (BVH_Object<NumType, Dimension>::myIsDirty)
{
if (theId >= 0 && theId < Size())
{
myBoxes[theId] = theNewBox;
}
}
}
public: //! @name BVH construction
//! BVH construction

View File

@@ -36,8 +36,7 @@ public: //! @name Constructor
//! Constructor
BVH_Distance()
: BVH_Traverse <NumType, Dimension, BVHSetType, NumType>(),
myDistance (std::numeric_limits<NumType>::max()),
myIsDone(Standard_False)
myDistance (std::numeric_limits<NumType>::max())
{
}

View File

@@ -24,10 +24,7 @@
template<class T, int N>
BVH_DistanceField<T, N>::BVH_DistanceField (const Standard_Integer theMaximumSize,
const Standard_Boolean theComputeSign)
: myDimensionX(0),
myDimensionY(0),
myDimensionZ(0),
myMaximumSize (theMaximumSize),
: myMaximumSize (theMaximumSize),
myComputeSign (theComputeSign),
myIsParallel (Standard_False)
{

View File

@@ -84,7 +84,7 @@ public: //! @name Necessary overrides for BVH construction
//! Returns the bounding box with the given index.
virtual BVH_Box <NumType, Dimension> Box (const Standard_Integer theIndex) const Standard_OVERRIDE
{
return this->myBoxes[myIndices[theIndex]];
return myBoxes[myIndices[theIndex]];
}
//! Swaps indices of two specified boxes.
@@ -95,9 +95,9 @@ public: //! @name Necessary overrides for BVH construction
}
//! Returns the Element with the index theIndex.
virtual DataType Element (const Standard_Integer theIndex) const Standard_OVERRIDE
virtual DataType Element (const Standard_Integer theIndex) const
{
return this->myElements[myIndices[theIndex]];
return myElements[myIndices[theIndex]];
}
protected: //! @name Fields

View File

@@ -38,8 +38,7 @@ public: //! @name Constructor
//! Constructor
BVH_PairDistance()
: BVH_PairTraverse <NumType, Dimension, BVHSetType, NumType>(),
myDistance (std::numeric_limits<NumType>::max()),
myIsDone(Standard_False)
myDistance (std::numeric_limits<NumType>::max())
{
}

View File

@@ -88,24 +88,6 @@ public: //! @name Point-Box Square distance
return aDist;
}
//! Computes Max square distance between point and bounding box
static T PointBoxMaxSquareDistance (const BVH_VecNt& thePoint,
const BVH_VecNt& theCMin,
const BVH_VecNt& theCMax)
{
T aDist = 0;
for (int i = 0; i < N; ++i)
{
T dmin = 0, dmax = 0;
if (thePoint[i] > theCMin[i]) { dmin = thePoint[i] - theCMin[i]; }
if (thePoint[i] < theCMax[i]) { dmax = theCMax[i] - thePoint[i]; }
T d = dmin > dmax ? dmin : dmax;
d *= d;
aDist += d;
}
return aDist;
}
public: //! @name Point-Box projection
//! Computes projection of point on bounding box
@@ -128,6 +110,7 @@ public: //! @name Point-Box projection
{
return thePoint.cwiseMax (theCMin).cwiseMin (theCMax);
}
public: //! @name Point-Triangle Square distance
//! Computes square distance between point and triangle

View File

@@ -58,8 +58,7 @@ Handle(BinMDF_ADriverTable) BinDrivers_DocumentRetrievalDriver::AttributeDrivers
void BinDrivers_DocumentRetrievalDriver::ReadShapeSection
(BinLDrivers_DocumentSection& /*theSection*/,
Standard_IStream& theIS,
const Standard_Boolean /*isMess*/,
const Handle(Message_ProgressIndicator)& theProgress)
const Standard_Boolean /*isMess*/)
{
// Read Shapes
@@ -70,7 +69,7 @@ void BinDrivers_DocumentRetrievalDriver::ReadShapeSection
OCC_CATCH_SIGNALS
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
aNamedShapeDriver->ReadShapeSection (theIS, theProgress);
aNamedShapeDriver->ReadShapeSection (theIS);
}
catch(Standard_Failure const& anException) {
const TCollection_ExtendedString aMethStr

View File

@@ -42,17 +42,11 @@ public:
//! Constructor
Standard_EXPORT BinDrivers_DocumentRetrievalDriver();
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers
(const Handle(Message_Messenger)& theMsgDriver) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver) Standard_OVERRIDE;
Standard_EXPORT virtual void ReadShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& theIS,
const Standard_Boolean isMess = Standard_False,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void ReadShapeSection (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS, const Standard_Boolean isMess = Standard_False) Standard_OVERRIDE;
Standard_EXPORT virtual void CheckShapeSection
(const Storage_Position& thePos, Standard_IStream& theIS) Standard_OVERRIDE;
Standard_EXPORT virtual void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS) Standard_OVERRIDE;
//! Clears the NamedShape driver
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
@@ -60,6 +54,22 @@ public:
DEFINE_STANDARD_RTTIEXT(BinDrivers_DocumentRetrievalDriver,BinLDrivers_DocumentRetrievalDriver)
protected:
private:
};
#endif // _BinDrivers_DocumentRetrievalDriver_HeaderFile

View File

@@ -99,8 +99,7 @@ void BinDrivers_DocumentStorageDriver::SetWithTriangles (const Handle(Message_Me
//=======================================================================
void BinDrivers_DocumentStorageDriver::WriteShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress)
Standard_OStream& theOS)
{
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
@@ -111,7 +110,7 @@ void BinDrivers_DocumentStorageDriver::WriteShapeSection
OCC_CATCH_SIGNALS
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
aNamedShapeDriver->WriteShapeSection (theOS, theProgress);
aNamedShapeDriver->WriteShapeSection (theOS);
}
catch(Standard_Failure const& anException) {
TCollection_ExtendedString anErrorStr ("BinDrivers_DocumentStorageDriver, Shape Section :");

View File

@@ -39,14 +39,10 @@ public:
//! Constructor
Standard_EXPORT BinDrivers_DocumentStorageDriver();
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers
(const Handle(Message_Messenger)& theMsgDriver) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver) Standard_OVERRIDE;
//! implements the procedure of writing a shape section to file
Standard_EXPORT virtual void WriteShapeSection
(BinLDrivers_DocumentSection& theDocSection,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection, Standard_OStream& theOS) Standard_OVERRIDE;
//! Return true if shape should be stored with triangles.
Standard_EXPORT Standard_Boolean IsWithTriangles() const;
@@ -57,6 +53,22 @@ public:
DEFINE_STANDARD_RTTIEXT(BinDrivers_DocumentStorageDriver,BinLDrivers_DocumentStorageDriver)
protected:
private:
};
#endif // _BinDrivers_DocumentStorageDriver_HeaderFile

View File

@@ -42,8 +42,6 @@
#include <TDF_Label.hxx>
#include <TDocStd_Document.hxx>
#include <TDocStd_Owner.hxx>
#include <Message_ProgressSentry.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentRetrievalDriver,PCDM_RetrievalDriver)
@@ -79,8 +77,7 @@ Handle(CDM_Document) BinLDrivers_DocumentRetrievalDriver::CreateDocument()
void BinLDrivers_DocumentRetrievalDriver::Read
(const TCollection_ExtendedString& theFileName,
const Handle(CDM_Document)& theNewDocument,
const Handle(CDM_Application)& theApplication,
const Handle(Message_ProgressIndicator)& theProgress)
const Handle(CDM_Application)& theApplication)
{
std::ifstream aFileStream;
OSD_OpenStream (aFileStream, theFileName, std::ios::in | std::ios::binary);
@@ -90,12 +87,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
Handle(Storage_Data) dData;
TCollection_ExtendedString aFormat = PCDM_ReadWriter::FileFormat (aFileStream, dData);
Read(aFileStream, dData, theNewDocument, theApplication, theProgress);
if (theProgress->UserBreak())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
Read (aFileStream, dData, theNewDocument, theApplication);
}
else
{
@@ -116,8 +108,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream& theIStream,
const Handle(Storage_Data)& theStorageData,
const Handle(CDM_Document)& theDoc,
const Handle(CDM_Application)& theApplication,
const Handle(Message_ProgressIndicator)& theProgress)
const Handle(CDM_Application)& theApplication)
{
myReaderStatus = PCDM_RS_DriverFailure;
myMsgDriver = theApplication -> MessageDriver();
@@ -233,8 +224,6 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
Handle(TDF_Data) aData = new TDF_Data();
std::streampos aDocumentPos = -1;
Message_ProgressSentry aPS(theProgress, "Reading data", 0, 3, 1);
// 2b. Read the TOC of Sections
if (aFileVer >= 3) {
BinLDrivers_DocumentSection aSection;
@@ -257,18 +246,10 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
BinLDrivers_DocumentSection& aCurSection = anIterS.ChangeValue();
if (aCurSection.IsPostRead() == Standard_False) {
theIStream.seekg ((std::streampos) aCurSection.Offset());
if (aCurSection.Name().IsEqual ((Standard_CString)SHAPESECTION_POS))
{
ReadShapeSection (aCurSection, theIStream, false, theProgress);
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
}
if (aCurSection.Name().IsEqual ((Standard_CString)SHAPESECTION_POS))
ReadShapeSection (aCurSection, theIStream);
else
ReadSection (aCurSection, theDoc, theIStream);
ReadSection (aCurSection, theDoc, theIStream);
}
}
} else { //aFileVer < 3
@@ -306,13 +287,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
CheckShapeSection(aShapeSectionPos, theIStream);
// Read Shapes
BinLDrivers_DocumentSection aCurSection;
ReadShapeSection (aCurSection, theIStream, Standard_False, theProgress);
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
ReadShapeSection (aCurSection, theIStream, Standard_False);
}
}
} // end of reading Sections or shape section
@@ -325,20 +300,8 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
theIStream.read ((char*)&aTag, sizeof(Standard_Integer));
// read sub-tree of the root label
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root(), theProgress);
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root());
Clear();
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
if (nbRead > 0) {
// attach data to the document
@@ -368,27 +331,17 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
(Standard_IStream& theIS,
const TDF_Label& theLabel,
const Handle(Message_ProgressIndicator)& theProgress)
const TDF_Label& theLabel)
{
Standard_Integer nbRead = 0;
TCollection_ExtendedString aMethStr
("BinLDrivers_DocumentRetrievalDriver: ");
Message_ProgressSentry aPS(theProgress, "Reading sub tree", 0, 2, 1, true);
// Read attributes:
theIS >> myPAtt;
while (theIS && myPAtt.TypeId() > 0 && // not an end marker ?
myPAtt.Id() > 0 && // not a garbage ?
!theIS.eof())
{
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return -1;
}
!theIS.eof()) {
// get a driver according to TypeId
Handle(BinMDF_ADriver) aDriver = myDrivers->GetDriver (myPAtt.TypeId());
if (!aDriver.IsNull()) {
@@ -454,19 +407,12 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
#if DO_INVERSE
aTag = InverseInt (aTag);
#endif
while (theIS && aTag >= 0 && !theIS.eof()) { // not an end marker ?
// create sub-label
TDF_Label aLab = theLabel.FindChild (aTag, Standard_True);
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return -1;
}
aPS.Next();
// read sub-tree
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theProgress);
Standard_Integer nbSubRead = ReadSubTree(theIS, aLab);
// check for error
if (nbSubRead == -1)
return -1;
@@ -478,7 +424,6 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
aTag = InverseInt (aTag);
#endif
}
if (aTag != BinLDrivers_ENDLABEL) {
// invalid end label marker
myMsgDriver->Send (aMethStr + "error: invalid end label marker", Message_Fail);
@@ -520,9 +465,8 @@ void BinLDrivers_DocumentRetrievalDriver::ReadSection
void BinLDrivers_DocumentRetrievalDriver::ReadShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& /*theIS*/,
const Standard_Boolean isMess,
const Handle(Message_ProgressIndicator) &/*theProgress*/)
Standard_IStream& /*theIS*/,
const Standard_Boolean isMess)
{
if(isMess && theSection.Length()) {

View File

@@ -59,16 +59,12 @@ public:
Standard_EXPORT virtual Handle(CDM_Document) CreateDocument() Standard_OVERRIDE;
//! retrieves the content of the file into a new Document.
Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName,
const Handle(CDM_Document)& theNewDocument,
const Handle(CDM_Application)& theApplication,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName, const Handle(CDM_Document)& theNewDocument, const Handle(CDM_Application)& theApplication) Standard_OVERRIDE;
Standard_EXPORT virtual void Read (Standard_IStream& theIStream,
const Handle(Storage_Data)& theStorageData,
const Handle(CDM_Document)& theDoc,
const Handle(CDM_Application)& theApplication,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
const Handle(CDM_Application)& theApplication) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
@@ -81,24 +77,14 @@ protected:
//! Read the tree from the stream <theIS> to <theLabel>
Standard_EXPORT virtual Standard_Integer ReadSubTree
(Standard_IStream& theIS,
const TDF_Label& theData,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT virtual Standard_Integer ReadSubTree (Standard_IStream& theIS, const TDF_Label& theData);
//! define the procedure of reading a section to file.
Standard_EXPORT virtual void ReadSection
(BinLDrivers_DocumentSection& theSection,
const Handle(CDM_Document)& theDoc,
Standard_IStream& theIS);
Standard_EXPORT virtual void ReadSection (BinLDrivers_DocumentSection& theSection, const Handle(CDM_Document)& theDoc, Standard_IStream& theIS);
//! define the procedure of reading a shapes section to file.
Standard_EXPORT virtual void ReadShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& theIS,
const Standard_Boolean isMess = Standard_False,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT virtual void ReadShapeSection (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS, const Standard_Boolean isMess = Standard_False);
//! checks the shapes section can be correctly retreived.
Standard_EXPORT virtual void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS);

View File

@@ -24,8 +24,6 @@
#include <Standard_Boolean.hxx>
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Message_ProgressIndicator.hxx>
class TCollection_AsciiString;

View File

@@ -42,7 +42,6 @@
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <Message_ProgressSentry.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
@@ -64,8 +63,7 @@ BinLDrivers_DocumentStorageDriver::BinLDrivers_DocumentStorageDriver ()
void BinLDrivers_DocumentStorageDriver::Write
(const Handle(CDM_Document)& theDocument,
const TCollection_ExtendedString& theFileName,
const Handle(Message_ProgressIndicator)& theProgress)
const TCollection_ExtendedString& theFileName)
{
SetIsError(Standard_False);
SetStoreStatus(PCDM_SS_OK);
@@ -77,7 +75,7 @@ void BinLDrivers_DocumentStorageDriver::Write
if (aFileStream.is_open() && aFileStream.good())
{
Write(theDocument, aFileStream, theProgress);
Write (theDocument, aFileStream);
}
else
{
@@ -91,9 +89,7 @@ void BinLDrivers_DocumentStorageDriver::Write
//purpose :
//=======================================================================
void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDoc,
Standard_OStream& theOStream,
const Handle(Message_ProgressIndicator)& theProgress)
void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDoc, Standard_OStream& theOStream)
{
myMsgDriver = theDoc->Application()->MessageDriver();
myMapUnsupported.Clear();
@@ -140,26 +136,12 @@ void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDo
myRelocTable.Clear();
myPAtt.Init();
Message_ProgressSentry aPS(theProgress, "Writing document", 0, 3, 1);
// Write Doc structure
WriteSubTree (aData->Root(), theOStream, theProgress); // Doc is written
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
WriteSubTree (aData->Root(), theOStream); // Doc is written
// 4. Write Shapes section
WriteShapeSection (aShapesSection, theOStream, theProgress);
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
WriteShapeSection (aShapesSection, theOStream);
// Write application-defined sections
for (anIterS.Init (mySections); anIterS.More(); anIterS.Next()) {
BinLDrivers_DocumentSection& aSection = anIterS.ChangeValue();
@@ -182,13 +164,7 @@ void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDo
SetStoreStatus(PCDM_SS_No_Obj);
}
myRelocTable.Clear();
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
if (!theOStream) {
// A problem with the stream
#ifdef OCCT_DEBUG
@@ -229,15 +205,14 @@ void BinLDrivers_DocumentStorageDriver::UnsupportedAttrMsg
void BinLDrivers_DocumentStorageDriver::WriteSubTree
(const TDF_Label& theLabel,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress)
Standard_OStream& theOS)
{
// Skip empty labels
if (!myEmptyLabels.IsEmpty() && myEmptyLabels.First() == theLabel) {
myEmptyLabels.RemoveFirst();
return;
}
Message_ProgressSentry aPS(theProgress, "Writing sub tree", 0, 2, 1, 1);
// Write label header: tag
Standard_Integer aTag = theLabel.Tag();
#if DO_INVERSE
@@ -247,7 +222,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
// Write attributes
TDF_AttributeIterator itAtt (theLabel);
for ( ; itAtt.More() && theOS && aPS.More(); itAtt.Next()) {
for ( ; itAtt.More() && theOS; itAtt.Next()) {
const Handle(TDF_Attribute) tAtt = itAtt.Value();
const Handle(Standard_Type)& aType = tAtt->DynamicType();
// Get type ID and driver
@@ -274,12 +249,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
// Problem with the stream
return;
}
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
// Write the end attributes list marker
BinLDrivers_Marker anEndAttr = BinLDrivers_ENDATTRLIST;
#if DO_INVERSE
@@ -292,14 +262,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
for ( ; itChld.More(); itChld.Next())
{
const TDF_Label& aChildLab = itChld.Value();
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
WriteSubTree (aChildLab, theOS, theProgress);
WriteSubTree (aChildLab, theOS);
}
// Write the end label marker
@@ -546,8 +509,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSection
//=======================================================================
void BinLDrivers_DocumentStorageDriver::WriteShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& /*theProgress*/)
Standard_OStream& theOS)
{
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
theSection.Write (theOS, aShapesSectionOffset);

View File

@@ -52,14 +52,10 @@ public:
Standard_EXPORT BinLDrivers_DocumentStorageDriver();
//! Write <theDocument> to the binary file <theFileName>
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
const TCollection_ExtendedString& theFileName,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, const TCollection_ExtendedString& theFileName) Standard_OVERRIDE;
//! Write <theDocument> to theOStream
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
Standard_OStream& theOStream,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument, Standard_OStream& theOStream) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
@@ -75,19 +71,13 @@ protected:
//! Write the tree under <theLabel> to the stream <theOS>
Standard_EXPORT void WriteSubTree (const TDF_Label& theData,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT void WriteSubTree (const TDF_Label& theData, Standard_OStream& theOS);
//! define the procedure of writing a section to file.
Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName,
const Handle(CDM_Document)& theDoc,
Standard_OStream& theOS);
Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName, const Handle(CDM_Document)& theDoc, Standard_OStream& theOS);
//! defines the procedure of writing a shape section to file
Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection, Standard_OStream& theOS);
Handle(BinMDF_ADriverTable) myDrivers;
BinObjMgt_SRelocationTable myRelocTable;
@@ -95,6 +85,7 @@ protected:
private:
Standard_EXPORT void FirstPass (const TDF_Label& theRoot);
//! Returns true if <L> and its sub-labels do not contain
@@ -113,6 +104,13 @@ private:
BinLDrivers_VectorOfDocumentSection mySections;
TCollection_ExtendedString myFileName;
};
#endif // _BinLDrivers_DocumentStorageDriver_HeaderFile

View File

@@ -18,7 +18,6 @@
#include <TDataXtd_Presentation.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Quantity_Color.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataXtd_PresentationDriver,BinMDF_ADriver)
@@ -71,17 +70,9 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
ok = theSource >> aValue;
if (!ok) return ok;
if ( aValue != -1 )
{
Quantity_NameOfColor aNameOfColor = TDataXtd_Presentation::getColorNameFromOldEnum (aValue);
if (aNameOfColor <= Quantity_NOC_WHITE)
{
anAttribute->SetColor (aNameOfColor);
}
}
anAttribute->SetColor((Quantity_NameOfColor)aValue);
else
{
anAttribute->UnsetColor();
}
// Material
ok = theSource >> aValue;
@@ -116,7 +107,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
else
anAttribute->UnsetMode();
return true;
return ok;
}
//=======================================================================
@@ -138,14 +129,9 @@ void BinMDataXtd_PresentationDriver::Paste(const Handle(TDF_Attribute)& theSourc
// Color
if (anAttribute->HasOwnColor())
{
const Standard_Integer anOldEnum = TDataXtd_Presentation::getOldColorNameFromNewEnum (anAttribute->Color());
theTarget.PutInteger (anOldEnum);
}
theTarget.PutInteger(anAttribute->Color());
else
{
theTarget.PutInteger(-1);
}
// Material
if (anAttribute->HasOwnMaterial())

View File

@@ -276,12 +276,11 @@ void BinMNaming_NamedShapeDriver::Paste (const Handle(TDF_Attribute)& theSource,
//purpose :
//=======================================================================
void BinMNaming_NamedShapeDriver::WriteShapeSection (Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress)
void BinMNaming_NamedShapeDriver::WriteShapeSection (Standard_OStream& theOS)
{
theOS << SHAPESET;
myShapeSet.SetFormatNb(myFormatNb);
myShapeSet.Write (theOS, theProgress);
myShapeSet.Write (theOS);
myShapeSet.Clear();
}
@@ -300,8 +299,7 @@ void BinMNaming_NamedShapeDriver::Clear()
//purpose :
//=======================================================================
void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS,
const Handle(Message_ProgressIndicator)& theProgress)
void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS)
{
// check section title string; note that some versions of OCCT (up to 6.3.1)
// might avoid writing shape section if it is empty
@@ -310,7 +308,7 @@ void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS,
theIS >> aSectionTitle;
if(aSectionTitle.Length() > 0 && aSectionTitle == SHAPESET) {
myShapeSet.Clear();
myShapeSet.Read (theIS, theProgress);
myShapeSet.Read (theIS);
SetFormatNb(myShapeSet.FormatNb());
}
else

View File

@@ -52,12 +52,10 @@ public:
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
//! Input the shapes from Bin Document file
Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS);
//! Output the shapes into Bin Document file
Standard_EXPORT void WriteShapeSection (Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT void WriteShapeSection (Standard_OStream& theOS);
//! Clear myShapeSet
Standard_EXPORT void Clear();

View File

@@ -17,7 +17,6 @@
#include <BinTools.hxx>
#include <BinTools_ShapeSet.hxx>
#include <FSD_FileHeader.hxx>
#include <Message_ProgressIndicator.hxx>
#include <OSD_OpenFile.hxx>
#include <Storage_StreamTypeMismatchError.hxx>
@@ -175,13 +174,12 @@ Standard_IStream& BinTools::GetBool(Standard_IStream& IS, Standard_Boolean& aVal
//purpose :
//=======================================================================
void BinTools::Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
const Handle(Message_ProgressIndicator)& theProgress)
void BinTools::Write (const TopoDS_Shape& theShape, Standard_OStream& theStream)
{
BinTools_ShapeSet aShapeSet(Standard_True);
aShapeSet.SetFormatNb (3);
aShapeSet.Add (theShape);
aShapeSet.Write (theStream, theProgress);
aShapeSet.Write (theStream);
aShapeSet.Write (theShape, theStream);
}
@@ -190,11 +188,10 @@ void BinTools::Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
//purpose :
//=======================================================================
void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
const Handle(Message_ProgressIndicator)& theProgress)
void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream)
{
BinTools_ShapeSet aShapeSet(Standard_True);
aShapeSet.Read (theStream, theProgress);
aShapeSet.Read (theStream);
aShapeSet.Read (theShape, theStream, aShapeSet.NbShapes());
}
@@ -203,8 +200,7 @@ void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
//purpose :
//=======================================================================
Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_CString theFile,
const Handle(Message_ProgressIndicator)& theProgress)
Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_CString theFile)
{
std::ofstream aStream;
aStream.precision (15);
@@ -212,7 +208,7 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_C
if (!aStream.good())
return Standard_False;
Write (theShape, aStream, theProgress);
Write (theShape, aStream);
aStream.close();
return aStream.good();
}
@@ -222,8 +218,7 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_C
//purpose :
//=======================================================================
Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString theFile,
const Handle(Message_ProgressIndicator)& theProgress)
Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString theFile)
{
std::filebuf aBuf;
OSD_OpenStream (aBuf, theFile, std::ios::in | std::ios::binary);
@@ -231,6 +226,6 @@ Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString
return Standard_False;
Standard_IStream aStream (&aBuf);
Read (theShape, aStream, theProgress);
Read (theShape, aStream);
return aStream.good();
}

View File

@@ -26,7 +26,6 @@
#include <Standard_ExtCharacter.hxx>
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Message_ProgressIndicator.hxx>
class TopoDS_Shape;
class BinTools_ShapeSet;
@@ -64,22 +63,16 @@ public:
Standard_EXPORT static Standard_IStream& GetExtChar (Standard_IStream& IS, Standard_ExtCharacter& theValue);
//! Writes <theShape> on <theStream> in binary format.
Standard_EXPORT static void Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static void Write (const TopoDS_Shape& theShape, Standard_OStream& theStream);
//! Reads a shape from <theStream> and returns it in <theShape>.
Standard_EXPORT static void Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static void Read (TopoDS_Shape& theShape, Standard_IStream& theStream);
//! Writes <theShape> in <theFile>.
Standard_EXPORT static Standard_Boolean Write
(const TopoDS_Shape& theShape, const Standard_CString theFile,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static Standard_Boolean Write (const TopoDS_Shape& theShape, const Standard_CString theFile);
//! Reads a shape from <theFile> and returns it in <theShape>.
Standard_EXPORT static Standard_Boolean Read
(TopoDS_Shape& theShape, const Standard_CString theFile,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT static Standard_Boolean Read (TopoDS_Shape& theShape, const Standard_CString theFile);
protected:

View File

@@ -38,7 +38,6 @@
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Message_ProgressSentry.hxx>
#define LINE 1
#define CIRCLE 2
@@ -346,13 +345,11 @@ void BinTools_Curve2dSet::WriteCurve2d(const Handle(Geom2d_Curve)& C,
//purpose :
//=======================================================================
void BinTools_Curve2dSet::Write (Standard_OStream& OS,
const Handle(Message_ProgressIndicator)& theProgress)const
void BinTools_Curve2dSet::Write(Standard_OStream& OS)const
{
Standard_Integer i, aNbCurves = myMap.Extent();
Message_ProgressSentry aPS(theProgress, "Writing 2D curves", 0, aNbCurves, 1);
OS << "Curve2ds "<< aNbCurves << "\n";
for (i = 1; i <= aNbCurves && aPS.More(); i++, aPS.Next()) {
for (i = 1; i <= aNbCurves; i++) {
WriteCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS);
}
}
@@ -695,8 +692,7 @@ Standard_IStream& BinTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS,
//purpose :
//=======================================================================
void BinTools_Curve2dSet::Read (Standard_IStream& IS,
const Handle(Message_ProgressIndicator)& theProgress)
void BinTools_Curve2dSet::Read(Standard_IStream& IS)
{
char buffer[255];
@@ -714,10 +710,12 @@ void BinTools_Curve2dSet::Read (Standard_IStream& IS,
Handle(Geom2d_Curve) C;
Standard_Integer i, aNbCurves;
IS >> aNbCurves;
Message_ProgressSentry aPS(theProgress, "Reading curves 2d", 0, aNbCurves, 1);
IS.get();//remove <lf>
for (i = 1; i <= aNbCurves && aPS.More(); i++, aPS.Next()) {
IS.get();//remove <lf>
for (i = 1; i <= aNbCurves; i++) {
BinTools_Curve2dSet::ReadCurve2d(IS,C);
myMap.Add(C);
}
}

View File

@@ -24,9 +24,6 @@
#include <Standard_Integer.hxx>
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Message_ProgressIndicator.hxx>
class Standard_OutOfRange;
class Geom2d_Curve;
@@ -60,26 +57,42 @@ public:
//! Writes the content of me on the stream <OS> in a
//! format that can be read back by Read.
Standard_EXPORT void Write (Standard_OStream& OS,
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
Standard_EXPORT void Write (Standard_OStream& OS) const;
//! Reads the content of me from the stream <IS>. me
//! is first cleared.
Standard_EXPORT void Read (Standard_IStream& IS,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
Standard_EXPORT void Read (Standard_IStream& IS);
//! Dumps the curve on the binary stream, that can be read back.
Standard_EXPORT static void WriteCurve2d(const Handle(Geom2d_Curve)& C, Standard_OStream& OS);
Standard_EXPORT static void WriteCurve2d (const Handle(Geom2d_Curve)& C, Standard_OStream& OS);
//! Reads the curve from the stream. The curve is
//! assumed to have been written with the Write
//! method.
Standard_EXPORT static Standard_IStream& ReadCurve2d (Standard_IStream& IS, Handle(Geom2d_Curve)& C);
protected:
private:
TColStd_IndexedMapOfTransient myMap;
};
#endif // _BinTools_Curve2dSet_HeaderFile

View File

@@ -37,7 +37,6 @@
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Message_ProgressSentry.hxx>
#define LINE 1
#define CIRCLE 2
@@ -359,13 +358,11 @@ void BinTools_CurveSet::WriteCurve(const Handle(Geom_Curve)& C,
//purpose :
//=======================================================================
void BinTools_CurveSet::Write (Standard_OStream& OS,
const Handle(Message_ProgressIndicator)& theProgress)const
void BinTools_CurveSet::Write(Standard_OStream& OS)const
{
Standard_Integer i, nbcurv = myMap.Extent();
Message_ProgressSentry aPS(theProgress, "Writing curves", 0, nbcurv, 1);
OS << "Curves "<< nbcurv << "\n";
for (i = 1; i <= nbcurv &&aPS.More(); i++, aPS.Next()) {
Standard_Integer i, nbsurf = myMap.Extent();
OS << "Curves "<< nbsurf << "\n";
for (i = 1; i <= nbsurf; i++) {
WriteCurve(Handle(Geom_Curve)::DownCast(myMap(i)),OS);
}
}
@@ -714,8 +711,7 @@ Standard_IStream& BinTools_CurveSet::ReadCurve(Standard_IStream& IS,
//purpose :
//=======================================================================
void BinTools_CurveSet::Read (Standard_IStream& IS,
const Handle(Message_ProgressIndicator)& theProgress)
void BinTools_CurveSet::Read(Standard_IStream& IS)
{
char buffer[255];
IS >> buffer;
@@ -733,11 +729,11 @@ void BinTools_CurveSet::Read (Standard_IStream& IS,
Standard_Integer i, nbcurve;
IS >> nbcurve;
Message_ProgressSentry aPS(theProgress, "Reading curves", 0, nbcurve, 1);
IS.get();//remove <lf>
for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) {
for (i = 1; i <= nbcurve; i++) {
BinTools_CurveSet::ReadCurve(IS,C);
myMap.Add(C);
}
}

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