1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

Compare commits

..

23 Commits

Author SHA1 Message Date
emv
52ff4caede # compute all grid points in a single pass to avoid cache rebuild on BSpline surfaces.
# use iterator for array initialization with default distance values.
2020-09-18 16:17:42 +03:00
emv
aec5142ffb 0030892: Improve Extrema_ExtPS algorithm by unifying the GRAD and TREE methods
Refactoring of the Extrema_GenExtPS class in order to improve performance and robustness of the algorithm by unifying the GRAD and TREE search methods.
2020-09-18 10:23:52 +03:00
gka
88610dfc0e 0031228: It is impossible switch off setting default names for objects inherited TObj_Partition
In order to switch off setting default names for objects of the type TObj_Partition argument "theSetName" defining addition of the default names was added
2020-09-12 20:42:26 +03:00
kgv
0784d6e3cb 0030662: Documentation - update programming example in Visualization user guide
"A programming example" section has been updated to provide a working code.
2020-09-12 20:42:25 +03:00
sshutina
897aeb207f 0031221: Visualization - selection filter in context
- Added the new filter SelectMgr_AndOrFilter which allows to define the context filter. By default OR selection filter is used
 - Added the enumeration SelectMgr_FilterType provides filter types
 - To define behavior SelectMgr_AndOrFilter use  SetFilterType in AIS_InteractiveContext
 - Added the test
 - SelectMgr_OrFilter don't store the disabled objects, it's stored in SelectMgr_AndOrFilter
2020-09-12 20:42:24 +03:00
ika
b95caec47d 0031466: Data Exchange - Cannot import layers from STeP file (7.4.0 regression)
Return possibility to find layers fir subshapes.
2020-09-12 20:42:23 +03:00
msv
7e785937b3 0025748: Parallel version of progress indicator
Progress indication mechanism is refactored to support incrementing progress within multithreaded algorithms.

The class Message_ProgressIndicator is only an interface to the user application.
It accumulates the progress provided by progress scopes.
The counter is protected by mutex for thread-safety.

The new class Message_ProgressScope replacing Message_ProgressSentry should be used to advance the progress.
The scopes are nested to each other to reflect the nested nature of operations.
The new class Message_ProgressRange should be used to pass the progress to sub-scopes.

All OCCT algorithms involving progress indication have been updated to new API.

Improvements in Draw_ProgressIndicator:
- Separate console mode has been added in order to make possible to put the progress into std::cout instead
  or in addition to the draw interpreter, instead of trigger option "-tclOutput".
- Treatment of Ctrl-Break signal has been added.
  Now any operation can be aborted by Ctrl-C or Ctrl-Break keystroke.

Added new test case 'perf fclasses progr_par' for testing of parallel work of the progress.
2020-09-12 20:42:22 +03:00
mkrylova
99289bed0a 0031683: Visualization - V3d_View::SetBackgroundImage() should accept Image_PixMap
Added V3d_View::SetBackgroundImage() accepting Graphic3d_Texture2D on input.

Graphic3d_CView/OpenGl_View have been modified to merge Graphic3d_CView::SetBackgroundImage()
and ::SetBackgroundCubeMap() implementations into a single method.
2020-09-12 20:42:21 +03:00
dpasukhi
bf0114a372 0030848: Data Exchange - Problem load step file
Update .step scanner rules to read anything within the text, including nested apostrophes
2020-09-12 20:42:20 +03:00
dpasukhi
183c99caf8 0030053: STEP read fails due to comment string
- Update .step scanner:
  - add rules to read anything within the comment
  - add a function to initialize of lexical scanner
  - add states for Commit & End instead of global variables modcom & modend
2020-09-12 20:42:19 +03:00
dpasukhi
e0a25f3d93 0030397: Data Exchange - STEP Reader extension to support entities which have a text description field with not supported symbols
STEP file is now opened in binary mode (instead of text mode) to avoid unexpected handling of control symbols inside string constants.
2020-09-12 20:42:19 +03:00
mpv
c99ad5d760 0030773: Application Framework - To allow to inherit existing attributes to reuse persistence mechanisms
Added possibility to inherit existing attributes if the same persistent fields are used. All methods that allow controlling the data model changes or getting some callbacks may be overridden in successor. They may have same GUIDs as a base class or new ones.

Special macros IMPLEMENT_DERIVED_ATTRIBUTE and IMPLEMENT_DERIVED_ATTRIBUTE_WITH_TYPE must be used instead of standard Handle macro definition IMPLEMENT_STANDARD_RTTIEXT to register new derived attributes.

Using this improvement several existing attributes from TDataStd, TDataXtd and XCAFDoc packages become inherited from other base attribute-classes. XML and Bin drivers of these attributes are removed. New base attribute classes are added: TDataStd_GenericEmpty and TDataStd_GenericExtString.

This improvement does not change both present formats Bin and XML documents. The obsolete Standard scheme is not changed at all.
2020-09-12 20:42:18 +03:00
vro
59e11a2f75 0031310: Application Framework - A document with a reference array attribute crashes on attempt to save on disk 2020-09-12 20:42:17 +03:00
mpv
dbab9c538c 0031748: Application Framework - Efficient OCAF transactions in OCCT 2020-09-12 20:42:16 +03:00
mpv
d9d03f10c3 0029195: OCAF - ensure thread safety for different documents.
OCAF persistence architecture modification to satisfy multi-threading criteria.
2020-09-12 20:42:02 +03:00
jgv
c3e0e1de43 0031736: ShapeUpgrade_UnifySameDomain algorithm does not unify all possible faces
1. Correct processing faces that can be converted into planar ones.
2. Correct processing faces based on V-closed surfaces.
2020-09-10 18:16:44 +03:00
nds
ed753e10df 0031658: Inspector - using AIS_ViewController in View package
- View: using AIS_ViewController, AIS_ViewCube.
2020-09-10 18:15:06 +03:00
nds
630ab53881 0031656: Visualization - drag item to handle in AIS_ViewController
ProcessDragging method in AIS_InteractiveObject. Empty by default. Should be implemented if drag is used for the object.
2020-09-09 19:48:49 +03:00
osa
bbbb6bff1f 0031758: Visualization, AIS_InteractiveContext - unify clearDynamicHighlight() method 2020-09-09 19:46:14 +03:00
nds
6b63dc83c3 0031326: Foundation Classes - Init from Json for base OCCT classes
InitFromJson method implementation for some simple classes.
OCCT_INIT_* defines introduction to do automatic parsing of the stream into values.
Inspector is extended to visualize objects created on the dump stream if it might be created.
2020-09-09 19:36:06 +03:00
nds
b19cde437e 0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using 2020-09-09 19:34:18 +03:00
dpasukhi
4637000015 0031489: Data Exchange - STEP Reader can't read a big file
- Add checking for null object for edge_curve within TranslateEdgeLoop;
- Update STEP parser rule allowing empty element in the list of entity parameters;
- Update test case of bug26451 for a new scanner rule;
- Update test case of bug30273 for a new added check for null object
2020-09-09 19:32:00 +03:00
nds
60f7b22536 0030537: Visualization - wrapping text in font text formatter
Font_TextFormatter inherits Standard_Transient, now it is given as a handle in functions.
Graphic3d_Text - extended with Font_TextFormatter to be able to have it filled out of text render. If it is not defined here, the default text formatter of context is used.
OpenGl_Context - has default Font_TextFormatter for rendering OpenGl_Text.
AIS_TextLabel extending with Font_TextFormatter to prepare test case for text wrapping.
Prs3d_Text returns created graphic text to be able to manage it outside.
2020-09-07 11:10:32 +03:00
656 changed files with 10895 additions and 15110 deletions

View File

@@ -71,6 +71,7 @@ BOPTools::MapShapesAndAncestors TopExp::MapShapesAndAncestors
BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
CDM_MessageDriver Message_Messenger
Message_ProgressSentry Message_ProgressScope
[tcollection]
AdvApp2Var_SequenceOfNode

View File

@@ -1935,6 +1935,118 @@ Offset direction, which used in class Adaptor2d_OffsetCurve for evaluating value
Adaptor2d_OffsetCurve aOC(BaseCurve, Offset) --> Adaptor2d_OffsetCurve aOC(BaseCurve, -Offset)
subsection upgrade_750_ProgressIndicator Change of Message_ProgressIndicator
The progress indication mechanism has been revised to eliminate its weak points in previous design (leading to ambiguity and unprotected from an error-prone behavior).
Redesign also allows using progress indicator in multi-threaded algorithms in more straight-forward way with minimal overhead.
Note, however, that multi-threaded algorithm should pre-allocate per-thread progress scopes in advance to ensure thread-safety - check new classes API for details.
Classes Message_ProgressSentry and Message_ProgressScale have been removed.
New classes Message_ProgressScope and Messge_ProgressRange replace them and should be used as main API classes to organize progress indication in the algorithms.
Instances of the class Message_ProgressRange are used to pass the progress capability to nested levels of the algorithm
and an instance of the class Message_ProgressScope is to be created (preferably as local variable) to manage progress at each level of the algorithm.
The instance of Message_ProgressIndicator is not passed anymore to sub-algorithms.
See documentation of the class Message_ProgressScope for more details and examples.
Methods to deal with progress scopes and to advance progress are removed from class Message_ProgressIndicator; now it only provides interface to the application-level progress indicator.
Virtual method Message_ProgressIndicator::Show() has changed its signature and should be updated accordingly in descendants of Message_ProgressIndicator.
The scope passed as argument to this method can be used to obtain information on context of the current process (instead of calling method GetScope() in previous implementation).
Methods Show(), UserBreak(), and Reset() are made protected in class Message_ProgressIndicator; method More() of Message_ProgressScope should be used to know if the cancel event has come.
See documentation of the class Message_ProgressIndicator for more details and implementation of Draw_ProgressIndicator for an example.
Lets take a look onto typical algorithm using an old API:
@code
class MyAlgo
{
public:
//! Algorithm entry point taking an optional Progress Indicator.
bool Perform (const TCollection_AsciiString& theFileName,
const Handle(Message_ProgressIndicator)& theProgress = Handle(Message_ProgressIndicator)())
{
Message_ProgressSentry aPSentry (theProgress, (TCollection_AsciiString("Processing ") + theFileName).ToCString(), 2);
{
Message_ProgressSentry aPSentry1 (theProgress, "Stage 1", 0, 153, 1);
for (int anIter = 0; anIter < 153; ++anIter, aPSentry1.Next())
{ if (!aPSentry1.More()) { return false; } }
}
aPSentry.Next();
{
perform2 (theProgress);
}
aPSentry.Next();
bool wasAborted = !theProgress.IsNull() && theProgress->UserBreak();
return !wasAborted;
}
private:
//! Nested sub-algorithm taking Progress Indicator.
bool perform2 (const Handle(Message_ProgressIndicator)& theProgress)
{
Message_ProgressSentry aPSentry2 (theProgress, "Stage 2", 0, 561, 1);
for (int anIter = 0; anIter < 561 && aPSentry2.More(); ++anIter, aPSentry2.Next()) {}
return aPSentry2.More();
}
};
// application executing an algorithm
Handle(Message_ProgressIndicator) aProgress = new MyProgress();
MyAlgo anAlgo;
anAlgo.Perform ("FileName", aProgress);
@endcode
The following guidance can be used to update such code:
- Replace `const Handle(Message_ProgressIndicator)&` with `const Message_ProgressRange&`.
Message_ProgressIndicator object should be now created only at place where application starts algorithms.
- Replace `Message_ProgressSentry` with `Message_ProgressScope`.
Take note that Message_ProgressScope has smaller number of arguments (no "minimal value").
In other aspects, Message_ProgressScope mimics an iterator-style interface (with methods More() and Next())
close to the old Message_ProgressSentry (pay attention to extra functionality of Message_ProgressScope::Next() method below).
- Each Message_ProgressScope should take the next Range to fill in.
Within old API, Message_ProgressSentry received the root Progress Indicator object and implicitly split it into ranges using error-prone logic.
Message_ProgressScope in new API takes Message_ProgressRange, which should be created from the Range of the parent Scope using value returned by Message_ProgressScope::Next() method.
Don't use the same Range passed to the algorithm for all sub-Scopes like it was possible in old API.
- Check user abortion state using Message_ProgressScope::UserBreak() method;
Message_ProgressRange is a temporary object with the only purpose to create a new Message_ProgressScope,
and Message_ProgressIndicator should be never passed directly to algorithms.
Take a look onto ported code and compare with code above to see differences:
@code
class MyAlgo
{
public:
//! Algorithm entry point taking an optional Progress Range.
bool Perform (const TCollection_AsciiString& theFileName,
const Message_ProgressRange& theProgress = Message_ProgressRange())
{
Message_ProgressScope aPSentry (theProgress, TCollection_AsciiString("Processing ") + theFileName, 2);
{
Message_ProgressScope aPSentry1 (aPSentry.Next(), "Stage 1", 153);
for (int anIter = 0; anIter < 153; ++anIter, aPSentry1.Next())
{ if (!aPSentry1.More()) { return false; }; }
}
{
perform2 (aPSentry.Next());
}
bool wasAborted = aPSentry.UserBreak();
return !wasAborted;
}
//! Nested sub-algorithm taking Progress sub-Range.
bool perform2 (const Message_ProgressRange& theProgress)
{
Message_ProgressScope aPSentry2 (theProgress, "Stage 2", 561);
for (int anIter = 0; anIter < 561 && aPSentry2.More(); ++anIter, aPSentry2.Next()) {}
return aPSentry2.More();
}
};
// application executing an algorithm
Handle(Message_ProgressIndicator) aProgress = new MyProgress();
MyAlgo anAlgo;
anAlgo.Perform ("FileName", aProgress->Start());
@endcode
@subsection upgrade_750_message_messenger Message_Messenger interface change
Operators << with left argument *Handle(Message_Messenger)*, used to output messages with

View File

@@ -1542,40 +1542,38 @@ Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (aDispCon
// create a Viewer to this Driver
Handle(V3d_Viewer) aViewer = new V3d_Viewer (aGraphicDriver);
aViewer->SetDefaultBackgroundColor (Quantity_NOC_DARKVIOLET);
aViewer->SetDefaultViewProj (V3d_Xpos);
// Create a structure in this Viewer
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (aViewer->Viewer());
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (aViewer->StructureManager());
aStruct->SetVisual (Graphic3d_TOS_SHADING); // Type of structure
// Create a group of primitives in this structure
Handle(Graphic3d_Group) aPrsGroup = new Graphic3d_Group (aStruct);
Handle(Graphic3d_Group) aPrsGroup = aStruct->NewGroup();
// Fill this group with one quad of size 100
Handle(Graphic3d_ArrayOfTriangleStrips) aTriangles = new Graphic3d_ArrayOfTriangleStrips (4);
aTriangles->AddVertex (-100./2., -100./2., 0.0);
aTriangles->AddVertex (-100./2., 100./2., 0.0);
aTriangles->AddVertex ( 100./2., -100./2., 0.0);
aTriangles->AddVertex ( 100./2., 100./2., 0.0);
Handle(Graphic3d_AspectFillArea3d) anAspects = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_RED,
Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0f,
Graphic3d_NOM_GOLD, Graphic3d_NOM_GOLD);
aPrsGroup->SetGroupPrimitivesAspect (anAspects);
aPrsGroup->AddPrimitiveArray (aTriangles);
aPrsGroup->SetGroupPrimitivesAspect (new Graphic3d_AspectFillArea3d());
// Create Ambient and Infinite Lights in this Viewer
Handle(V3d_AmbientLight) aLight1 = new V3d_AmbientLight (Quantity_NOC_GRAY50);
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (V3d_XnegYnegZneg, Quantity_NOC_WHITE);
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (V3d_Zneg, Quantity_NOC_WHITE, true);
aViewer->AddLight (aLight1);
aViewer->AddLight (aLight2);
aViewer->SetLightOn();
// Create a 3D quality Window with the same DisplayConnection
Handle(Xw_Window) aWindow = new Xw_Window (aDispConnection, "Test V3d", 100, 100, 500, 500);
aWindow->Map(); // Map this Window to this screen
// Create a Perspective View in this Viewer
Handle(V3d_View) aView = new V3d_View (aViewer);
aView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
// Associate this View with the Window
aView->SetWindow (aWindow);
// Display ALL structures in this View
aViewer->Viewer()->Display();
// Display presentation in this View
aStruct->Display();
// Finally update the Visualization in this View
aView->Update();
// Fit view to object size

View File

@@ -1,6 +1,7 @@
// include required OCCT headers
#include <Standard_Version.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressScope.hxx>
//for OCC graphic
#include <Aspect_DisplayConnection.hxx>
#include <WNT_Window.hxx>

View File

@@ -4,6 +4,7 @@
// include required OCCT headers
#include <Standard_Version.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressScope.hxx>
//for OCC graphic
#include <WNT_Window.hxx>
#include <WNT_WClass.hxx>

View File

@@ -128,7 +128,7 @@ myMainVwr(MainViewer),
myMainSel(new StdSelect_ViewerSelector3d()),
myToHilightSelected(Standard_True),
mySelection(new AIS_Selection()),
myFilters(new SelectMgr_OrFilter()),
myFilters (new SelectMgr_AndOrFilter(SelectMgr_FilterType_OR)),
myDefaultDrawer(new Prs3d_Drawer()),
myCurDetected(0),
myCurHighlighted(0),

View File

@@ -32,6 +32,7 @@
#include <Prs3d_Drawer.hxx>
#include <Prs3d_TypeOfHighlight.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_AndOrFilter.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <SelectMgr_ListOfFilter.hxx>
#include <SelectMgr_PickingStrategy.hxx>
@@ -46,7 +47,6 @@
class SelectMgr_SelectionManager;
class V3d_Viewer;
class SelectMgr_OrFilter;
class V3d_View;
class TopLoc_Location;
class TCollection_ExtendedString;
@@ -736,6 +736,15 @@ public: //! @name management of active Selection Modes
public: //! @name Selection Filters management
//! @return the context selection filter type.
SelectMgr_FilterType FilterType() const { return myFilters->FilterType(); }
//! Sets the context selection filter type.
//! SelectMgr_TypeFilter_OR selection filter is used by default.
//! @param theFilterType the filter type.
void SetFilterType (const SelectMgr_FilterType theFilterType)
{ myFilters->SetFilterType (theFilterType); }
//! Returns the list of filters active in a local context.
Standard_EXPORT const SelectMgr_ListOfFilter& Filters() const;
@@ -1332,14 +1341,7 @@ protected: //! @name internal methods
if (myLastPicked.IsNull())
return;
if (myLastPicked->IsAutoHilight())
{
myMainPM->ClearImmediateDraw();
}
else
{
myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
}
myLastPicked->Selectable()->ClearDynamicHighlight (myMainPM);
}
//! Bind/Unbind status to object and its children
@@ -1361,7 +1363,8 @@ protected: //! @name internal fields
Handle(SelectMgr_EntityOwner) myLastPicked;
Standard_Boolean myToHilightSelected;
Handle(AIS_Selection) mySelection;
Handle(SelectMgr_OrFilter) myFilters;
Handle(SelectMgr_AndOrFilter) myFilters; //!< context filter (the content active filters
//! can be applied with AND or OR operation)
Handle(Prs3d_Drawer) myDefaultDrawer;
Handle(Prs3d_Drawer) myStyles[Prs3d_TypeOfHighlight_NB];
TColStd_SequenceOfInteger myDetectedSeq;

View File

@@ -172,8 +172,8 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
{
const Handle(SelectMgr_EntityOwner) anOwner = aSelIter.Value();
const Handle(AIS_InteractiveObject) anInteractive = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
Handle(AIS_GlobalStatus) aStatus;
if (!myObjects.Find (anInteractive, aStatus))
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anInteractive);
if (!aStatusPtr)
{
continue;
}
@@ -183,9 +183,9 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
anOwner->Unhilight (myMainPM);
if (theIsToHilightSubIntensity)
{
if (aStatus->IsSubIntensityOn())
if ((*aStatusPtr)->IsSubIntensityOn())
{
const Standard_Integer aHiMode = getHilightMode (anInteractive, aStatus->HilightStyle(), aStatus->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (anInteractive, (*aStatusPtr)->HilightStyle(), (*aStatusPtr)->DisplayMode());
highlightWithSubintensity (anOwner, aHiMode);
}
}
@@ -196,7 +196,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th
}
if (anOwner == anInteractive->GlobalSelOwner())
{
aStatus->SetHilightStatus (Standard_False);
(*aStatusPtr)->SetHilightStatus (Standard_False);
}
}
for (NCollection_IndexedMap<Handle(AIS_InteractiveObject)>::Iterator anIter (anObjToClear); anIter.More(); anIter.Next())
@@ -746,11 +746,15 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
continue;
const Handle(Prs3d_Drawer)& anObjSelStyle = getSelStyle (anObj, anOwner);
Handle(AIS_GlobalStatus)& aState = myObjects.ChangeFind(anObj);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
{
continue;
}
if (anOwner == anObj->GlobalSelOwner())
{
aState->SetHilightStatus (Standard_True);
aState->SetHilightStyle (anObjSelStyle);
(*aStatusPtr)->SetHilightStatus (Standard_True);
(*aStatusPtr)->SetHilightStyle (anObjSelStyle);
}
if (!anOwner->IsAutoHilight())
{
@@ -768,7 +772,7 @@ void AIS_InteractiveContext::highlightOwners (const AIS_NListOfEntityOwner& theO
}
else
{
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, aState->DisplayMode());
const Standard_Integer aHiMode = getHilightMode (anObj, anObjSelStyle, (*aStatusPtr)->DisplayMode());
anOwner->HilightWithColor (myMainPM, anObjSelStyle, aHiMode);
}
}
@@ -872,7 +876,10 @@ void AIS_InteractiveContext::SetSelected (const Handle(AIS_InteractiveObject)& t
}
if (aSelOwner == aSelectable->GlobalSelOwner())
{
myObjects.ChangeFind (aSelectable)->SetHilightStatus (Standard_False);
if (Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (aSelectable))
{
(*aStatusPtr)->SetHilightStatus (Standard_False);
}
}
}
@@ -990,7 +997,12 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
if (myAutoHilight)
{
const Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable());
Handle(AIS_GlobalStatus)& aStatus = myObjects.ChangeFind (anObj);
Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (anObj);
if (!aStatusPtr)
{
return;
}
if (theOwner->IsSelected())
{
highlightSelected (theOwner);
@@ -1001,7 +1013,7 @@ void AIS_InteractiveContext::AddOrRemoveSelected (const Handle(SelectMgr_EntityO
anOwners.Append (theOwner);
unhighlightOwners (anOwners);
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
(*aStatusPtr)->SetHilightStyle (Handle(Prs3d_Drawer)());
}
}

View File

@@ -23,7 +23,6 @@
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>

View File

@@ -56,6 +56,20 @@ void AIS_InteractiveObject::Redisplay (const Standard_Boolean AllModes)
myCTXPtr->Redisplay (this, Standard_False, AllModes);
}
//=======================================================================
//function : ProcessDragging
//purpose :
//=======================================================================
Standard_Boolean AIS_InteractiveObject::ProcessDragging (const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&,
const Handle(SelectMgr_EntityOwner)&,
const Graphic3d_Vec2i&,
const Graphic3d_Vec2i&,
const AIS_DragAction)
{
return Standard_False;
}
//=======================================================================
//function :
//purpose :

View File

@@ -18,12 +18,14 @@
#define _AIS_InteractiveObject_HeaderFile
#include <AIS_KindOfInteractive.hxx>
#include <AIS_DragAction.hxx>
#include <SelectMgr_SelectableObject.hxx>
class AIS_InteractiveContext;
class Graphic3d_MaterialAspect;
class Prs3d_BasicAspect;
class Bnd_Box;
class V3d_View;
//! Defines a class of objects with display and selection services.
//! Entities which are visualized and selected are Interactive Objects.
@@ -103,6 +105,21 @@ public:
//! This method removes the owner from the graphic entity.
void ClearOwner() { myOwner.Nullify(); }
//! Drag object in the viewer.
//! @param theCtx [in] interactive context
//! @param theView [in] active View
//! @param theOwner [in] the owner of detected entity
//! @param theDragFrom [in] drag start point
//! @param theDragTo [in] drag end point
//! @param theAction [in] drag action
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
Standard_EXPORT virtual Standard_Boolean ProcessDragging (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const Handle(SelectMgr_EntityOwner)& theOwner,
const Graphic3d_Vec2i& theDragFrom,
const Graphic3d_Vec2i& theDragTo,
const AIS_DragAction theAction);
public:
//! Returns the context pointer to the interactive context.

View File

@@ -639,6 +639,44 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t
return Standard_False;
}
//=======================================================================
//function : ProcessDragging
//purpose :
//=======================================================================
Standard_Boolean AIS_Manipulator::ProcessDragging (const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView,
const Handle(SelectMgr_EntityOwner)&,
const Graphic3d_Vec2i& theDragFrom,
const Graphic3d_Vec2i& theDragTo,
const AIS_DragAction theAction)
{
switch (theAction)
{
case AIS_DragAction_Start:
{
if (HasActiveMode())
{
StartTransform (theDragFrom.x(), theDragFrom.y(), theView);
return Standard_True;
}
break;
}
case AIS_DragAction_Update:
{
Transform (theDragTo.x(), theDragTo.y(), theView);
return Standard_True;
}
case AIS_DragAction_Abort:
{
StopTransform (false);
return Standard_True;
}
case AIS_DragAction_Stop:
break;
}
return Standard_False;
}
//=======================================================================
//function : StartTransform
//purpose :

View File

@@ -163,6 +163,20 @@ public:
}
public:
//! Drag object in the viewer.
//! @param theCtx [in] interactive context
//! @param theView [in] active View
//! @param theOwner [in] the owner of detected entity
//! @param theDragFrom [in] drag start point
//! @param theDragTo [in] drag end point
//! @param theAction [in] drag action
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
Standard_EXPORT virtual Standard_Boolean ProcessDragging (const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const Handle(SelectMgr_EntityOwner)& theOwner,
const Graphic3d_Vec2i& theDragFrom,
const Graphic3d_Vec2i& theDragTo,
const AIS_DragAction theAction) Standard_OVERRIDE;
//! Init start (reference) transformation.
//! @warning It is used in chain with StartTransform-Transform(gp_Trsf)-StopTransform

View File

@@ -20,6 +20,7 @@
#include <Font_Rect.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_RenderingParams.hxx>
#include <Graphic3d_Text.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
@@ -308,7 +309,9 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
{
aHasOwnAnchor = Standard_False; // always not using own anchor if flipping
}
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, anOrientation, aHasOwnAnchor);
Handle(Graphic3d_Text) aText =
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, anOrientation, aHasOwnAnchor);
aText->SetTextFormatter (myFormatter);
if (myHasFlipping && isInit)
{
thePrs->CurrentGroup()->SetFlippingOptions (Standard_False, gp_Ax2());
@@ -316,7 +319,9 @@ void AIS_TextLabel::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePr
}
else
{
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, aPosition);
Handle(Graphic3d_Text) aText =
Prs3d_Text::Draw (thePrs->CurrentGroup(), anAsp, myText, aPosition);
aText->SetTextFormatter (myFormatter);
}
if (isInit)

View File

@@ -24,6 +24,8 @@
#include <Font_FontAspect.hxx>
#include <TCollection_ExtendedString.hxx>
class Font_TextFormatter;
//! Presentation of the text.
class AIS_TextLabel : public AIS_InteractiveObject
{
@@ -121,6 +123,12 @@ public:
//! and the colour of backgroubd for the TODT_DEKALE TextDisplayType.
Standard_EXPORT void SetColorSubTitle (const Quantity_Color& theColor);
//! Returns text presentation formatter; NULL by default, which means standard text formatter will be used.
const Handle(Font_TextFormatter)& TextFormatter() const { return myFormatter; }
//! Setup text formatter for presentation. It's empty by default.
void SetTextFormatter (const Handle(Font_TextFormatter)& theFormatter) { myFormatter = theFormatter; }
protected:
//! Compute
@@ -144,6 +152,8 @@ protected:
protected:
Handle(Font_TextFormatter) myFormatter;
TCollection_ExtendedString myText;
gp_Ax2 myOrientation3D;
Standard_Boolean myHasOrientation3D;

View File

@@ -15,7 +15,6 @@
#include <AIS_AnimationCamera.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Manipulator.hxx>
#include <AIS_Point.hxx>
#include <AIS_RubberBand.hxx>
#include <AIS_XRTrackedDevice.hxx>
@@ -2611,19 +2610,20 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
case AIS_DragAction_Start:
{
myDragObject.Nullify();
myDragOwner.Nullify();
if (!theCtx->HasDetected())
{
return;
}
Handle(AIS_InteractiveObject) aPrs = theCtx->DetectedInteractive();
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (aPrs))
const Handle(SelectMgr_EntityOwner)& aDetectedOwner = theCtx->DetectedOwner();
Handle(AIS_InteractiveObject) aDetectedPrs = Handle(AIS_InteractiveObject)::DownCast (aDetectedOwner->Selectable());
if (aDetectedPrs->ProcessDragging (theCtx, theView, aDetectedOwner, myGL.Dragging.PointStart,
myGL.Dragging.PointTo, theAction))
{
if (aManip->HasActiveMode())
{
myDragObject = aManip;
aManip->StartTransform (myGL.Dragging.PointStart.x(), myGL.Dragging.PointStart.y(), theView);
}
myDragObject = aDetectedPrs;
myDragOwner = aDetectedOwner;
}
return;
}
@@ -2638,10 +2638,9 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
{
theCtx->SetSelectedState (aGlobOwner, true);
}
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (myDragObject))
{
aManip->Transform (myGL.Dragging.PointTo.x(), myGL.Dragging.PointTo.y(), theView);
}
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
myGL.Dragging.PointTo, theAction);
theView->Invalidate();
return;
}
@@ -2655,10 +2654,8 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
myGL.Dragging.PointTo = myGL.Dragging.PointStart;
OnObjectDragged (theCtx, theView, AIS_DragAction_Update);
if (Handle(AIS_Manipulator) aManip = Handle(AIS_Manipulator)::DownCast (myDragObject))
{
aManip->StopTransform (false);
}
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
myGL.Dragging.PointTo, theAction);
Standard_FALLTHROUGH
}
case AIS_DragAction_Stop:
@@ -2673,8 +2670,11 @@ void AIS_ViewController::OnObjectDragged (const Handle(AIS_InteractiveContext)&
theCtx->SetSelectedState (aGlobOwner, false);
}
myDragObject->ProcessDragging (theCtx, theView, myDragOwner, myGL.Dragging.PointStart,
myGL.Dragging.PointTo, theAction);
theView->Invalidate();
myDragObject.Nullify();
myDragOwner.Nullify();
return;
}
}

View File

@@ -40,6 +40,7 @@ class AIS_Point;
class AIS_RubberBand;
class AIS_XRTrackedDevice;
class Graphic3d_Camera;
class SelectMgr_EntityOwner;
class V3d_View;
class WNT_HIDSpaceMouse;
@@ -737,6 +738,7 @@ protected:
Handle(AIS_AnimationCamera) myViewAnimation; //!< view animation
Handle(AIS_RubberBand) myRubberBand; //!< Rubber-band presentation
Handle(SelectMgr_EntityOwner) myDragOwner; //!< detected owner of currently dragged object
Handle(AIS_InteractiveObject) myDragObject; //!< currently dragged object
Graphic3d_Vec2i myPrevMoveTo; //!< previous position of MoveTo event in 3D viewer
Standard_Boolean myHasHlrOnBeforeRotation; //!< flag for restoring Computed mode after rotation

View File

@@ -357,7 +357,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
aChecker.SetNonDestructive(Standard_True);
aChecker.SetRunParallel(myRunParallel);
aChecker.SetFuzzyValue(myFuzzyValue);
aChecker.SetProgressIndicator(myProgressIndicator);
aChecker.SetProgressIndicator(*myProgressScope);
//
aChecker.Perform();
Standard_Boolean hasError = aChecker.HasErrors();

View File

@@ -388,7 +388,7 @@ void BOPAlgo_BOP::Perform()
pPF=new BOPAlgo_PaveFiller(aAllocator);
pPF->SetArguments(aLS);
pPF->SetRunParallel(myRunParallel);
pPF->SetProgressIndicator(myProgressIndicator);
pPF->SetProgressIndicator(*myProgressScope);
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);

View File

@@ -195,7 +195,7 @@ void BOPAlgo_Builder::Perform()
//
pPF->SetArguments(myArguments);
pPF->SetRunParallel(myRunParallel);
pPF->SetProgressIndicator(myProgressIndicator);
pPF->SetProgressIndicator(*myProgressScope);
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);
@@ -632,7 +632,7 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
aBS.SetRunParallel(myRunParallel);
aBS.SetContext(myContext);
aBS.SetFuzzyValue(myFuzzyValue);
aBS.SetProgressIndicator(myProgressIndicator);
aBS.SetProgressIndicator(*myProgressScope);
aBS.Perform();
// Resulting solids

View File

@@ -438,7 +438,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
aBF.SetFace(aF);
aBF.SetShapes(aLE);
aBF.SetRunParallel(myRunParallel);
aBF.SetProgressIndicator(myProgressIndicator);
aBF.SetProgressIndicator(*myProgressScope);
//
}// for (i=0; i<aNbS; ++i) {
//
@@ -625,7 +625,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
aPSB.Shape1() = aF1;
aPSB.Shape2() = aF2;
aPSB.SetFuzzyValue(myFuzzyValue);
aPSB.SetProgressIndicator(myProgressIndicator);
aPSB.SetProgressIndicator(*myProgressScope);
}
}
}
@@ -778,7 +778,7 @@ void BOPAlgo_Builder::FillInternalVertices()
aVFI.SetVertex(aV);
aVFI.SetFace(aFIm);
aVFI.SetFuzzyValue(myFuzzyValue);
aVFI.SetProgressIndicator(myProgressIndicator);
aVFI.SetProgressIndicator(*myProgressScope);
}
}
}

View File

@@ -432,7 +432,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
aBS.SetSolid(aSolid);
aBS.SetShapes(aSFS);
aBS.SetRunParallel(myRunParallel);
aBS.SetProgressIndicator(myProgressIndicator);
aBS.SetProgressIndicator(*myProgressScope);
}//for (i=0; i<aNbS; ++i) {
//
Standard_Integer k, aNbBS;

View File

@@ -432,7 +432,7 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
aFaceSelfIntersect.SetFace(aF);
aFaceSelfIntersect.SetTolF(aTolF);
//
aFaceSelfIntersect.SetProgressIndicator(myProgressIndicator);
aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
}
Standard_Integer aNbFace = aVFace.Length();

View File

@@ -86,7 +86,7 @@ void BOPAlgo_MakerVolume::Perform()
}
//
pPF->SetRunParallel(myRunParallel);
pPF->SetProgressIndicator(myProgressIndicator);
pPF->SetProgressIndicator(*myProgressScope);
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);

View File

@@ -15,8 +15,9 @@
#include <BOPAlgo_Options.hxx>
#include <Message_MsgFile.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressScope.hxx>
#include <NCollection_BaseAllocator.hxx>
#include <TCollection_AsciiString.hxx>
#include <Precision.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_ProgramError.hxx>
@@ -51,6 +52,7 @@ BOPAlgo_Options::BOPAlgo_Options()
myReport(new Message_Report),
myRunParallel(myGlobalRunParallel),
myFuzzyValue(Precision::Confusion()),
myProgressScope(0L),
myUseOBB(Standard_False)
{
BOPAlgo_LoadMessages();
@@ -67,6 +69,7 @@ BOPAlgo_Options::BOPAlgo_Options
myReport(new Message_Report),
myRunParallel(myGlobalRunParallel),
myFuzzyValue(Precision::Confusion()),
myProgressScope(0L),
myUseOBB(Standard_False)
{
BOPAlgo_LoadMessages();
@@ -132,22 +135,21 @@ void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz)
//purpose :
//=======================================================================
void BOPAlgo_Options::SetProgressIndicator
(const Handle(Message_ProgressIndicator)& theObj)
(const Message_ProgressScope& theScope)
{
if (!theObj.IsNull()) {
myProgressIndicator = theObj;
}
myProgressScope = &theScope;
}
//=======================================================================
//function : UserBreak
//purpose :
//=======================================================================
void BOPAlgo_Options::UserBreak() const
{
if (myProgressIndicator.IsNull()) {
if (!myProgressScope) {
return;
}
if (myProgressIndicator->UserBreak()) {
if (myProgressScope->UserBreak()) {
throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
}
}

View File

@@ -20,7 +20,7 @@
#include <NCollection_BaseAllocator.hxx>
class Message_ProgressIndicator;
class Message_ProgressScope;
//! The class provides the following options for the algorithms in Boolean Component:
//! - *Memory allocation tool* - tool for memory allocations;
@@ -156,7 +156,7 @@ public:
//!@name Progress indicator
//! Set the Progress Indicator object.
Standard_EXPORT void SetProgressIndicator(const Handle(Message_ProgressIndicator)& theObj);
Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress);
public:
//!@name Usage of Oriented Bounding boxes
@@ -185,7 +185,7 @@ protected:
Handle(Message_Report) myReport;
Standard_Boolean myRunParallel;
Standard_Real myFuzzyValue;
Handle(Message_ProgressIndicator) myProgressIndicator;
const Message_ProgressScope* myProgressScope;
Standard_Boolean myUseOBB;
};

View File

@@ -264,7 +264,7 @@ void BOPAlgo_PaveFiller::IntersectVE
aVESolver.SetEdge(aE);
aVESolver.SetPaveBlock(aPB);
aVESolver.SetFuzzyValue(myFuzzyValue);
aVESolver.SetProgressIndicator(myProgressIndicator);
aVESolver.SetProgressIndicator(*myProgressScope);
}
}
//

View File

@@ -253,7 +253,7 @@ void BOPAlgo_PaveFiller::PerformEE()
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
anEdgeEdge.SetBoxes (aBB1, aBB2);
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
anEdgeEdge.SetProgressIndicator(myProgressIndicator);
anEdgeEdge.SetProgressIndicator(*myProgressScope);
}//for (; aIt2.More(); aIt2.Next()) {
}//for (; aIt1.More(); aIt1.Next()) {
}//for (; myIterator->More(); myIterator->Next()) {
@@ -1073,7 +1073,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
anEdgeEdge.SetFuzzyValue(myFuzzyValue + aTolAdd);
else
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
anEdgeEdge.SetProgressIndicator(myProgressIndicator);
anEdgeEdge.SetProgressIndicator(*myProgressScope);
}
}
}

View File

@@ -217,7 +217,7 @@ void BOPAlgo_PaveFiller::PerformVF()
aVertexFace.SetVertex(aV);
aVertexFace.SetFace(aF);
aVertexFace.SetFuzzyValue(myFuzzyValue);
aVertexFace.SetProgressIndicator(myProgressIndicator);
aVertexFace.SetProgressIndicator(*myProgressScope);
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbVF=aVVF.Length();

View File

@@ -278,7 +278,7 @@ void BOPAlgo_PaveFiller::PerformEF()
aSR = aPBRange;
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
aEdgeFace.SetRange (aPBRange);
aEdgeFace.SetProgressIndicator(myProgressIndicator);
aEdgeFace.SetProgressIndicator(*myProgressScope);
// Save the pair to avoid their forced intersection
BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
if (!pMPB)
@@ -999,7 +999,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
aEdgeFace.SetProgressIndicator(myProgressIndicator);
aEdgeFace.SetProgressIndicator(*myProgressScope);
}
}
}

View File

@@ -306,7 +306,7 @@ void BOPAlgo_PaveFiller::PerformFF()
//
aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
aFaceFace.SetFuzzyValue(myFuzzyValue);
aFaceFace.SetProgressIndicator(myProgressIndicator);
aFaceFace.SetProgressIndicator(*myProgressScope);
}
else {
// for the Glue mode just add all interferences of that type
@@ -1007,7 +1007,7 @@ void BOPAlgo_PaveFiller::PostTreatFF
}
//
// 2 Fuse shapes
aPF.SetProgressIndicator(myProgressIndicator);
aPF.SetProgressIndicator(*myProgressScope);
aPF.SetRunParallel(myRunParallel);
aPF.SetArguments(aLS);
aPF.Perform();

View File

@@ -484,7 +484,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
aBSE.SetCommonBlock(aCB);
}
aBSE.SetDS(myDS);
aBSE.SetProgressIndicator(myProgressIndicator);
aBSE.SetProgressIndicator(*myProgressScope);
} // for (; aItPB.More(); aItPB.Next()) {
} // for (i=0; i<aNbPBP; ++i) {
//
@@ -596,7 +596,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
BOPAlgo_MPC& aMPC=aVMPC.Appended();
aMPC.SetEdge(aE);
aMPC.SetFace(aF1F);
aMPC.SetProgressIndicator(myProgressIndicator);
aMPC.SetProgressIndicator(*myProgressScope);
}
//
// On
@@ -660,7 +660,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
aMPC.SetEdge(aE);
aMPC.SetFace(aF1F);
aMPC.SetProgressIndicator(myProgressIndicator);
aMPC.SetProgressIndicator(*myProgressScope);
}
}// for (i=0; i<aNbFI; ++i) {
//
@@ -710,7 +710,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
aMPC.SetEdge(aE);
aMPC.SetFace(aFf[m]);
aMPC.SetFlag(Standard_True);
aMPC.SetProgressIndicator(myProgressIndicator);
aMPC.SetProgressIndicator(*myProgressScope);
}
}
}

View File

@@ -89,7 +89,7 @@ void BOPAlgo_Splitter::Perform()
BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
pPF->SetArguments(aLS);
pPF->SetRunParallel(myRunParallel);
pPF->SetProgressIndicator(myProgressIndicator);
pPF->SetProgressIndicator(*myProgressScope);
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);

View File

@@ -24,9 +24,8 @@
#include <Standard_Boolean.hxx>
#include <BRepBuilderAPI_MakeShape.hxx>
#include <BOPAlgo_Options.hxx>
class Message_ProgressIndicator;
class TopoDS_Shape;
class TopoDS_Shape;
//! Provides the root interface for the API algorithms

View File

@@ -125,7 +125,7 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
myDSFiller->SetArguments(theArgs);
// Set options for intersection
myDSFiller->SetRunParallel(myRunParallel);
myDSFiller->SetProgressIndicator(myProgressIndicator);
myDSFiller->SetProgressIndicator(*myProgressScope);
myDSFiller->SetFuzzyValue(myFuzzyValue);
myDSFiller->SetNonDestructive(myNonDestructive);
myDSFiller->SetGlue(myGlue);
@@ -145,7 +145,7 @@ void BRepAlgoAPI_BuilderAlgo::BuildResult()
{
// Set options to the builder
myBuilder->SetRunParallel(myRunParallel);
myBuilder->SetProgressIndicator(myProgressIndicator);
myBuilder->SetProgressIndicator(*myProgressScope);
myBuilder->SetCheckInverted(myCheckInverted);
myBuilder->SetToFillHistory(myFillHistory);
// Perform building of the result with pre-calculated intersections

View File

@@ -94,7 +94,7 @@ void BRepAlgoAPI_Check::Perform()
anAnalyzer.SelfInterMode() = myTestSI;
// Set options from BOPAlgo_Options
anAnalyzer.SetRunParallel(myRunParallel);
anAnalyzer.SetProgressIndicator(myProgressIndicator);
anAnalyzer.SetProgressIndicator(*myProgressScope);
anAnalyzer.SetFuzzyValue(myFuzzyValue);
// Perform the check
anAnalyzer.Perform();

View File

@@ -85,8 +85,7 @@
#include <GeomLib.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressSentry.hxx>
#include <Message_ProgressScope.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <Precision.hxx>
#include <Standard_ErrorHandler.hxx>
@@ -1812,10 +1811,10 @@ void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
#include <OSD_Timer.hxx>
#endif
void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& thePI)
void BRepBuilderAPI_Sewing::Perform(const Message_ProgressRange& theProgress)
{
const Standard_Integer aNumberOfStages = myAnalysis + myCutting + mySewing + 2;
Message_ProgressSentry aPS (thePI, "Sewing", 0, aNumberOfStages, 1);
Message_ProgressScope aPS (theProgress, "Sewing", aNumberOfStages);
#ifdef OCCT_DEBUG
Standard_Real t_total = 0., t_analysis = 0., t_assembling = 0., t_cutting = 0., t_merging = 0.;
OSD_Chronometer chr_total, chr_local;
@@ -1831,10 +1830,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
chr_local.Reset();
chr_local.Start();
#endif
FaceAnalysis (thePI);
FaceAnalysis (aPS.Next());
if (!aPS.More())
return;
aPS.Next();
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_analysis);
@@ -1855,10 +1853,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
chr_local.Reset();
chr_local.Start();
#endif
VerticesAssembling (thePI);
VerticesAssembling (aPS.Next());
if (!aPS.More())
return;
aPS.Next();
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_assembling);
@@ -1871,10 +1868,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
chr_local.Reset();
chr_local.Start();
#endif
Cutting (thePI);
Cutting (aPS.Next());
if (!aPS.More())
return;
aPS.Next();
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_cutting);
@@ -1886,10 +1882,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
chr_local.Reset();
chr_local.Start();
#endif
Merging (Standard_True, thePI);
Merging (Standard_True, aPS.Next());
if (!aPS.More())
return;
aPS.Next();
#ifdef OCCT_DEBUG
chr_local.Stop();
chr_local.Show(t_merging);
@@ -1898,10 +1893,10 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
}
else
{
aPS.Next( 1, Handle(TCollection_HAsciiString)());
aPS.Next();
if (myCutting)
aPS.Next( 1, Handle(TCollection_HAsciiString)());
aPS.Next( 1, Handle(TCollection_HAsciiString)());
aPS.Next();
aPS.Next();
if (!aPS.More())
return;
}
@@ -1913,7 +1908,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
std::cout << "Creating sewed shape..." << std::endl;
#endif
// examine the multiple edges if any and process sameparameter for edges if necessary
EdgeProcessing (thePI);
EdgeProcessing (aPS.Next());
if (!aPS.More())
return;
CreateSewedShape();
@@ -1923,7 +1918,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
return;
}
EdgeRegularity (thePI);
EdgeRegularity (aPS.Next());
if (mySameParameterMode && myFaceMode)
SameParameterShape();
@@ -2235,7 +2230,7 @@ void BRepBuilderAPI_Sewing::Dump() const
// myDegenerated
//=======================================================================
void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)& thePI)
void BRepBuilderAPI_Sewing::FaceAnalysis(const Message_ProgressRange& theProgress)
{
if (!myShape.IsNull() && myOldShapes.IsEmpty()) {
Add(myShape);
@@ -2246,7 +2241,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
TopTools_MapOfShape SmallEdges;
TopTools_IndexedDataMapOfShapeListOfShape GluedVertices;
Standard_Integer i = 1;
Message_ProgressSentry aPS (thePI, "Shape analysis", 0, myOldShapes.Extent(), 1);
Message_ProgressScope aPS (theProgress, "Shape analysis", myOldShapes.Extent());
for (i = 1; i <= myOldShapes.Extent() && aPS.More(); i++, aPS.Next()) {
for (TopExp_Explorer fexp(myOldShapes(i),TopAbs_FACE); fexp.More(); fexp.Next()) {
@@ -2777,7 +2772,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
TopTools_DataMapOfShapeListOfShape& aNodeEdges,
const TopTools_IndexedDataMapOfShapeListOfShape& aBoundFaces,
const Standard_Real Tolerance,
const Handle(Message_ProgressIndicator)& theProgress)
const Message_ProgressRange& theProgress)
{
// Create map of node -> vertices
TopTools_IndexedDataMapOfShapeListOfShape NodeVertices;
@@ -2805,7 +2800,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
#endif
// Merge nearest nodes
TopTools_IndexedDataMapOfShapeShape NodeNearestNode;
Message_ProgressSentry aPS (theProgress, "Glueing nodes", 0, nbNodes, 1, Standard_True);
Message_ProgressScope aPS (theProgress, "Glueing nodes", nbNodes, Standard_True);
for (Standard_Integer i = 1; i <= nbNodes && aPS.More(); i++, aPS.Next()) {
const TopoDS_Vertex& node1 = TopoDS::Vertex(NodeVertices.FindKey(i));
// Find near nodes
@@ -2938,11 +2933,11 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
return CreateNewNodes(NodeNearestNode,NodeVertices,aVertexNode,aNodeEdges);
}
void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndicator)& thePI)
void BRepBuilderAPI_Sewing::VerticesAssembling(const Message_ProgressRange& theProgress)
{
Standard_Integer nbVert = myVertexNode.Extent();
Standard_Integer nbVertFree = myVertexNodeFree.Extent();
Message_ProgressSentry aPS (thePI, "Vertices assembling", 0, 2, 1);
Message_ProgressScope aPS (theProgress, "Vertices assembling", 2);
if (nbVert || nbVertFree) {
// Fill map node -> sections
Standard_Integer i;
@@ -2964,16 +2959,15 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
#ifdef OCCT_DEBUG
std::cout << "Assemble " << nbVert << " vertices on faces..." << std::endl;
#endif
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, thePI));
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, aPS.Next()));
}
if (!aPS.More())
return;
aPS.Next();
if (nbVertFree) {
#ifdef OCCT_DEBUG
std::cout << "Assemble " << nbVertFree << " vertices on floating edges..." << std::endl;
#endif
while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, thePI));
while (GlueVertices(myVertexNodeFree,myNodeSections,myBoundFaces,myTolerance, aPS.Next()));
}
}
}
@@ -3133,11 +3127,11 @@ static void ReplaceEdge(const TopoDS_Shape& oldEdge,
//=======================================================================
void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
const Handle(Message_ProgressIndicator)& thePI)
const Message_ProgressRange& theProgress)
{
BRep_Builder B;
// TopTools_MapOfShape MergedEdges;
Message_ProgressSentry aPS (thePI, "Merging bounds", 0, myBoundFaces.Extent(), 1);
Message_ProgressScope aPS (theProgress, "Merging bounds", myBoundFaces.Extent());
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
@@ -3623,7 +3617,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
// myCuttingNode
//=======================================================================
void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& thePI)
void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress)
{
Standard_Integer i, nbVertices = myVertexNode.Extent();
if (!nbVertices) return;
@@ -3646,7 +3640,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
Standard_Real first, last;
// Iterate on all boundaries
Standard_Integer nbBounds = myBoundFaces.Extent();
Message_ProgressSentry aPS (thePI, "Cutting bounds", 0, nbBounds, 1);
Message_ProgressScope aPS (theProgress, "Cutting bounds", nbBounds);
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
const TopoDS_Edge& bound = TopoDS::Edge(anIterB.Key());
@@ -3986,12 +3980,12 @@ static TopoDS_Edge DegeneratedSection(const TopoDS_Shape& section, const TopoDS_
// - make the contigous edges sameparameter
//=======================================================================
void BRepBuilderAPI_Sewing::EdgeProcessing(const Handle(Message_ProgressIndicator)& thePI)
void BRepBuilderAPI_Sewing::EdgeProcessing(const Message_ProgressRange& theProgress)
{
// constructs sectionEdge
TopTools_IndexedMapOfShape MapFreeEdges;
TopTools_DataMapOfShapeShape EdgeFace;
Message_ProgressSentry aPS (thePI, "Edge processing", 0, myBoundFaces.Extent(), 1);
Message_ProgressScope aPS (theProgress, "Edge processing", myBoundFaces.Extent());
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
const TopoDS_Shape& bound = anIterB.Key();
@@ -4051,12 +4045,12 @@ void BRepBuilderAPI_Sewing::EdgeProcessing(const Handle(Message_ProgressIndicato
//purpose : update Continuity flag on newly created edges
//=======================================================================
void BRepBuilderAPI_Sewing::EdgeRegularity(const Handle(Message_ProgressIndicator)& thePI)
void BRepBuilderAPI_Sewing::EdgeRegularity(const Message_ProgressRange& theProgress)
{
TopTools_IndexedDataMapOfShapeListOfShape aMapEF;
TopExp::MapShapesAndAncestors(mySewedShape, TopAbs_EDGE, TopAbs_FACE, aMapEF);
Message_ProgressSentry aPS(thePI, "Encode edge regularity", 0, myMergedEdges.Extent(), 1);
Message_ProgressScope aPS(theProgress, "Encode edge regularity", myMergedEdges.Extent());
for (TopTools_MapIteratorOfMapOfShape aMEIt(myMergedEdges); aMEIt.More() && aPS.More(); aMEIt.Next(), aPS.Next())
{
TopoDS_Edge anEdge = TopoDS::Edge(myReShape->Apply(aMEIt.Value()));

View File

@@ -41,13 +41,12 @@
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressRange.hxx>
class BRepTools_ReShape;
class Standard_OutOfRange;
class Standard_NoSuchObject;
class TopoDS_Shape;
class Message_ProgressIndicator;
class TopoDS_Edge;
class TopoDS_Face;
class Geom_Surface;
@@ -105,8 +104,8 @@ public:
Standard_EXPORT void Add (const TopoDS_Shape& shape);
//! Computing
//! thePI - progress indicator of algorithm
Standard_EXPORT void Perform (const Handle(Message_ProgressIndicator)& thePI = 0);
//! theProgress - progress indicator of algorithm
Standard_EXPORT void Perform (const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Gives the sewed shape
//! a null shape if nothing constructed
@@ -248,10 +247,10 @@ protected:
//! Performs cutting of sections
//! thePI - progress indicator of processing
Standard_EXPORT void Cutting (const Handle(Message_ProgressIndicator)& thePI = 0);
//! theProgress - progress indicator of processing
Standard_EXPORT void Cutting (const Message_ProgressRange& theProgress = Message_ProgressRange());
Standard_EXPORT void Merging (const Standard_Boolean passage, const Handle(Message_ProgressIndicator)& thePI = 0);
Standard_EXPORT void Merging (const Standard_Boolean passage, const Message_ProgressRange& theProgress = Message_ProgressRange());
Standard_EXPORT Standard_Boolean IsMergedClosed (const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const TopoDS_Face& fase) const;
@@ -262,10 +261,10 @@ protected:
//! Merged nearest edges.
Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfBoolean& SeqMergedOri);
Standard_EXPORT void EdgeProcessing (const Handle(Message_ProgressIndicator)& thePI = 0);
Standard_EXPORT void EdgeProcessing (const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Recompute regularity on merged edges
Standard_EXPORT void EdgeRegularity (const Handle(Message_ProgressIndicator)& thePI = 0);
Standard_EXPORT void EdgeRegularity (const Message_ProgressRange& theProgress = Message_ProgressRange());
Standard_EXPORT void CreateOutputInformations();
@@ -277,8 +276,8 @@ protected:
//! This method is called from Perform only
//! thePI - progress indicator of processing
Standard_EXPORT virtual void FaceAnalysis (const Handle(Message_ProgressIndicator)& thePI = 0);
//! theProgress - progress indicator of processing
Standard_EXPORT virtual void FaceAnalysis (const Message_ProgressRange& theProgress = Message_ProgressRange());
//! This method is called from Perform only
@@ -286,8 +285,8 @@ protected:
//! This method is called from Perform only
//! thePI - progress indicator of processing
Standard_EXPORT virtual void VerticesAssembling (const Handle(Message_ProgressIndicator)& thePI = 0);
//! theProgress - progress indicator of processing
Standard_EXPORT virtual void VerticesAssembling (const Message_ProgressRange& theProgress = Message_ProgressRange());
//! This method is called from Perform only

View File

@@ -154,7 +154,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);
BRepExtrema_DistanceSS aDistTool (aShape1, aShape2, aBox1, aBox2, myDistRef, myEps, myFlag);
if (aDistTool.IsDone())
{
if (aDistTool.DistValue() < myDistRef - myEps)
@@ -199,8 +199,7 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
myEps (Precision::Confusion()),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (Extrema_ExtFlag_MINMAX),
myAlgo (Extrema_ExtAlgo_Grad)
myFlag (Extrema_ExtFlag_MINMAX)
{
//
}
@@ -211,16 +210,14 @@ BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape()
//=======================================================================
BRepExtrema_DistShapeShape::BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,
const TopoDS_Shape& Shape2,
const Extrema_ExtFlag F,
const Extrema_ExtAlgo A)
const Extrema_ExtFlag F)
: myDistRef (0.0),
myIsDone (Standard_False),
myInnerSol (Standard_False),
myEps (Precision::Confusion()),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (F),
myAlgo (A)
myFlag (F)
{
LoadS1(Shape1);
LoadS2(Shape2);
@@ -235,16 +232,14 @@ 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_ExtAlgo A)
const Extrema_ExtFlag F)
: myDistRef (0.0),
myIsDone (Standard_False),
myInnerSol (Standard_False),
myEps (theDeflection),
myIsInitS1 (Standard_False),
myIsInitS2 (Standard_False),
myFlag (F),
myAlgo (A)
myFlag (F)
{
LoadS1(Shape1);
LoadS2(Shape2);

View File

@@ -18,7 +18,6 @@
#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>
@@ -39,9 +38,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_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
//! 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_MINMAX,const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad);
Standard_EXPORT BRepExtrema_DistShapeShape(const TopoDS_Shape& Shape1,const TopoDS_Shape& Shape2,const Standard_Real theDeflection,const Extrema_ExtFlag F = Extrema_ExtFlag_MIN);
void SetDeflection(const Standard_Real theDeflection)
{
@@ -129,11 +128,6 @@ 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>
@@ -156,7 +150,6 @@ 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,myAlgo);
BRepExtrema_ExtPF Ext(S1,S2,myFlag);
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,myAlgo);
BRepExtrema_ExtPF Ext(S2,S1,myFlag);
const Standard_Integer NbExtrema = Ext.IsDone()? Ext.NbExt() : 0;
if ( NbExtrema > 0 )
{

View File

@@ -16,7 +16,6 @@
#include <BRepExtrema_SeqOfSolution.hxx>
#include <Extrema_ExtFlag.hxx>
#include <Extrema_ExtAlgo.hxx>
#include <Precision.hxx>
#include <Standard_DefineAlloc.hxx>
@@ -39,9 +38,8 @@ 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,
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F), myAlgo(A)
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
: myDstRef(DstRef), myModif(Standard_False), myEps(Precision::Confusion()), myFlag(F)
{
Perform(S1, S2, B1, B2);
}
@@ -52,9 +50,8 @@ 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,
const Extrema_ExtAlgo A = Extrema_ExtAlgo_Grad)
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F), myAlgo(A)
const Extrema_ExtFlag F = Extrema_ExtFlag_MINMAX)
: myDstRef(DstRef), myModif(Standard_False), myEps(aDeflection), myFlag(F)
{
Perform(S1, S2, B1, B2);
}
@@ -83,11 +80,6 @@ class BRepExtrema_DistanceSS
{
myFlag = F;
}
//! sets the flag controlling ...
void SetAlgo(const Extrema_ExtAlgo A)
{
myAlgo = A;
}
private:
@@ -130,7 +122,6 @@ 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_ExtAlgo TheAlgo)
const Extrema_ExtFlag TheFlag)
{
Initialize(TheFace,TheFlag,TheAlgo);
Initialize(TheFace,TheFlag);
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_ExtAlgo TheAlgo)
const Extrema_ExtFlag TheFlag)
{
// cette surface doit etre en champ. Extrema ne fait
// pas de copie et prend seulement un pointeur dessus.
@@ -60,7 +60,6 @@ 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,7 +21,6 @@
#include <Extrema_SequenceOfPOnSurf.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <Extrema_ExtFlag.hxx>
#include <Extrema_ExtAlgo.hxx>
class TopoDS_Vertex;
class TopoDS_Face;
@@ -38,12 +37,10 @@ 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_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
Standard_EXPORT void Initialize(const TopoDS_Face& TheFace,
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX);
//! 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>
@@ -79,11 +76,6 @@ class BRepExtrema_ExtPF
myExtPS.SetFlag(F);
}
void SetAlgo(const Extrema_ExtAlgo A)
{
myExtPS.SetAlgo(A);
}
private:
Extrema_ExtPS myExtPS;

View File

@@ -23,6 +23,7 @@
#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>
@@ -181,39 +182,6 @@ 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,
@@ -361,13 +329,13 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aKnots.SetValue (1, GC->FirstParameter());
aKnots.SetValue (2, GC->LastParameter());
fillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
GCPnts::FillParams (aKnots, GC->Degree(), dfUf, dfUl, aParams);
break;
}
case GeomAbs_BSplineCurve:
{
Handle(Geom_BSplineCurve) GC = c.BSpline();
fillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
GCPnts::FillParams (GC->Knots(), GC->Degree(), dfUf, dfUl, aParams);
break;
}
case GeomAbs_Line:
@@ -394,7 +362,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aBounds.SetValue (1, dfUf);
aBounds.SetValue (2, dfUl);
fillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
GCPnts::FillParams (aBounds, iNbPoints - 1, dfUf, dfUl, aParams);
}
}

View File

@@ -73,7 +73,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);
BRepExtrema_DistShapeShape dst(S1 ,S2, aDeflection, Extrema_ExtFlag_MIN);
if (dst.IsDone())
{

View File

@@ -36,6 +36,7 @@
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TCollection_AsciiString.hxx>
#include <Geom_Surface.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <TopTools_ListOfShape.hxx>
@@ -455,7 +456,7 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
aSewing.Add(aSeq.Value(i));
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDi, 1);
aSewing.Perform (aProgress);
aSewing.Perform (aProgress->Start());
aSewing.Dump();
const TopoDS_Shape& aRes = aSewing.SewedShape();
@@ -618,9 +619,9 @@ static Standard_Integer getedgeregul
//=======================================================================
static Standard_Integer projponf(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n < 3 || n > 5) {
if (n < 3 || n > 4) {
di << "Project point on the face.\n";
di << "Usage: projponf face pnt [extrema flag: -min/-max/-minmax] [extrema algo: -g(grad)/-t(tree)]\n";
di << "Usage: projponf face pnt [extrema flag: -min/-max/-minmax]\n";
return 1;
}
// get face
@@ -643,7 +644,6 @@ 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) {
@@ -656,12 +656,6 @@ 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
@@ -678,7 +672,6 @@ 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);
@@ -767,7 +760,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] [extrema algo: -g(grad)/-t(tree)]\n"
"projponf face pnt [extrema flag: -min/-max/-minmax]\n"
"\t\tProject point on the face.",
__FILE__, projponf, g);
}

View File

@@ -127,7 +127,8 @@ Handle(Transfer_FinderProcess) BRepToIGES_BREntity::GetTransferProcess() const
//purpose :
//=======================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BREntity::TransferShape
(const TopoDS_Shape& start)
(const TopoDS_Shape& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
// TopoDS_Shape theShape;
@@ -164,31 +165,31 @@ Handle(IGESData_IGESEntity) BRepToIGES_BREntity::TransferShape
TopoDS_Face F = TopoDS::Face(start);
BRepToIGES_BRShell BS(*this);
BS.SetModel(GetModel());
res = BS.TransferFace(F);
res = BS.TransferFace(F, theProgress);
}
else if (start.ShapeType() == TopAbs_SHELL) {
TopoDS_Shell S = TopoDS::Shell(start);
BRepToIGES_BRShell BS(*this);
BS.SetModel(GetModel());
res = BS.TransferShell(S);
res = BS.TransferShell(S, theProgress);
}
else if (start.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid M = TopoDS::Solid(start);
BRepToIGES_BRSolid BS(*this);
BS.SetModel(GetModel());
res = BS.TransferSolid(M);
res = BS.TransferSolid(M, theProgress);
}
else if (start.ShapeType() == TopAbs_COMPSOLID) {
TopoDS_CompSolid C = TopoDS::CompSolid(start);
BRepToIGES_BRSolid BS(*this);
BS.SetModel(GetModel());
res = BS.TransferCompSolid(C);
res = BS.TransferCompSolid(C, theProgress);
}
else if (start.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Compound C = TopoDS::Compound(start);
BRepToIGES_BRSolid BS(*this);
BS.SetModel(GetModel());
res = BS.TransferCompound(C);
res = BS.TransferCompound(C, theProgress);
}
else {
// message d`erreur

View File

@@ -24,6 +24,8 @@
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Message_ProgressRange.hxx>
class IGESData_IGESModel;
class Transfer_FinderProcess;
class IGESData_IGESEntity;
@@ -64,7 +66,9 @@ public:
//! Returns the result of the transfert of any Shape
//! If the transfer has failed, this member return a NullEntity.
Standard_EXPORT virtual Handle(IGESData_IGESEntity) TransferShape (const TopoDS_Shape& start);
Standard_EXPORT virtual Handle(IGESData_IGESEntity) TransferShape
(const TopoDS_Shape& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Records a new Fail message
Standard_EXPORT void AddFail (const TopoDS_Shape& start, const Standard_CString amess);

View File

@@ -43,7 +43,7 @@
#include <IGESGeom_SurfaceOfRevolution.hxx>
#include <IGESGeom_TrimmedSurface.hxx>
#include <Interface_Macros.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressScope.hxx>
#include <NCollection_IncAllocator.hxx>
#include <NCollection_Map.hxx>
#include <ShapeAlgo.hxx>
@@ -86,7 +86,8 @@ BRepToIGES_BRShell::BRepToIGES_BRShell
// TransferShell
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferShell(const TopoDS_Shape& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferShell(const TopoDS_Shape& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
@@ -94,11 +95,11 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferShell(const TopoDS_Shap
if (start.ShapeType() == TopAbs_FACE) {
TopoDS_Face F = TopoDS::Face(start);
res = TransferFace(F);
res = TransferFace(F, theProgress);
}
else if (start.ShapeType() == TopAbs_SHELL) {
TopoDS_Shell S = TopoDS::Shell(start);
res = TransferShell(S);
res = TransferShell(S, theProgress);
}
else {
// message d`erreur
@@ -112,15 +113,10 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferShell(const TopoDS_Shap
//
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face& start,
const Message_ProgressRange&)
{
Handle(IGESData_IGESEntity) res;
Handle(Message_ProgressIndicator) progress = GetTransferProcess()->GetProgress();
if ( ! progress.IsNull() ) {
if ( progress->UserBreak() ) return res;
progress->Increment();
}
if ( start.IsNull()) {
return res;
@@ -340,7 +336,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
// TransferShell
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRShell::TransferShell(const TopoDS_Shell& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRShell::TransferShell(const TopoDS_Shell& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
if ( start.IsNull()) return res;
@@ -350,13 +347,19 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell::TransferShell(const TopoDS_Shell
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
Handle(IGESData_IGESEntity) IFace;
for (Ex.Init(start,TopAbs_FACE); Ex.More(); Ex.Next()) {
Standard_Integer nbshapes = 0;
for (Ex.Init(start, TopAbs_FACE); Ex.More(); Ex.Next())
nbshapes++;
Message_ProgressScope aPS(theProgress, NULL, nbshapes);
for (Ex.Init(start,TopAbs_FACE); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Face F = TopoDS::Face(Ex.Current());
if (F.IsNull()) {
AddWarning(start," a Face is a null entity");
}
else {
IFace = TransferFace(F);
IFace = TransferFace (F, aRange);
if (!IFace.IsNull()) Seq->Append(IFace);
}
}

View File

@@ -22,6 +22,8 @@
#include <Standard_Handle.hxx>
#include <BRepToIGES_BREntity.hxx>
#include <Message_ProgressRange.hxx>
class BRepToIGES_BREntity;
class IGESData_IGESEntity;
class TopoDS_Shape;
@@ -48,15 +50,18 @@ public:
//! Transfert an Shape entity from TopoDS to IGES
//! This entity must be a Face or a Shell.
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferShell (const TopoDS_Shape& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferShell (const TopoDS_Shape& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert an Shell entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferShell (const TopoDS_Shell& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferShell (const TopoDS_Shell& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert a Face entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferFace (const TopoDS_Face& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferFace (const TopoDS_Face& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());

View File

@@ -25,6 +25,7 @@
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <IGESData_IGESEntity.hxx>
#include <Interface_Macros.hxx>
#include <Message_ProgressScope.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp.hxx>
@@ -64,7 +65,8 @@ BRepToIGES_BRSolid::BRepToIGES_BRSolid
// TransferSolid
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Shape& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Shape& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
@@ -72,15 +74,15 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Shap
if (start.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid M = TopoDS::Solid(start);
res = TransferSolid(M);
res = TransferSolid(M, theProgress);
}
else if (start.ShapeType() == TopAbs_COMPSOLID) {
TopoDS_CompSolid C = TopoDS::CompSolid(start);
res = TransferCompSolid(C);
res = TransferCompSolid(C, theProgress);
}
else if (start.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Compound C = TopoDS::Compound(start);
res = TransferCompound(C);
res = TransferCompound(C, theProgress);
}
else {
// error message
@@ -94,7 +96,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Shap
//
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Solid& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Solid& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
if ( start.IsNull()) return res;
@@ -104,13 +107,19 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Soli
BRepToIGES_BRShell BS(*this);
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
for (Ex.Init(start,TopAbs_SHELL); Ex.More(); Ex.Next()) {
Standard_Integer nbshapes = 0;
for (Ex.Init(start, TopAbs_SHELL); Ex.More(); Ex.Next())
nbshapes++;
Message_ProgressScope aPS(theProgress, NULL, nbshapes);
for (Ex.Init(start,TopAbs_SHELL); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
if (S.IsNull()) {
AddWarning(start," an Shell is a null entity");
}
else {
IShell = BS.TransferShell(S);
IShell = BS.TransferShell (S, aRange);
if (!IShell.IsNull()) Seq->Append(IShell);
}
}
@@ -145,7 +154,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Soli
// TransferCompSolid
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompSolid(const TopoDS_CompSolid& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompSolid(const TopoDS_CompSolid& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
if ( start.IsNull()) return res;
@@ -154,13 +164,19 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompSolid(const TopoDS_
Handle(IGESData_IGESEntity) ISolid;
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
for (Ex.Init(start,TopAbs_SOLID); Ex.More(); Ex.Next()) {
Standard_Integer nbshapes = 0;
for (Ex.Init(start, TopAbs_SOLID); Ex.More(); Ex.Next())
nbshapes++;
Message_ProgressScope aPS(theProgress, NULL, nbshapes);
for (Ex.Init(start,TopAbs_SOLID); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
if (S.IsNull()) {
AddWarning(start," an Solid is a null entity");
}
else {
ISolid = TransferSolid(S);
ISolid = TransferSolid (S, aRange);
if (!ISolid.IsNull()) Seq->Append(ISolid);
}
}
@@ -195,7 +211,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompSolid(const TopoDS_
// TransferCompound
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_Compound& start)
Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_Compound& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
if ( start.IsNull()) return res;
@@ -207,46 +224,69 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
BRepToIGES_BRWire BW(*this);
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
// count numbers of subshapes
Standard_Integer nbshapes = 0;
for (Ex.Init(start, TopAbs_SOLID); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_SHELL, TopAbs_SOLID); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_FACE, TopAbs_SHELL); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next())
nbshapes++;
Message_ProgressScope aPS(theProgress, NULL, nbshapes);
// take all Solids
for (Ex.Init(start, TopAbs_SOLID); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_SOLID); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Solid is a null entity");
}
else {
IShape = TransferSolid(S);
IShape = TransferSolid (S, aRange);
if (!IShape.IsNull()) Seq->Append(IShape);
}
}
// take all isolated Shells
for (Ex.Init(start, TopAbs_SHELL, TopAbs_SOLID); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_SHELL, TopAbs_SOLID); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Shell is a null entity");
}
else {
IShape = BS.TransferShell(S);
IShape = BS.TransferShell (S, aRange);
if (!IShape.IsNull()) Seq->Append(IShape);
}
}
// take all isolated Faces
for (Ex.Init(start, TopAbs_FACE, TopAbs_SHELL); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_FACE, TopAbs_SHELL); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Face S = TopoDS::Face(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Face is a null entity");
}
else {
IShape = BS.TransferFace(S);
IShape = BS.TransferFace (S, aRange);
if (!IShape.IsNull()) Seq->Append(IShape);
}
}
// take all isolated Wires
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Wire is a null entity");
@@ -259,7 +299,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
// take all isolated Edges
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
if (S.IsNull()) {
AddWarning(start," an Edge is a null entity");
@@ -272,7 +313,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
// take all isolated Vertices
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Vertex is a null entity");
@@ -284,7 +326,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
}
// construct the group
Standard_Integer nbshapes = Seq->Length();
nbshapes = Seq->Length();
Handle(IGESData_HArray1OfIGESEntity) Tab;
if (nbshapes >=1) {
Tab = new IGESData_HArray1OfIGESEntity(1,nbshapes);

View File

@@ -49,19 +49,23 @@ public:
//! Transfert a Shape entity from TopoDS to IGES
//! this entity must be a Solid or a CompSolid or a Compound.
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferSolid (const TopoDS_Shape& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferSolid (const TopoDS_Shape& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert a Solid entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferSolid (const TopoDS_Solid& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferSolid (const TopoDS_Solid& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert an CompSolid entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompSolid (const TopoDS_CompSolid& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompSolid (const TopoDS_CompSolid& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert a Compound entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompound (const TopoDS_Compound& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompound (const TopoDS_Compound& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());

View File

@@ -79,7 +79,7 @@
#include <IGESSolid_VertexList.hxx>
#include <Interface_Macros.hxx>
#include <Interface_Static.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressScope.hxx>
#include <ShapeAlgo.hxx>
#include <ShapeAlgo_AlgoContainer.hxx>
#include <TColgp_HArray1OfXYZ.hxx>
@@ -282,7 +282,8 @@ Standard_Integer BRepToIGESBRep_Entity::AddEdge(const TopoDS_Edge& myedge,
//purpose :
//=======================================================================
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape
(const TopoDS_Shape& start)
(const TopoDS_Shape& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
//TopoDS_Shape theShape;
@@ -321,19 +322,19 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape
}
else if (start.ShapeType() == TopAbs_SHELL) {
TopoDS_Shell S = TopoDS::Shell(start);
res = TransferShell(S);
res = TransferShell(S, theProgress);
}
else if (start.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid M = TopoDS::Solid(start);
res = TransferSolid(M);
res = TransferSolid(M, theProgress);
}
else if (start.ShapeType() == TopAbs_COMPSOLID) {
TopoDS_CompSolid C = TopoDS::CompSolid(start);
res = TransferCompSolid(C);
res = TransferCompSolid(C, theProgress);
}
else if (start.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Compound C = TopoDS::Compound(start);
res = TransferCompound(C);
res = TransferCompound(C, theProgress);
}
else {
// error message
@@ -512,12 +513,6 @@ Handle(IGESSolid_Loop) BRepToIGESBRep_Entity::TransferWire (const TopoDS_Wire& m
Handle(IGESSolid_Face) BRepToIGESBRep_Entity ::TransferFace(const TopoDS_Face& start)
{
Handle(Message_ProgressIndicator) progress = GetTransferProcess()->GetProgress();
if ( ! progress.IsNull() ) {
if ( progress->UserBreak() ) return 0;
progress->Increment();
}
Handle(IGESSolid_Face) myent = new IGESSolid_Face;
if ( start.IsNull()) return myent;
Handle(IGESData_IGESEntity) ISurf;
@@ -623,7 +618,8 @@ Handle(IGESSolid_Face) BRepToIGESBRep_Entity ::TransferFace(const TopoDS_Face& s
// TransferShell
//=============================================================================
Handle(IGESSolid_Shell) BRepToIGESBRep_Entity ::TransferShell(const TopoDS_Shell& start)
Handle(IGESSolid_Shell) BRepToIGESBRep_Entity ::TransferShell(const TopoDS_Shell& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESSolid_Shell) myshell = new IGESSolid_Shell;
if ( start.IsNull()) return myshell;
@@ -633,7 +629,11 @@ Handle(IGESSolid_Shell) BRepToIGESBRep_Entity ::TransferShell(const TopoDS_Shell
TColStd_SequenceOfInteger SeqFlag;
Handle(IGESSolid_Face) IFace;
for (Ex.Init(start,TopAbs_FACE); Ex.More(); Ex.Next()) {
Standard_Integer nbf = 0;
for (Ex.Init(start, TopAbs_FACE); Ex.More(); Ex.Next())
nbf++;
Message_ProgressScope aPS(theProgress, NULL, nbf);
for (Ex.Init(start,TopAbs_FACE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next()) {
TopoDS_Face F = TopoDS::Face(Ex.Current());
if ( start.Orientation() == TopAbs_REVERSED ) F.Reverse(); //:l4 abv 12 Jan 99: CTS22022-2: writing reversed shells
if (F.IsNull()) {
@@ -673,7 +673,8 @@ Handle(IGESSolid_Shell) BRepToIGESBRep_Entity ::TransferShell(const TopoDS_Shell
// with a Solid
//=============================================================================
Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const TopoDS_Solid& start)
Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const TopoDS_Solid& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESSolid_ManifoldSolid) mysol = new IGESSolid_ManifoldSolid;
if ( start.IsNull()) return mysol;
@@ -684,13 +685,19 @@ Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const Top
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
TColStd_SequenceOfInteger SeqFlag;
for (Ex.Init(start,TopAbs_SHELL); Ex.More(); Ex.Next()) {
Standard_Integer nbs = 0;
for (Ex.Init(start, TopAbs_SHELL); Ex.More(); Ex.Next())
nbs++;
Message_ProgressScope aPS(theProgress, NULL, nbs);
for (Ex.Init(start,TopAbs_SHELL); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Shell is a null entity");
}
else {
IShell = TransferShell(S);
IShell = TransferShell (S, aRange);
if (!IShell.IsNull()) {
Seq->Append(IShell);
if (S.Orientation() == TopAbs_FORWARD ) SeqFlag.Append(1);
@@ -743,7 +750,8 @@ Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const Top
// with a CompSolid
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompSolid (const TopoDS_CompSolid& start)
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompSolid (const TopoDS_CompSolid& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) myent;
if ( start.IsNull()) return myent;
@@ -752,13 +760,19 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompSolid (const Topo
Handle(IGESSolid_ManifoldSolid) ISolid = new IGESSolid_ManifoldSolid;
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
for (Ex.Init(start,TopAbs_SOLID); Ex.More(); Ex.Next()) {
Standard_Integer nbs = 0;
for (Ex.Init(start, TopAbs_SOLID); Ex.More(); Ex.Next())
nbs++;
Message_ProgressScope aPS(theProgress, NULL, nbs);
for (Ex.Init(start,TopAbs_SOLID); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
if (S.IsNull()) {
AddWarning(start," an Solid is a null entity");
}
else {
ISolid = TransferSolid(S);
ISolid = TransferSolid (S, aRange);
if (!ISolid.IsNull()) Seq->Append(ISolid);
}
}
@@ -794,7 +808,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompSolid (const Topo
// with a Compound
//=============================================================================
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoDS_Compound& start)
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoDS_Compound& start,
const Message_ProgressRange& theProgress)
{
Handle(IGESData_IGESEntity) res;
if ( start.IsNull()) return res;
@@ -804,33 +819,54 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
Handle(IGESData_IGESEntity) IShape;
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
// count numbers of subshapes
Standard_Integer nbshapes = 0;
for (Ex.Init(start, TopAbs_SOLID); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_SHELL, TopAbs_SOLID); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_FACE, TopAbs_SHELL); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next())
nbshapes++;
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next())
nbshapes++;
Message_ProgressScope aPS(theProgress, NULL, nbshapes);
// take all Solids
for (Ex.Init(start, TopAbs_SOLID); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_SOLID); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Solid is a null entity");
}
else {
IShape = TransferSolid(S);
IShape = TransferSolid (S, aRange);
if (!IShape.IsNull()) Seq->Append(IShape);
}
}
// take all isolated Shells
for (Ex.Init(start, TopAbs_SHELL, TopAbs_SOLID); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_SHELL, TopAbs_SOLID); Ex.More() && aPS.More(); Ex.Next())
{
Message_ProgressRange aRange = aPS.Next();
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Shell is a null entity");
}
else {
IShape = TransferShell(S);
IShape = TransferShell (S, aRange);
if (!IShape.IsNull()) Seq->Append(IShape);
}
}
// take all isolated Faces
for (Ex.Init(start, TopAbs_FACE, TopAbs_SHELL); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_FACE, TopAbs_SHELL); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Face S = TopoDS::Face(Ex.Current());
if (S.IsNull()) {
AddWarning(start," a Face is a null entity");
@@ -843,7 +879,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
// take all isolated Wires
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_WIRE, TopAbs_FACE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
BRepToIGES_BRWire BW(*this);
@@ -854,7 +891,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
// take all isolated Edges
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_EDGE, TopAbs_WIRE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
BRepToIGES_BRWire BW(*this);
@@ -865,7 +903,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
// take all isolated Vertices
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More(); Ex.Next()) {
for (Ex.Init(start, TopAbs_VERTEX, TopAbs_EDGE); Ex.More() && aPS.More(); Ex.Next(), aPS.Next())
{
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
BRepToIGES_BRWire BW(*this);
@@ -875,7 +914,7 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
}
// construct the group
Standard_Integer nbshapes = Seq->Length();
nbshapes = Seq->Length();
if (nbshapes > 0) {
Handle(IGESData_HArray1OfIGESEntity) Tab =
new IGESData_HArray1OfIGESEntity(1,nbshapes);

View File

@@ -26,6 +26,8 @@
#include <BRepToIGES_BREntity.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <Message_ProgressRange.hxx>
class IGESSolid_EdgeList;
class IGESSolid_VertexList;
class TopoDS_Vertex;
@@ -43,7 +45,6 @@ class TopoDS_Solid;
class TopoDS_CompSolid;
class TopoDS_Compound;
//! provides methods to transfer BRep entity from CASCADE to IGESBRep.
class BRepToIGESBRep_Entity : public BRepToIGES_BREntity
{
@@ -80,7 +81,9 @@ public:
//! Returns the result of the transfert of any Shape
//! If the transfer has failed, this member return a NullEntity.
Standard_EXPORT virtual Handle(IGESData_IGESEntity) TransferShape (const TopoDS_Shape& start) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(IGESData_IGESEntity) TransferShape
(const TopoDS_Shape& start,
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
//! Transfert an Edge entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
@@ -101,19 +104,23 @@ public:
//! Transfert an Shell entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESSolid_Shell) TransferShell (const TopoDS_Shell& start);
Standard_EXPORT Handle(IGESSolid_Shell) TransferShell (const TopoDS_Shell& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert a Solid entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESSolid_ManifoldSolid) TransferSolid (const TopoDS_Solid& start);
Standard_EXPORT Handle(IGESSolid_ManifoldSolid) TransferSolid (const TopoDS_Solid& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert an CompSolid entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompSolid (const TopoDS_CompSolid& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompSolid (const TopoDS_CompSolid& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Transfert a Compound entity from TopoDS to IGES
//! If this Entity could not be converted, this member returns a NullEntity.
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompound (const TopoDS_Compound& start);
Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompound (const TopoDS_Compound& start,
const Message_ProgressRange& theProgress = Message_ProgressRange());

View File

@@ -667,7 +667,7 @@ 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 Message_ProgressRange& theProgress)
{
BRepTools_ShapeSet SS;
SS.Add(Sh);
@@ -684,7 +684,7 @@ 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 Message_ProgressRange& theProgress)
{
BRepTools_ShapeSet SS(B);
SS.Read(S, theProgress);
@@ -698,7 +698,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 Message_ProgressRange& theProgress)
{
std::ofstream os;
OSD_OpenStream(os, File, std::ios::out);
@@ -735,7 +735,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 Message_ProgressRange& theProgress)
{
std::filebuf fic;
std::istream in(&fic);

View File

@@ -27,8 +27,7 @@
#include <Standard_OStream.hxx>
#include <Standard_IStream.hxx>
#include <Standard_CString.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressRange.hxx>
class TopoDS_Face;
class TopoDS_Wire;
@@ -207,23 +206,22 @@ public:
//! 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);
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! 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);
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! 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 Message_ProgressRange& theProgress = Message_ProgressRange());
//! 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 Message_ProgressRange& theProgress = Message_ProgressRange());
//! Evals real tolerance of edge <theE>.
//! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
@@ -253,8 +251,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;

View File

@@ -18,7 +18,6 @@
#include <BRepTools_Modification.hxx>
#include <BRepTools_Modifier.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NullObject.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx>
@@ -54,7 +53,7 @@
#include <Standard_NullObject.hxx>
#include <gp_Trsf.hxx>
#include <BRepTools_TrsfModification.hxx>
#include <Message_ProgressSentry.hxx>
#include <Message_ProgressScope.hxx>
#include <Geom_Surface.hxx>
static void SetShapeFlags(const TopoDS_Shape& theInSh, TopoDS_Shape& theOutSh);
@@ -116,7 +115,8 @@ void BRepTools_Modifier::Init(const TopoDS_Shape& S)
static TopTools_IndexedMapOfShape MapE, MapF;
#endif
void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M, const Handle(Message_ProgressIndicator) & aProgress)
void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M,
const Message_ProgressRange& theProgress)
{
if (myShape.IsNull()) {
throw Standard_NullObject();
@@ -128,7 +128,7 @@ void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M, const
#endif
TopTools_DataMapIteratorOfDataMapOfShapeShape theIter(myMap);
Message_ProgressSentry aPSentry(aProgress, "Converting Shape", 0, 2, 1);
Message_ProgressScope aPS(theProgress, "Converting Shape", 2);
TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEF;
TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
@@ -144,16 +144,14 @@ void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M, const
CreateOtherVertices(aMVE, aMEF, M);
Standard_Boolean aNewGeom;
Rebuild(myShape, M, aNewGeom, aProgress);
Rebuild(myShape, M, aNewGeom, aPS.Next());
if (!aPSentry.More())
if (!aPS.More())
{
// The processing was broken
return;
}
aPSentry.Next();
if (myShape.ShapeType() == TopAbs_FACE) {
if (myShape.Orientation() == TopAbs_REVERSED) {
myMap(myShape).Reverse();
@@ -242,7 +240,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild
(const TopoDS_Shape& S,
const Handle(BRepTools_Modification)& M,
Standard_Boolean& theNewGeom,
const Handle(Message_ProgressIndicator)& aProgress)
const Message_ProgressRange& theProgress)
{
#ifdef DEBUG_Modifier
int iF = MapF.Contains(S) ? MapF.FindIndex(S) : 0;
@@ -357,16 +355,16 @@ Standard_Boolean BRepTools_Modifier::Rebuild
for (it.Initialize(S, Standard_False); it.More(); it.Next()) ++aShapeCount;
}
Message_ProgressSentry aPSentry(aProgress, "Converting SubShapes", 0, aShapeCount, 1);
Message_ProgressScope aPS(theProgress, "Converting SubShapes", aShapeCount);
//
for (it.Initialize(S, Standard_False); it.More() && aPSentry.More(); it.Next(), aPSentry.Next()) {
for (it.Initialize(S, Standard_False); it.More() && aPS.More(); it.Next()) {
// always call Rebuild
Standard_Boolean isSubNewGeom = Standard_False;
Standard_Boolean subrebuilt = Rebuild(it.Value(), M, isSubNewGeom, aProgress);
Standard_Boolean subrebuilt = Rebuild(it.Value(), M, isSubNewGeom, aPS.Next());
rebuild = subrebuilt || rebuild ;
theNewGeom = theNewGeom || isSubNewGeom;
}
if (!aPSentry.More())
if (!aPS.More())
{
// The processing was broken
return Standard_False;

View File

@@ -29,17 +29,16 @@
#include <TopoDS_Vertex.hxx>
#include <Standard_Boolean.hxx>
#include <Message_ProgressIndicator.hxx>
#include <NCollection_DataMap.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ShapeMapHasher.hxx>
#include <TopLoc_Location.hxx>
#include <Message_ProgressRange.hxx>
class Standard_NullObject;
class Standard_NoSuchObject;
class TopoDS_Shape;
class BRepTools_Modification;
class Message_ProgressIndicator;
class Geom_Curve;
class Geom_Surface;
@@ -64,7 +63,8 @@ public:
Standard_EXPORT void Init (const TopoDS_Shape& S);
//! Performs the modifications described by <M>.
Standard_EXPORT void Perform (const Handle(BRepTools_Modification)& M, const Handle(Message_ProgressIndicator)& aProgress = NULL);
Standard_EXPORT void Perform (const Handle(BRepTools_Modification)& M,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! Returns Standard_True if the modification has
//! been computed successfully.
@@ -109,7 +109,7 @@ private:
Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S,
const Handle(BRepTools_Modification)& M,
Standard_Boolean& theNewGeom,
const Handle(Message_ProgressIndicator)& aProgress = NULL);
const Message_ProgressRange& theProgress = Message_ProgressRange());
Standard_EXPORT void CreateNewVertices(
const TopTools_IndexedDataMapOfShapeListOfShape& theMVE,

View File

@@ -39,8 +39,7 @@
#include <BRepTools.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <GeomTools.hxx>
#include <Message_ProgressIndicator.hxx>
#include <Message_ProgressSentry.hxx>
#include <Message_ProgressScope.hxx>
#include <Poly.hxx>
#include <Poly_Polygon2D.hxx>
#include <Poly_Polygon3D.hxx>
@@ -246,32 +245,27 @@ 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, const Message_ProgressRange& theProgress)
{
//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);
// Make nested progress scope for processing geometry
Message_ProgressScope aPS(theProgress, "Geometry", 100);
myCurves2d.Write(OS, aPS.Next(20));
if (aPS.UserBreak()) return;
myCurves.Write(OS, aPS.Next(20));
if (aPS.UserBreak()) return;
WritePolygon3D(OS, Standard_True, aPS.Next(10));
if (aPS.UserBreak()) return;
WritePolygonOnTriangulation(OS, Standard_True, aPS.Next(10));
if (aPS.UserBreak()) return;
mySurfaces.Write(OS, aPS.Next(20));
if (aPS.UserBreak()) return;
WriteTriangulation(OS, Standard_True, aPS.Next(20));
}
@@ -280,35 +274,27 @@ 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, const Message_ProgressRange& theProgress)
{
//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();
// Make nested progress scope for processing geometry
Message_ProgressScope aPS(theProgress, "Geometry", 100);
myCurves2d.Read(IS, aPS.Next(20));
if (aPS.UserBreak()) return;
myCurves.Read(IS, aPS.Next(20));
if (aPS.UserBreak()) return;
ReadPolygon3D(IS, aPS.Next(15));
if (aPS.UserBreak()) return;
ReadPolygonOnTriangulation(IS, aPS.Next(15));
if (aPS.UserBreak()) return;
mySurfaces.Read(IS, aPS.Next(15));
if (aPS.UserBreak()) return;
ReadTriangulation(IS, aPS.Next(15));
}
//=======================================================================
@@ -1168,13 +1154,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 Message_ProgressRange& theProgress)const
{
Standard_Integer i, j, nbpOntri = myNodes.Extent();
Message_ProgressSentry PS(theProgress, "Polygons On Triangulation", 0, nbpOntri, 1);
Message_ProgressScope aPS(theProgress, "Polygons On Triangulation", nbpOntri);
if (Compact)
OS << "PolygonOnTriangulations " << nbpOntri << "\n";
else {
@@ -1185,7 +1171,7 @@ void BRepTools_ShapeSet::WritePolygonOnTriangulation (Standard_OStream&
Handle(Poly_PolygonOnTriangulation) Poly;
Handle(TColStd_HArray1OfReal) Param;
for (i=1; i<=nbpOntri && PS.More(); i++, PS.Next()) {
for (i=1; i<=nbpOntri && aPS.More(); i++, aPS.Next()) {
Poly = Handle(Poly_PolygonOnTriangulation)::DownCast(myNodes(i));
const TColStd_Array1OfInteger& Nodes = Poly->Nodes();
if (!Compact) {
@@ -1233,8 +1219,8 @@ 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,
const Message_ProgressRange& theProgress)
{
char buffer[255];
IS >> buffer;
@@ -1246,8 +1232,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);
for (i=1; i<=nbpol&& PS.More(); i++, PS.Next()) {
Message_ProgressScope aPS(theProgress, "Polygons On Triangulation", nbpol);
for (i=1; i<=nbpol&& aPS.More(); i++, aPS.Next()) {
IS >> nbnodes;
TColStd_Array1OfInteger Nodes(1, nbnodes);
for (j = 1; j <= nbnodes; j++) {
@@ -1287,13 +1273,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 Message_ProgressRange& theProgress)const
{
Standard_Integer i, j, nbpol = myPolygons3D.Extent();
Message_ProgressSentry PS(theProgress, "3D Polygons", 0, nbpol, 1);
Message_ProgressScope aPS(theProgress, "3D Polygons", nbpol);
if (Compact)
OS << "Polygon3D " << nbpol << "\n";
@@ -1304,7 +1290,7 @@ void BRepTools_ShapeSet::WritePolygon3D (Standard_OStream& OS,
}
Handle(Poly_Polygon3D) P;
for (i = 1; i <= nbpol && PS.More(); i++, PS.Next()) {
for (i = 1; i <= nbpol && aPS.More(); i++, aPS.Next()) {
P = Handle(Poly_Polygon3D)::DownCast(myPolygons3D(i));
if (Compact) {
OS << P->NbNodes() << " ";
@@ -1365,8 +1351,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, const Message_ProgressRange& theProgress)
{
char buffer[255];
// Standard_Integer i, j, p, val, nbpol, nbnodes, hasparameters;
@@ -1378,8 +1363,8 @@ void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream&
Handle(Poly_Polygon3D) P;
IS >> nbpol;
//OCC19559
Message_ProgressSentry PS(theProgress, "3D Polygons", 0, nbpol, 1);
for (i=1; i<=nbpol && PS.More(); i++, PS.Next()) {
Message_ProgressScope aPS(theProgress, "3D Polygons", nbpol);
for (i=1; i<=nbpol && aPS.More(); i++, aPS.Next()) {
IS >> nbnodes;
IS >> hasparameters;
TColgp_Array1OfPnt Nodes(1, nbnodes);
@@ -1412,12 +1397,12 @@ void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream&
void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
const Standard_Boolean Compact,
const Handle(Message_ProgressIndicator) &theProgress)const
const Message_ProgressRange& theProgress)const
{
Standard_Integer i, j, nbNodes, nbtri = myTriangulations.Extent();
Standard_Integer nbTriangles = 0, n1, n2, n3;
Message_ProgressSentry PS(theProgress, "Triangulations", 0, nbtri, 1);
Message_ProgressScope aPS(theProgress, "Triangulations", nbtri);
if (Compact)
OS << "Triangulations " << nbtri << "\n";
@@ -1428,7 +1413,7 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
}
Handle(Poly_Triangulation) T;
for (i = 1; i <= nbtri && PS.More(); i++, PS.Next()) {
for (i = 1; i <= nbtri && aPS.More(); i++, aPS.Next()) {
T = Handle(Poly_Triangulation)::DownCast(myTriangulations(i));
if (Compact) {
@@ -1514,8 +1499,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, const Message_ProgressRange& theProgress)
{
char buffer[255];
// Standard_Integer i, j, val, nbtri;
@@ -1531,8 +1515,8 @@ void BRepTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
IS >> nbtri;
//OCC19559
Message_ProgressSentry PS(theProgress, "Triangulations", 0, nbtri, 1);
for (i=1; i<=nbtri && PS.More();i++, PS.Next()) {
Message_ProgressScope aPS(theProgress, "Triangulations", nbtri);
for (i=1; i<=nbtri && aPS.More();i++, aPS.Next()) {
IS >> nbNodes >> nbTriangles >> hasUV;
GeomTools::GetReal(IS, d);

View File

@@ -67,28 +67,23 @@ 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,
const Message_ProgressRange& theProgress = Message_ProgressRange()) 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,
const Message_ProgressRange& theProgress = Message_ProgressRange()) 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 +94,15 @@ 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,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! 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 Message_ProgressRange& theProgress = Message_ProgressRange()) const;
//! Dumps the 3d polygons
//! on the stream <OS>.
@@ -117,17 +110,15 @@ 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,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! 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 Message_ProgressRange& theProgress = Message_ProgressRange()) const;
//! Dumps the triangulation
//! on the stream <OS>.
@@ -135,24 +126,33 @@ 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,
const Message_ProgressRange& theProgress = Message_ProgressRange());
//! 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 Message_ProgressRange& theProgress = Message_ProgressRange()) 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;

View File

@@ -189,18 +189,65 @@ public:
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinPoint[0])
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMinPoint[0])
}
if (n == 2)
else if (n == 2)
{
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MinPoint", n, myMinPoint[0], myMinPoint[1])
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MaxPoint", n, myMaxPoint[0], myMaxPoint[1])
}
if (n == 3)
else if (n == 3)
{
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MinPoint", n, myMinPoint[0], myMinPoint[1], myMinPoint[2])
OCCT_DUMP_FIELD_VALUES_NUMERICAL (theOStream, "MaxPoint", n, myMaxPoint[0], myMaxPoint[1], myMaxPoint[2])
}
}
//! Inits the content of me from the stream
Standard_Boolean InitFromJson (const Standard_SStream& theSStream, Standard_Integer& theStreamPos)
{
Standard_Integer aPos = theStreamPos;
Standard_Integer anIsInited = 0;
TCollection_AsciiString aStreamStr = Standard_Dump::Text (theSStream);
OCCT_INIT_FIELD_VALUE_INTEGER (aStreamStr, aPos, anIsInited);
myIsInited = anIsInited != 0;
int n = Min (N, 3);
if (n == 1)
{
Standard_Real aValue;
OCCT_INIT_FIELD_VALUE_REAL (aStreamStr, aPos, aValue);
myMinPoint[0] = (T)aValue;
}
else if (n == 2)
{
Standard_Real aValue1, aValue2;
OCCT_INIT_VECTOR_CLASS (aStreamStr, "MinPoint", aPos, n, &aValue1, &aValue2);
myMinPoint[0] = (T)aValue1;
myMinPoint[1] = (T)aValue2;
OCCT_INIT_VECTOR_CLASS (aStreamStr, "MaxPoint", aPos, n, &aValue1, &aValue2);
myMaxPoint[0] = (T)aValue1;
myMaxPoint[1] = (T)aValue2;
}
else if (n == 3)
{
Standard_Real aValue1, aValue2, aValue3;
OCCT_INIT_VECTOR_CLASS (aStreamStr, "MinPoint", aPos, n, &aValue1, &aValue2, &aValue3);
myMinPoint[0] = (T)aValue1;
myMinPoint[1] = (T)aValue2;
myMinPoint[2] = (T)aValue3;
OCCT_INIT_VECTOR_CLASS (aStreamStr, "MaxPoint", aPos, n, &aValue1, &aValue2, &aValue3);
myMaxPoint[0] = (T)aValue1;
myMaxPoint[1] = (T)aValue2;
myMaxPoint[2] = (T)aValue3;
}
theStreamPos = aPos;
return Standard_True;
}
public:
//! Checks if the Box is out of the other box.

View File

@@ -66,6 +66,18 @@ 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

@@ -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 myBoxes[myIndices[theIndex]];
return this->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
virtual DataType Element (const Standard_Integer theIndex) const Standard_OVERRIDE
{
return myElements[myIndices[theIndex]];
return this->myElements[myIndices[theIndex]];
}
protected: //! @name Fields

View File

@@ -88,6 +88,24 @@ 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
@@ -110,7 +128,6 @@ 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

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

View File

@@ -49,7 +49,7 @@ public:
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& theIS,
const Standard_Boolean isMess = Standard_False,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT virtual void CheckShapeSection
(const Storage_Position& thePos, Standard_IStream& theIS) Standard_OVERRIDE;

View File

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

View File

@@ -46,7 +46,7 @@ public:
Standard_EXPORT virtual void WriteShapeSection
(BinLDrivers_DocumentSection& theDocSection,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Return true if shape should be stored with triangles.
Standard_EXPORT Standard_Boolean IsWithTriangles() const;

View File

@@ -42,7 +42,7 @@
#include <TDF_Label.hxx>
#include <TDocStd_Document.hxx>
#include <TDocStd_Owner.hxx>
#include <Message_ProgressSentry.hxx>
#include <Message_ProgressScope.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentRetrievalDriver,PCDM_RetrievalDriver)
@@ -80,7 +80,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
(const TCollection_ExtendedString& theFileName,
const Handle(CDM_Document)& theNewDocument,
const Handle(CDM_Application)& theApplication,
const Handle(Message_ProgressIndicator)& theProgress)
const Message_ProgressRange& theRange)
{
std::ifstream aFileStream;
OSD_OpenStream (aFileStream, theFileName, std::ios::in | std::ios::binary);
@@ -90,8 +90,8 @@ 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())
Read(aFileStream, dData, theNewDocument, theApplication, theRange);
if (!theRange.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
@@ -117,7 +117,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
const Handle(Storage_Data)& theStorageData,
const Handle(CDM_Document)& theDoc,
const Handle(CDM_Application)& theApplication,
const Handle(Message_ProgressIndicator)& theProgress)
const Message_ProgressRange& theRange)
{
myReaderStatus = PCDM_RS_DriverFailure;
myMsgDriver = theApplication -> MessageDriver();
@@ -233,7 +233,7 @@ 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);
Message_ProgressScope aPS(theRange, "Reading data", 3);
// 2b. Read the TOC of Sections
if (aFileVer >= 3) {
@@ -259,13 +259,12 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
theIStream.seekg ((std::streampos) aCurSection.Offset());
if (aCurSection.Name().IsEqual ((Standard_CString)SHAPESECTION_POS))
{
ReadShapeSection (aCurSection, theIStream, false, theProgress);
ReadShapeSection (aCurSection, theIStream, false, aPS.Next());
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
}
else
ReadSection (aCurSection, theDoc, theIStream);
@@ -306,13 +305,12 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
CheckShapeSection(aShapeSectionPos, theIStream);
// Read Shapes
BinLDrivers_DocumentSection aCurSection;
ReadShapeSection (aCurSection, theIStream, Standard_False, theProgress);
ReadShapeSection (aCurSection, theIStream, Standard_False, aPS.Next());
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
}
}
} // end of reading Sections or shape section
@@ -325,13 +323,13 @@ 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);
Standard_Integer nbRead = ReadSubTree (theIStream, aData->Root(), aPS.Next());
if (!aPS.More())
{
myReaderStatus = PCDM_RS_UserBreak;
return;
}
aPS.Next();
Clear();
if (!aPS.More())
{
@@ -369,13 +367,13 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
(Standard_IStream& theIS,
const TDF_Label& theLabel,
const Handle(Message_ProgressIndicator)& theProgress)
const Message_ProgressRange& theRange)
{
Standard_Integer nbRead = 0;
TCollection_ExtendedString aMethStr
("BinLDrivers_DocumentRetrievalDriver: ");
Message_ProgressSentry aPS(theProgress, "Reading sub tree", 0, 2, 1, true);
Message_ProgressScope aPS(theRange, "Reading sub tree", 2, true);
// Read attributes:
theIS >> myPAtt;
@@ -464,9 +462,9 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
return -1;
}
aPS.Next();
// read sub-tree
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theProgress);
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, aPS.Next());
// check for error
if (nbSubRead == -1)
return -1;
@@ -522,7 +520,7 @@ void BinLDrivers_DocumentRetrievalDriver::ReadShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& /*theIS*/,
const Standard_Boolean isMess,
const Handle(Message_ProgressIndicator) &/*theProgress*/)
const Message_ProgressRange &/*theRange*/)
{
if(isMess && theSection.Length()) {

View File

@@ -62,13 +62,13 @@ public:
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;
const Message_ProgressRange& theProgress = Message_ProgressRange()) 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 Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
@@ -84,7 +84,7 @@ protected:
Standard_EXPORT virtual Standard_Integer ReadSubTree
(Standard_IStream& theIS,
const TDF_Label& theData,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
const Message_ProgressRange& theRanges = Message_ProgressRange());
//! define the procedure of reading a section to file.
@@ -98,7 +98,7 @@ protected:
(BinLDrivers_DocumentSection& theSection,
Standard_IStream& theIS,
const Standard_Boolean isMess = Standard_False,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
const Message_ProgressRange& theRange = Message_ProgressRange());
//! checks the shapes section can be correctly retreived.
Standard_EXPORT virtual void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS);

View File

@@ -42,7 +42,7 @@
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TDocStd_Document.hxx>
#include <Message_ProgressSentry.hxx>
#include <Message_ProgressScope.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
@@ -65,7 +65,7 @@ BinLDrivers_DocumentStorageDriver::BinLDrivers_DocumentStorageDriver ()
void BinLDrivers_DocumentStorageDriver::Write
(const Handle(CDM_Document)& theDocument,
const TCollection_ExtendedString& theFileName,
const Handle(Message_ProgressIndicator)& theProgress)
const Message_ProgressRange& theRange)
{
SetIsError(Standard_False);
SetStoreStatus(PCDM_SS_OK);
@@ -77,7 +77,7 @@ void BinLDrivers_DocumentStorageDriver::Write
if (aFileStream.is_open() && aFileStream.good())
{
Write(theDocument, aFileStream, theProgress);
Write(theDocument, aFileStream, theRange);
}
else
{
@@ -91,9 +91,9 @@ 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,
const Message_ProgressRange& theRange)
{
myMsgDriver = theDoc->Application()->MessageDriver();
myMapUnsupported.Clear();
@@ -140,26 +140,26 @@ void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDo
myRelocTable.Clear();
myPAtt.Init();
Message_ProgressSentry aPS(theProgress, "Writing document", 0, 3, 1);
Message_ProgressScope aPS(theRange, "Writing document", 3);
// Write Doc structure
WriteSubTree (aData->Root(), theOStream, theProgress); // Doc is written
WriteSubTree (aData->Root(), theOStream, aPS.Next()); // Doc is written
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
// 4. Write Shapes section
WriteShapeSection (aShapesSection, theOStream, theProgress);
WriteShapeSection (aShapesSection, theOStream, aPS.Next());
if (!aPS.More())
{
SetIsError(Standard_True);
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
// Write application-defined sections
for (anIterS.Init (mySections); anIterS.More(); anIterS.Next()) {
BinLDrivers_DocumentSection& aSection = anIterS.ChangeValue();
@@ -228,16 +228,16 @@ void BinLDrivers_DocumentStorageDriver::UnsupportedAttrMsg
//=======================================================================
void BinLDrivers_DocumentStorageDriver::WriteSubTree
(const TDF_Label& theLabel,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& theProgress)
(const TDF_Label& theLabel,
Standard_OStream& theOS,
const Message_ProgressRange& theRange)
{
// Skip empty labels
if (!myEmptyLabels.IsEmpty() && myEmptyLabels.First() == theLabel) {
myEmptyLabels.RemoveFirst();
return;
}
Message_ProgressSentry aPS(theProgress, "Writing sub tree", 0, 2, 1, 1);
Message_ProgressScope aPS(theRange, "Writing sub tree", 2, true);
// Write label header: tag
Standard_Integer aTag = theLabel.Tag();
#if DO_INVERSE
@@ -298,8 +298,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
SetStoreStatus(PCDM_SS_UserBreak);
return;
}
aPS.Next();
WriteSubTree (aChildLab, theOS, theProgress);
WriteSubTree (aChildLab, theOS, aPS.Next());
}
// Write the end label marker
@@ -547,7 +546,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSection
void BinLDrivers_DocumentStorageDriver::WriteShapeSection
(BinLDrivers_DocumentSection& theSection,
Standard_OStream& theOS,
const Handle(Message_ProgressIndicator)& /*theProgress*/)
const Message_ProgressRange& /*theRange*/)
{
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
theSection.Write (theOS, aShapesSectionOffset);

View File

@@ -54,12 +54,12 @@ public:
//! 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;
const Message_ProgressRange& theRange = Message_ProgressRange()) 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;
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
@@ -77,7 +77,7 @@ 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);
const Message_ProgressRange& theRange = Message_ProgressRange());
//! define the procedure of writing a section to file.
Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName,
@@ -87,7 +87,7 @@ protected:
//! 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);
const Message_ProgressRange& theRange = Message_ProgressRange());
Handle(BinMDF_ADriverTable) myDrivers;
BinObjMgt_SRelocationTable myRelocTable;

View File

@@ -15,12 +15,6 @@
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TDF_Attribute.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDF_ADriver,Standard_Transient)
@@ -34,4 +28,15 @@ BinMDF_ADriver::BinMDF_ADriver (const Handle(Message_Messenger)& theMsgDriver,
{
if (theName)
myTypeName = theName;
}
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
const Handle(Standard_Type)& BinMDF_ADriver::SourceType () const
{
return NewEmpty() -> DynamicType();
}

View File

@@ -48,7 +48,7 @@ public:
//! Returns the type of source object,
//! inheriting from Attribute from TDF.
const Handle(Standard_Type)& SourceType() const;
Standard_EXPORT virtual const Handle(Standard_Type)& SourceType() const;
//! Returns the type name of the attribute object
const TCollection_AsciiString& TypeName() const;
@@ -63,6 +63,8 @@ public:
//! <aRelocTable> to keep the sharings.
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& aSource, BinObjMgt_Persistent& aTarget, BinObjMgt_SRelocationTable& aRelocTable) const = 0;
//! Returns the current message driver of this driver
const Handle(Message_Messenger)& MessageDriver() const { return myMessageDriver; }
DEFINE_STANDARD_RTTIEXT(BinMDF_ADriver,Standard_Transient)

View File

@@ -15,16 +15,6 @@
#include <TDF_Attribute.hxx>
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
inline const Handle(Standard_Type)& BinMDF_ADriver::SourceType () const
{
return NewEmpty() -> DynamicType();
}
//=======================================================================
//function : TypeName
//purpose :

View File

@@ -17,10 +17,12 @@
#include <BinMDF_ADriver.hxx>
#include <BinMDF_ADriverTable.hxx>
#include <BinMDF_DataMapIteratorOfTypeADriverMap.hxx>
#include <BinMDF_DerivedDriver.hxx>
#include <BinMDF_StringIdMap.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_Type.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TDF_DerivedAttribute.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDF_ADriverTable,Standard_Transient)
@@ -44,6 +46,42 @@ void BinMDF_ADriverTable::AddDriver
myMap.Bind (aType, theDriver);
}
//=======================================================================
//function : AddDerivedDriver
//purpose :
//=======================================================================
void BinMDF_ADriverTable::AddDerivedDriver (const Handle(TDF_Attribute)& theInstance)
{
const Handle(Standard_Type)& anInstanceType = theInstance->DynamicType();
if (!myMap.IsBound (anInstanceType)) // no direct driver, use a derived one
{
for (Handle(Standard_Type) aType = anInstanceType->Parent(); !aType.IsNull(); aType = aType->Parent())
{
if (myMap.IsBound (aType))
{
Handle(BinMDF_DerivedDriver) aDriver = new BinMDF_DerivedDriver (theInstance, myMap (aType));
myMap.Bind (anInstanceType, aDriver);
return;
}
}
}
}
//=======================================================================
//function : AddDerivedDriver
//purpose :
//=======================================================================
const Handle(Standard_Type)& BinMDF_ADriverTable::AddDerivedDriver (Standard_CString theDerivedType)
{
if (Handle(TDF_Attribute) anInstance = TDF_DerivedAttribute::Attribute (theDerivedType))
{
AddDerivedDriver (anInstance);
return anInstance->DynamicType();
}
static const Handle(Standard_Type) aNullType;
return aNullType;
}
//=======================================================================
//function : AssignIds
//purpose : Assigns the IDs to the drivers of the given Types.
@@ -97,4 +135,16 @@ void BinMDF_ADriverTable::AssignIds
myMapId.Bind (aType, i);
}
}
// try to add derived drivers for attributes not found in myMap
for (BinMDF_StringIdMap::Iterator aStrId (aStringIdMap); aStrId.More(); aStrId.Next())
{
if (!myMapId.IsBound2 (aStrId.Value()))
{
if (Handle(Standard_Type) anAdded = AddDerivedDriver (aStrId.Key().ToCString()))
{
myMapId.Bind (anAdded, aStrId.Value());
}
}
}
}

View File

@@ -48,7 +48,15 @@ public:
//! Adds a translation driver <theDriver>.
Standard_EXPORT void AddDriver (const Handle(BinMDF_ADriver)& theDriver);
//! Adds a translation driver for the derived attribute. The base driver must be already added.
//! @param theInstance is newly created attribute, detached from any label
Standard_EXPORT void AddDerivedDriver (const Handle(TDF_Attribute)& theInstance);
//! Adds a translation driver for the derived attribute. The base driver must be already added.
//! @param theDerivedType is registered attribute type using IMPLEMENT_DERIVED_ATTRIBUTE macro
Standard_EXPORT const Handle(Standard_Type)& AddDerivedDriver (Standard_CString theDerivedType);
//! Assigns the IDs to the drivers of the given Types.
//! It uses indices in the map as IDs.
//! Useful in storage procedure.
@@ -61,11 +69,11 @@ public:
//! Gets a driver <theDriver> according to <theType>.
//! Returns Type ID if the driver was assigned an ID; 0 otherwise.
Standard_Integer GetDriver (const Handle(Standard_Type)& theType, Handle(BinMDF_ADriver)& theDriver) const;
Standard_Integer GetDriver (const Handle(Standard_Type)& theType, Handle(BinMDF_ADriver)& theDriver);
//! Returns a driver according to <theTypeId>.
//! Returns null handle if a driver is not found
Handle(BinMDF_ADriver) GetDriver (const Standard_Integer theTypeId) const;
Handle(BinMDF_ADriver) GetDriver (const Standard_Integer theTypeId);

View File

@@ -33,8 +33,13 @@ inline void BinMDF_ADriverTable::AssignId
inline Standard_Integer BinMDF_ADriverTable::GetDriver
(const Handle(Standard_Type)& theType,
Handle(BinMDF_ADriver)& theDriver) const
Handle(BinMDF_ADriver)& theDriver)
{
if (!myMap.IsBound (theType)) // try to assign driver for derived type
{
AddDerivedDriver (theType->Name());
}
Standard_Integer anId = 0;
if (myMap.IsBound(theType)) {
theDriver = myMap (theType);
@@ -51,7 +56,7 @@ inline Standard_Integer BinMDF_ADriverTable::GetDriver
//=======================================================================
inline Handle(BinMDF_ADriver) BinMDF_ADriverTable::GetDriver
(const Standard_Integer theTypeId) const
(const Standard_Integer theTypeId)
{
Handle(BinMDF_ADriver) aDriver;
if (myMapId.IsBound2(theTypeId)) {

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2015 OPEN CASCADE SAS
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -11,10 +11,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMDF_DerivedDriver.hxx>
#ifndef CDM_DataMapIteratorOfPresentationDirectory_HeaderFile
#define CDM_DataMapIteratorOfPresentationDirectory_HeaderFile
#include <CDM_PresentationDirectory.hxx>
#endif
IMPLEMENT_STANDARD_RTTIEXT(BinMDF_DerivedDriver, BinMDF_ADriver)

View File

@@ -0,0 +1,59 @@
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDF_DerivedDriver_HeaderFile
#define _BinMDF_DerivedDriver_HeaderFile
#include <BinMDF_ADriver.hxx>
//! A universal driver for the attribute that inherits another attribute with
//! ready to used persistence mechanism implemented (already has a driver to store/retrieve).
class BinMDF_DerivedDriver : public BinMDF_ADriver
{
DEFINE_STANDARD_RTTIEXT(BinMDF_DerivedDriver, BinMDF_ADriver)
public:
//! Creates a derivative persistence driver for theDerivative attribute by reusage of theBaseDriver
//! @param theDerivative an instance of the attribute, just created, detached from any label
//! @param theBaseDriver a driver of the base attribute, called by Paste methods
BinMDF_DerivedDriver (const Handle(TDF_Attribute)& theDerivative,
const Handle(BinMDF_ADriver)& theBaseDriver)
: BinMDF_ADriver(theBaseDriver->MessageDriver()), myDerivative(theDerivative), myBaseDirver(theBaseDriver) {}
//! Creates a new instance of the derivative attribute
virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE { return myDerivative->NewEmpty(); }
//! Reuses the base driver to read the base fields
virtual Standard_Boolean Paste (const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE
{
Standard_Boolean aResult = myBaseDirver->Paste (theSource, theTarget, theRelocTable);
theTarget->AfterRetrieval(); // to allow synchronization of the derived attribute with the base content
return aResult;
}
//! Reuses the base driver to store the base fields
virtual void Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE
{
myBaseDirver->Paste(theSource, theTarget, theRelocTable);
}
protected:
Handle(TDF_Attribute) myDerivative; //!< the derivative attribute that inherits the base
Handle(BinMDF_ADriver) myBaseDirver; //!< the base attribute driver to be reused here
};
#endif

View File

@@ -15,3 +15,5 @@ BinMDF_TagSourceDriver.cxx
BinMDF_TagSourceDriver.hxx
BinMDF_TypeADriverMap.hxx
BinMDF_TypeIdMap.hxx
BinMDF_DerivedDriver.cxx
BinMDF_DerivedDriver.hxx

View File

@@ -19,8 +19,6 @@
#include <BinMDataStd_BooleanArrayDriver.hxx>
#include <BinMDataStd_BooleanListDriver.hxx>
#include <BinMDataStd_ByteArrayDriver.hxx>
#include <BinMDataStd_CommentDriver.hxx>
#include <BinMDataStd_DirectoryDriver.hxx>
#include <BinMDataStd_ExpressionDriver.hxx>
#include <BinMDataStd_ExtStringArrayDriver.hxx>
#include <BinMDataStd_ExtStringListDriver.hxx>
@@ -29,15 +27,13 @@
#include <BinMDataStd_IntegerListDriver.hxx>
#include <BinMDataStd_IntPackedMapDriver.hxx>
#include <BinMDataStd_NamedDataDriver.hxx>
#include <BinMDataStd_NameDriver.hxx>
#include <BinMDataStd_NoteBookDriver.hxx>
#include <BinMDataStd_GenericExtStringDriver.hxx>
#include <BinMDataStd_RealArrayDriver.hxx>
#include <BinMDataStd_RealDriver.hxx>
#include <BinMDataStd_RealListDriver.hxx>
#include <BinMDataStd_ReferenceArrayDriver.hxx>
#include <BinMDataStd_ReferenceListDriver.hxx>
#include <BinMDataStd_RelationDriver.hxx>
#include <BinMDataStd_TickDriver.hxx>
#include <BinMDataStd_GenericEmptyDriver.hxx>
#include <BinMDataStd_TreeNodeDriver.hxx>
#include <BinMDataStd_UAttributeDriver.hxx>
#include <BinMDataStd_VariableDriver.hxx>
@@ -52,31 +48,26 @@
void BinMDataStd::AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable,
const Handle(Message_Messenger)& theMsgDriver)
{
theDriverTable->AddDriver (new BinMDataStd_CommentDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ExpressionDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntegerArrayDriver(theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntegerDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_NameDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RealArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RealDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RelationDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_TreeNodeDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_UAttributeDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_VariableDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_DirectoryDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_NoteBookDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ExtStringArrayDriver(theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_TickDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntegerListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RealListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ExtStringListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_BooleanListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ReferenceListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_BooleanArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ReferenceArrayDriver(theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ByteArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_NamedDataDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_AsciiStringDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntPackedMapDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ExpressionDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntegerArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntegerDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_GenericExtStringDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RealArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RealDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_TreeNodeDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_UAttributeDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_VariableDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ExtStringArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_GenericEmptyDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntegerListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_RealListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ExtStringListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_BooleanListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ReferenceListDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_BooleanArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ReferenceArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_ByteArrayDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_NamedDataDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_AsciiStringDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataStd_IntPackedMapDriver (theMsgDriver) );
}

View File

@@ -68,21 +68,17 @@ private:
friend class BinMDataStd_NameDriver;
friend class BinMDataStd_GenericExtStringDriver;
friend class BinMDataStd_IntegerDriver;
friend class BinMDataStd_RealDriver;
friend class BinMDataStd_IntegerArrayDriver;
friend class BinMDataStd_RealArrayDriver;
friend class BinMDataStd_UAttributeDriver;
friend class BinMDataStd_DirectoryDriver;
friend class BinMDataStd_CommentDriver;
friend class BinMDataStd_VariableDriver;
friend class BinMDataStd_ExpressionDriver;
friend class BinMDataStd_RelationDriver;
friend class BinMDataStd_NoteBookDriver;
friend class BinMDataStd_TreeNodeDriver;
friend class BinMDataStd_ExtStringArrayDriver;
friend class BinMDataStd_TickDriver;
friend class BinMDataStd_GenericEmptyDriver;
friend class BinMDataStd_AsciiStringDriver;
friend class BinMDataStd_IntPackedMapDriver;
friend class BinMDataStd_IntegerListDriver;

View File

@@ -1,71 +0,0 @@
// Created on: 2001-08-24
// Created by: Alexnder GRIGORIEV
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMDataStd_CommentDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDataStd_Comment.hxx>
#include <TDF_Attribute.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_CommentDriver,BinMDF_ADriver)
//=======================================================================
//function : BinMDataStd_CommentDriver
//purpose : Constructor
//=======================================================================
BinMDataStd_CommentDriver::BinMDataStd_CommentDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, NULL)
{}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_CommentDriver::NewEmpty() const
{
return (new TDataStd_Comment());
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
Standard_Boolean BinMDataStd_CommentDriver::Paste
(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& ) const
{
TCollection_ExtendedString aString;
Standard_Boolean ok = theSource >> aString;
if (ok)
Handle(TDataStd_Comment)::DownCast(theTarget) -> Set (aString);
return ok;
}
//=======================================================================
//function : Paste
//purpose :
//=======================================================================
void BinMDataStd_CommentDriver::Paste (const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& ) const
{
TCollection_ExtendedString aName =
Handle(TDataStd_Comment)::DownCast(theSource) -> Get();
theTarget << aName;
}

View File

@@ -1,72 +0,0 @@
// Created on: 2001-08-24
// Created by: Alexander GRIGORIEV
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataStd_CommentDriver_HeaderFile
#define _BinMDataStd_CommentDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataStd_CommentDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_CommentDriver, BinMDF_ADriver)
//! Attribute Driver.
class BinMDataStd_CommentDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataStd_CommentDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMDataStd_CommentDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMDataStd_CommentDriver_HeaderFile

View File

@@ -1,71 +0,0 @@
// Created on: 2004-05-13
// Created by: Sergey ZARITCHNY
// Copyright (c) 2004-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMDataStd_DirectoryDriver.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDataStd_Directory.hxx>
#include <TDF_Attribute.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_DirectoryDriver,BinMDF_ADriver)
//=======================================================================
//function : BinMDataStd_DirectoryDriver
//purpose :
//=======================================================================
BinMDataStd_DirectoryDriver::BinMDataStd_DirectoryDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataStd_Directory)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_DirectoryDriver::NewEmpty() const
{
return new TDataStd_Directory();
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMDataStd_DirectoryDriver::Paste
(const BinObjMgt_Persistent&,
const Handle(TDF_Attribute)&,
BinObjMgt_RRelocationTable& ) const
{return Standard_True;}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMDataStd_DirectoryDriver::Paste (const Handle(TDF_Attribute)&,
BinObjMgt_Persistent&,
BinObjMgt_SRelocationTable& ) const
{}

View File

@@ -1,72 +0,0 @@
// Created on: 2004-05-13
// Created by: Sergey ZARITCHNY <szy@opencascade.com>
// Copyright (c) 2004-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataStd_DirectoryDriver_HeaderFile
#define _BinMDataStd_DirectoryDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataStd_DirectoryDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_DirectoryDriver, BinMDF_ADriver)
//! Directory attribute Driver.
class BinMDataStd_DirectoryDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataStd_DirectoryDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMDataStd_DirectoryDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMDataStd_DirectoryDriver_HeaderFile

View File

@@ -1,6 +1,4 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 OPEN CASCADE SAS
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -14,41 +12,49 @@
// commercial license or contractual agreement.
#include <BinMDataStd_TickDriver.hxx>
#include <BinMDataStd_GenericEmptyDriver.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDataStd_Tick.hxx>
#include <TDataStd_GenericEmpty.hxx>
#include <TDF_Attribute.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_TickDriver,BinMDF_ADriver)
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_GenericEmptyDriver,BinMDF_ADriver)
//=======================================================================
//function : BinMDataStd_TickDriver
//function : BinMDataStd_GenericEmptyDriver
//purpose :
//=======================================================================
BinMDataStd_TickDriver::BinMDataStd_TickDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataStd_Tick)->Name())
{
}
BinMDataStd_GenericEmptyDriver::BinMDataStd_GenericEmptyDriver(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataStd_GenericEmpty)->Name())
{}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_TickDriver::NewEmpty() const
Handle(TDF_Attribute) BinMDataStd_GenericEmptyDriver::NewEmpty() const
{
return new TDataStd_Tick();
return Handle(TDF_Attribute)(); // this attribute can not be created
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
const Handle(Standard_Type)& BinMDataStd_GenericEmptyDriver::SourceType() const
{
return Standard_Type::Instance<TDataStd_GenericEmpty>();
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMDataStd_TickDriver::Paste(const BinObjMgt_Persistent&,
Standard_Boolean BinMDataStd_GenericEmptyDriver::Paste(const BinObjMgt_Persistent&,
const Handle(TDF_Attribute)&,
BinObjMgt_RRelocationTable& ) const
{
@@ -59,7 +65,7 @@ Standard_Boolean BinMDataStd_TickDriver::Paste(const BinObjMgt_Persistent&,
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMDataStd_TickDriver::Paste(const Handle(TDF_Attribute)&,
void BinMDataStd_GenericEmptyDriver::Paste(const Handle(TDF_Attribute)&,
BinObjMgt_Persistent&,
BinObjMgt_SRelocationTable& ) const
{

View File

@@ -1,6 +1,4 @@
// Created on: 2004-05-13
// Created by: Sergey ZARITCHNY <szy@opencascade.com>
// Copyright (c) 2004-2014 OPEN CASCADE SAS
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -13,8 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataXtd_AxisDriver_HeaderFile
#define _BinMDataXtd_AxisDriver_HeaderFile
#ifndef _BinMDataStd_GenericEmptyDriver_HeaderFile
#define _BinMDataStd_GenericEmptyDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
@@ -28,19 +26,21 @@ class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataXtd_AxisDriver;
DEFINE_STANDARD_HANDLE(BinMDataXtd_AxisDriver, BinMDF_ADriver)
class BinMDataStd_GenericEmptyDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_GenericEmptyDriver, BinMDF_ADriver)
//! Axis attribute Driver.
class BinMDataXtd_AxisDriver : public BinMDF_ADriver
//! GenericEmpty attribute driver.
class BinMDataStd_GenericEmptyDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataXtd_AxisDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT BinMDataStd_GenericEmptyDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual const Handle(Standard_Type)& SourceType() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
@@ -49,7 +49,7 @@ public:
DEFINE_STANDARD_RTTIEXT(BinMDataXtd_AxisDriver,BinMDF_ADriver)
DEFINE_STANDARD_RTTIEXT(BinMDataStd_GenericEmptyDriver,BinMDF_ADriver)
protected:
@@ -69,4 +69,4 @@ private:
#endif // _BinMDataXtd_AxisDriver_HeaderFile
#endif // _BinMDataStd_GenericEmptyDriver_HeaderFile

View File

@@ -1,6 +1,4 @@
// Created on: 2002-11-19
// Created by: Edward AGAPOV (eap)
// Copyright (c) 2002-2014 OPEN CASCADE SAS
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -14,7 +12,7 @@
// commercial license or contractual agreement.
#include <BinMDataStd_NameDriver.hxx>
#include <BinMDataStd_GenericExtStringDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
@@ -22,15 +20,15 @@
#include <TDF_Attribute.hxx>
#include <BinMDataStd.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_NameDriver,BinMDF_ADriver)
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_GenericExtStringDriver,BinMDF_ADriver)
//=======================================================================
//function : BinMDataStd_NameDriver
//function : BinMDataStd_GenericExtStringDriver
//purpose :
//=======================================================================
BinMDataStd_NameDriver::BinMDataStd_NameDriver
BinMDataStd_GenericExtStringDriver::BinMDataStd_GenericExtStringDriver
(const Handle(Message_Messenger)& theMessageDriver)
: BinMDF_ADriver (theMessageDriver, STANDARD_TYPE(TDataStd_Name)->Name())
: BinMDF_ADriver (theMessageDriver, STANDARD_TYPE(TDataStd_GenericExtString)->Name())
{
}
@@ -39,39 +37,47 @@ BinMDataStd_NameDriver::BinMDataStd_NameDriver
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_NameDriver::NewEmpty() const
Handle(TDF_Attribute) BinMDataStd_GenericExtStringDriver::NewEmpty() const
{
return new TDataStd_Name;
}
//=======================================================================
//function : SourceType
//purpose :
//=======================================================================
Handle(Standard_Type)& BinMDataStd_GenericExtStringDriver::SourceType() const
{
static Handle(Standard_Type) aSourceType = Standard_Type::Instance<TDataStd_GenericExtString>();
return aSourceType;
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMDataStd_NameDriver::Paste
Standard_Boolean BinMDataStd_GenericExtStringDriver::Paste
(const BinObjMgt_Persistent& Source,
const Handle(TDF_Attribute)& Target,
BinObjMgt_RRelocationTable& RelocTable) const
{
Handle(TDataStd_Name) aName = Handle(TDataStd_Name)::DownCast(Target);
Handle(TDataStd_GenericExtString) aStrAttr = Handle(TDataStd_GenericExtString)::DownCast(Target);
TCollection_ExtendedString aStr;
Standard_Boolean ok = Source >> aStr;
if (ok)
aName->Set( aStr );
aStrAttr->Set( aStr );
if(RelocTable.GetHeaderData()->StorageVersion().IntegerValue() > 8) { // process user defined guid
const Standard_Integer& aPos = Source.Position();
Standard_GUID aGuid;
ok = Source >> aGuid;
if (!ok) {
Source.SetPosition(aPos);
aName->SetID(TDataStd_Name::GetID());
ok = Standard_True;
} else {
aName->SetID(aGuid);
aStrAttr->SetID(aGuid);
}
} else
aName->SetID(TDataStd_Name::GetID());
}
return ok;
}
@@ -80,14 +86,13 @@ Standard_Boolean BinMDataStd_NameDriver::Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMDataStd_NameDriver::Paste
void BinMDataStd_GenericExtStringDriver::Paste
(const Handle(TDF_Attribute)& Source,
BinObjMgt_Persistent& Target,
BinObjMgt_SRelocationTable& /*RelocTable*/) const
{
Handle(TDataStd_Name) aName = Handle(TDataStd_Name)::DownCast(Source);
Target << aName->Get();
Handle(TDataStd_GenericExtString) aStrAttr = Handle(TDataStd_GenericExtString)::DownCast(Source);
Target << aStrAttr->Get();
// process user defined guid
if(aName->ID() != TDataStd_Name::GetID())
Target << aName->ID();
Target << aStrAttr->ID();
}

View File

@@ -1,6 +1,4 @@
// Created on: 2002-11-19
// Created by: Edward AGAPOV
// Copyright (c) 2002-2014 OPEN CASCADE SAS
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -13,8 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataStd_NameDriver_HeaderFile
#define _BinMDataStd_NameDriver_HeaderFile
#ifndef _BinMDataStd_GenericExtStringDriver_HeaderFile
#define _BinMDataStd_GenericExtStringDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
@@ -28,20 +26,22 @@ class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataStd_NameDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_NameDriver, BinMDF_ADriver)
class BinMDataStd_GenericExtStringDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_GenericExtStringDriver, BinMDF_ADriver)
//! TDataStd_Name attribute Driver.
class BinMDataStd_NameDriver : public BinMDF_ADriver
class BinMDataStd_GenericExtStringDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataStd_NameDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT BinMDataStd_GenericExtStringDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Handle(Standard_Type)& SourceType() const Standard_OVERRIDE;
//! persistent -> transient (retrieve)
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
@@ -51,7 +51,7 @@ public:
DEFINE_STANDARD_RTTIEXT(BinMDataStd_NameDriver,BinMDF_ADriver)
DEFINE_STANDARD_RTTIEXT(BinMDataStd_GenericExtStringDriver,BinMDF_ADriver)
protected:
@@ -71,4 +71,4 @@ private:
#endif // _BinMDataStd_NameDriver_HeaderFile
#endif // _BinMDataStd_GenericExtStringDriver_HeaderFile

View File

@@ -65,7 +65,6 @@ Standard_Boolean BinMDataStd_IntegerDriver::Paste
ok = theSource >> aGuid;
if (!ok) {
theSource.SetPosition(aPos);
anAtt->SetID(TDataStd_Integer::GetID());
ok = Standard_True;
} else {
anAtt->SetID(aGuid);

View File

@@ -1,70 +0,0 @@
// Created on: 2004-05-13
// Created by: Sergey ZARITCHNY
// Copyright (c) 2004-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMDataStd_NoteBookDriver.hxx>
#include <BinMDF_ADriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDataStd_NoteBook.hxx>
#include <TDF_Attribute.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_NoteBookDriver,BinMDF_ADriver)
//=======================================================================
//function : BinMDataStd_NoteBookDriver
//purpose :
//=======================================================================
BinMDataStd_NoteBookDriver::BinMDataStd_NoteBookDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TDataStd_NoteBook)->Name())
{
}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_NoteBookDriver::NewEmpty() const
{
return new TDataStd_NoteBook();
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMDataStd_NoteBookDriver::Paste
(const BinObjMgt_Persistent&,
const Handle(TDF_Attribute)&,
BinObjMgt_RRelocationTable& ) const
{return Standard_True;}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMDataStd_NoteBookDriver::Paste (const Handle(TDF_Attribute)&,
BinObjMgt_Persistent&,
BinObjMgt_SRelocationTable& ) const
{}

View File

@@ -1,72 +0,0 @@
// Created on: 2004-05-13
// Created by: Sergey ZARITCHNY <szy@opencascade.com>
// Copyright (c) 2004-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataStd_NoteBookDriver_HeaderFile
#define _BinMDataStd_NoteBookDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataStd_NoteBookDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_NoteBookDriver, BinMDF_ADriver)
//! NoteBook attribute Driver.
class BinMDataStd_NoteBookDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataStd_NoteBookDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMDataStd_NoteBookDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMDataStd_NoteBookDriver_HeaderFile

View File

@@ -1,122 +0,0 @@
// Created on: 2001-09-12
// Created by: Julia DOROVSKIKH
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BinMDataStd_RelationDriver.hxx>
#include <BinObjMgt_Persistent.hxx>
#include <Message_Messenger.hxx>
#include <Standard_Type.hxx>
#include <TDataStd_Relation.hxx>
#include <TDataStd_Variable.hxx>
#include <TDF_Attribute.hxx>
#include <TDF_ListIteratorOfAttributeList.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BinMDataStd_RelationDriver,BinMDF_ADriver)
//=======================================================================
//function : BinMDataStd_RelationDriver
//purpose : Constructor
//=======================================================================
BinMDataStd_RelationDriver::BinMDataStd_RelationDriver
(const Handle(Message_Messenger)& theMsgDriver)
: BinMDF_ADriver (theMsgDriver, NULL)
{}
//=======================================================================
//function : NewEmpty
//purpose :
//=======================================================================
Handle(TDF_Attribute) BinMDataStd_RelationDriver::NewEmpty() const
{
return (new TDataStd_Relation());
}
//=======================================================================
//function : Paste
//purpose : persistent -> transient (retrieve)
//=======================================================================
Standard_Boolean BinMDataStd_RelationDriver::Paste
(const BinObjMgt_Persistent& theSource,
const Handle(TDF_Attribute)& theTarget,
BinObjMgt_RRelocationTable& theRelocTable) const
{
Handle(TDataStd_Relation) aC =
Handle(TDataStd_Relation)::DownCast(theTarget);
// variables
Standard_Integer nbvar;
if (! (theSource >> nbvar) || nbvar < 0)
return Standard_False;
TDF_AttributeList& aList = aC->GetVariables();
for (; nbvar > 0; nbvar--)
{
Handle(TDF_Attribute) aV;
Standard_Integer aNb;
if (! (theSource >> aNb))
return Standard_False;
if (aNb > 0)
{
if (theRelocTable.IsBound(aNb))
aV = Handle(TDataStd_Variable)::DownCast(theRelocTable.Find(aNb));
else
{
aV = new TDataStd_Variable;
theRelocTable.Bind(aNb, aV);
}
}
aList.Append(aV);
}
// expression
TCollection_ExtendedString aString;
if (! (theSource >> aString))
return Standard_False;
aC->SetRelation(aString);
return Standard_True;
}
//=======================================================================
//function : Paste
//purpose : transient -> persistent (store)
//=======================================================================
void BinMDataStd_RelationDriver::Paste
(const Handle(TDF_Attribute)& theSource,
BinObjMgt_Persistent& theTarget,
BinObjMgt_SRelocationTable& theRelocTable) const
{
Handle(TDataStd_Relation) aC =
Handle(TDataStd_Relation)::DownCast(theSource);
// variables
const TDF_AttributeList& aList = aC->GetVariables();
Standard_Integer nbvar = aList.Extent();
theTarget << nbvar;
TDF_ListIteratorOfAttributeList it;
for (it.Initialize(aList); it.More(); it.Next())
{
const Handle(TDF_Attribute)& TV = it.Value();
Standard_Integer aNb;
if (!TV.IsNull())
aNb = theRelocTable.Add(TV);
else
aNb = -1;
theTarget << aNb;
}
// expression
TCollection_ExtendedString aName = aC->Name();
theTarget << aName;
}

View File

@@ -1,72 +0,0 @@
// Created on: 2001-09-12
// Created by: Julia DOROVSKIKH
// Copyright (c) 2001-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataStd_RelationDriver_HeaderFile
#define _BinMDataStd_RelationDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataStd_RelationDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_RelationDriver, BinMDF_ADriver)
//! Attribute Driver.
class BinMDataStd_RelationDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataStd_RelationDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMDataStd_RelationDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMDataStd_RelationDriver_HeaderFile

View File

@@ -1,72 +0,0 @@
// Created on: 2007-05-29
// Created by: Vlad Romashko
// Copyright (c) 2007-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BinMDataStd_TickDriver_HeaderFile
#define _BinMDataStd_TickDriver_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BinMDF_ADriver.hxx>
#include <Standard_Boolean.hxx>
#include <BinObjMgt_RRelocationTable.hxx>
#include <BinObjMgt_SRelocationTable.hxx>
class Message_Messenger;
class TDF_Attribute;
class BinObjMgt_Persistent;
class BinMDataStd_TickDriver;
DEFINE_STANDARD_HANDLE(BinMDataStd_TickDriver, BinMDF_ADriver)
//! Tick attribute driver.
class BinMDataStd_TickDriver : public BinMDF_ADriver
{
public:
Standard_EXPORT BinMDataStd_TickDriver(const Handle(Message_Messenger)& theMessageDriver);
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& Source, const Handle(TDF_Attribute)& Target, BinObjMgt_RRelocationTable& RelocTable) const Standard_OVERRIDE;
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& Source, BinObjMgt_Persistent& Target, BinObjMgt_SRelocationTable& RelocTable) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(BinMDataStd_TickDriver,BinMDF_ADriver)
protected:
private:
};
#endif // _BinMDataStd_TickDriver_HeaderFile

View File

@@ -8,10 +8,6 @@ BinMDataStd_BooleanListDriver.cxx
BinMDataStd_BooleanListDriver.hxx
BinMDataStd_ByteArrayDriver.cxx
BinMDataStd_ByteArrayDriver.hxx
BinMDataStd_CommentDriver.cxx
BinMDataStd_CommentDriver.hxx
BinMDataStd_DirectoryDriver.cxx
BinMDataStd_DirectoryDriver.hxx
BinMDataStd_ExpressionDriver.cxx
BinMDataStd_ExpressionDriver.hxx
BinMDataStd_ExtStringArrayDriver.cxx
@@ -28,10 +24,8 @@ BinMDataStd_IntPackedMapDriver.cxx
BinMDataStd_IntPackedMapDriver.hxx
BinMDataStd_NamedDataDriver.cxx
BinMDataStd_NamedDataDriver.hxx
BinMDataStd_NameDriver.cxx
BinMDataStd_NameDriver.hxx
BinMDataStd_NoteBookDriver.cxx
BinMDataStd_NoteBookDriver.hxx
BinMDataStd_GenericExtStringDriver.cxx
BinMDataStd_GenericExtStringDriver.hxx
BinMDataStd_RealArrayDriver.cxx
BinMDataStd_RealArrayDriver.hxx
BinMDataStd_RealDriver.cxx
@@ -42,10 +36,8 @@ BinMDataStd_ReferenceArrayDriver.cxx
BinMDataStd_ReferenceArrayDriver.hxx
BinMDataStd_ReferenceListDriver.cxx
BinMDataStd_ReferenceListDriver.hxx
BinMDataStd_RelationDriver.cxx
BinMDataStd_RelationDriver.hxx
BinMDataStd_TickDriver.cxx
BinMDataStd_TickDriver.hxx
BinMDataStd_GenericEmptyDriver.cxx
BinMDataStd_GenericEmptyDriver.hxx
BinMDataStd_TreeNodeDriver.cxx
BinMDataStd_TreeNodeDriver.hxx
BinMDataStd_UAttributeDriver.cxx

View File

@@ -16,14 +16,9 @@
// modified 13.04.2009 Sergey Zaritchny
#include <BinMDataXtd.hxx>
#include <BinMDataXtd_AxisDriver.hxx>
#include <BinMDataXtd_ConstraintDriver.hxx>
#include <BinMDataXtd_GeometryDriver.hxx>
#include <BinMDataXtd_PatternStdDriver.hxx>
#include <BinMDataXtd_PlacementDriver.hxx>
#include <BinMDataXtd_PlaneDriver.hxx>
#include <BinMDataXtd_PointDriver.hxx>
#include <BinMDataXtd_ShapeDriver.hxx>
#include <BinMDF_ADriverTable.hxx>
#include <Message_Messenger.hxx>
#include <BinMDataXtd_PresentationDriver.hxx>
@@ -42,11 +37,6 @@ void BinMDataXtd::AddDrivers (const Handle(BinMDF_ADriverTable)& theDriverTable,
theDriverTable->AddDriver (new BinMDataXtd_ConstraintDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_GeometryDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_PatternStdDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_ShapeDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_PointDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_AxisDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_PlaneDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_PlacementDriver (theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_TriangulationDriver(theMsgDriver) );
theDriverTable->AddDriver (new BinMDataXtd_PresentationDriver (theMsgDriver) );

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