mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
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.
This commit is contained in:
parent
99289bed0a
commit
7e785937b3
@ -71,6 +71,7 @@ BOPTools::MapShapesAndAncestors TopExp::MapShapesAndAncestors
|
|||||||
BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
|
BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
|
||||||
BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
|
BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
|
||||||
CDM_MessageDriver Message_Messenger
|
CDM_MessageDriver Message_Messenger
|
||||||
|
Message_ProgressSentry Message_ProgressScope
|
||||||
|
|
||||||
[tcollection]
|
[tcollection]
|
||||||
AdvApp2Var_SequenceOfNode
|
AdvApp2Var_SequenceOfNode
|
||||||
|
@ -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)
|
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
|
@subsection upgrade_750_message_messenger Message_Messenger interface change
|
||||||
|
|
||||||
Operators << with left argument *Handle(Message_Messenger)*, used to output messages with
|
Operators << with left argument *Handle(Message_Messenger)*, used to output messages with
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// include required OCCT headers
|
// include required OCCT headers
|
||||||
#include <Standard_Version.hxx>
|
#include <Standard_Version.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressIndicator.hxx>
|
||||||
|
#include <Message_ProgressScope.hxx>
|
||||||
//for OCC graphic
|
//for OCC graphic
|
||||||
#include <Aspect_DisplayConnection.hxx>
|
#include <Aspect_DisplayConnection.hxx>
|
||||||
#include <WNT_Window.hxx>
|
#include <WNT_Window.hxx>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
// include required OCCT headers
|
// include required OCCT headers
|
||||||
#include <Standard_Version.hxx>
|
#include <Standard_Version.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressIndicator.hxx>
|
||||||
|
#include <Message_ProgressScope.hxx>
|
||||||
//for OCC graphic
|
//for OCC graphic
|
||||||
#include <WNT_Window.hxx>
|
#include <WNT_Window.hxx>
|
||||||
#include <WNT_WClass.hxx>
|
#include <WNT_WClass.hxx>
|
||||||
|
@ -357,7 +357,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
|||||||
aChecker.SetNonDestructive(Standard_True);
|
aChecker.SetNonDestructive(Standard_True);
|
||||||
aChecker.SetRunParallel(myRunParallel);
|
aChecker.SetRunParallel(myRunParallel);
|
||||||
aChecker.SetFuzzyValue(myFuzzyValue);
|
aChecker.SetFuzzyValue(myFuzzyValue);
|
||||||
aChecker.SetProgressIndicator(myProgressIndicator);
|
aChecker.SetProgressIndicator(*myProgressScope);
|
||||||
//
|
//
|
||||||
aChecker.Perform();
|
aChecker.Perform();
|
||||||
Standard_Boolean hasError = aChecker.HasErrors();
|
Standard_Boolean hasError = aChecker.HasErrors();
|
||||||
|
@ -388,7 +388,7 @@ void BOPAlgo_BOP::Perform()
|
|||||||
pPF=new BOPAlgo_PaveFiller(aAllocator);
|
pPF=new BOPAlgo_PaveFiller(aAllocator);
|
||||||
pPF->SetArguments(aLS);
|
pPF->SetArguments(aLS);
|
||||||
pPF->SetRunParallel(myRunParallel);
|
pPF->SetRunParallel(myRunParallel);
|
||||||
pPF->SetProgressIndicator(myProgressIndicator);
|
pPF->SetProgressIndicator(*myProgressScope);
|
||||||
pPF->SetFuzzyValue(myFuzzyValue);
|
pPF->SetFuzzyValue(myFuzzyValue);
|
||||||
pPF->SetNonDestructive(myNonDestructive);
|
pPF->SetNonDestructive(myNonDestructive);
|
||||||
pPF->SetGlue(myGlue);
|
pPF->SetGlue(myGlue);
|
||||||
|
@ -195,7 +195,7 @@ void BOPAlgo_Builder::Perform()
|
|||||||
//
|
//
|
||||||
pPF->SetArguments(myArguments);
|
pPF->SetArguments(myArguments);
|
||||||
pPF->SetRunParallel(myRunParallel);
|
pPF->SetRunParallel(myRunParallel);
|
||||||
pPF->SetProgressIndicator(myProgressIndicator);
|
pPF->SetProgressIndicator(*myProgressScope);
|
||||||
pPF->SetFuzzyValue(myFuzzyValue);
|
pPF->SetFuzzyValue(myFuzzyValue);
|
||||||
pPF->SetNonDestructive(myNonDestructive);
|
pPF->SetNonDestructive(myNonDestructive);
|
||||||
pPF->SetGlue(myGlue);
|
pPF->SetGlue(myGlue);
|
||||||
@ -632,7 +632,7 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
|
|||||||
aBS.SetRunParallel(myRunParallel);
|
aBS.SetRunParallel(myRunParallel);
|
||||||
aBS.SetContext(myContext);
|
aBS.SetContext(myContext);
|
||||||
aBS.SetFuzzyValue(myFuzzyValue);
|
aBS.SetFuzzyValue(myFuzzyValue);
|
||||||
aBS.SetProgressIndicator(myProgressIndicator);
|
aBS.SetProgressIndicator(*myProgressScope);
|
||||||
aBS.Perform();
|
aBS.Perform();
|
||||||
|
|
||||||
// Resulting solids
|
// Resulting solids
|
||||||
|
@ -438,7 +438,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
|||||||
aBF.SetFace(aF);
|
aBF.SetFace(aF);
|
||||||
aBF.SetShapes(aLE);
|
aBF.SetShapes(aLE);
|
||||||
aBF.SetRunParallel(myRunParallel);
|
aBF.SetRunParallel(myRunParallel);
|
||||||
aBF.SetProgressIndicator(myProgressIndicator);
|
aBF.SetProgressIndicator(*myProgressScope);
|
||||||
//
|
//
|
||||||
}// for (i=0; i<aNbS; ++i) {
|
}// for (i=0; i<aNbS; ++i) {
|
||||||
//
|
//
|
||||||
@ -625,7 +625,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
|
|||||||
aPSB.Shape1() = aF1;
|
aPSB.Shape1() = aF1;
|
||||||
aPSB.Shape2() = aF2;
|
aPSB.Shape2() = aF2;
|
||||||
aPSB.SetFuzzyValue(myFuzzyValue);
|
aPSB.SetFuzzyValue(myFuzzyValue);
|
||||||
aPSB.SetProgressIndicator(myProgressIndicator);
|
aPSB.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -778,7 +778,7 @@ void BOPAlgo_Builder::FillInternalVertices()
|
|||||||
aVFI.SetVertex(aV);
|
aVFI.SetVertex(aV);
|
||||||
aVFI.SetFace(aFIm);
|
aVFI.SetFace(aFIm);
|
||||||
aVFI.SetFuzzyValue(myFuzzyValue);
|
aVFI.SetFuzzyValue(myFuzzyValue);
|
||||||
aVFI.SetProgressIndicator(myProgressIndicator);
|
aVFI.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
|
|||||||
aBS.SetSolid(aSolid);
|
aBS.SetSolid(aSolid);
|
||||||
aBS.SetShapes(aSFS);
|
aBS.SetShapes(aSFS);
|
||||||
aBS.SetRunParallel(myRunParallel);
|
aBS.SetRunParallel(myRunParallel);
|
||||||
aBS.SetProgressIndicator(myProgressIndicator);
|
aBS.SetProgressIndicator(*myProgressScope);
|
||||||
}//for (i=0; i<aNbS; ++i) {
|
}//for (i=0; i<aNbS; ++i) {
|
||||||
//
|
//
|
||||||
Standard_Integer k, aNbBS;
|
Standard_Integer k, aNbBS;
|
||||||
|
@ -432,7 +432,7 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
|
|||||||
aFaceSelfIntersect.SetFace(aF);
|
aFaceSelfIntersect.SetFace(aF);
|
||||||
aFaceSelfIntersect.SetTolF(aTolF);
|
aFaceSelfIntersect.SetTolF(aTolF);
|
||||||
//
|
//
|
||||||
aFaceSelfIntersect.SetProgressIndicator(myProgressIndicator);
|
aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer aNbFace = aVFace.Length();
|
Standard_Integer aNbFace = aVFace.Length();
|
||||||
|
@ -86,7 +86,7 @@ void BOPAlgo_MakerVolume::Perform()
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
pPF->SetRunParallel(myRunParallel);
|
pPF->SetRunParallel(myRunParallel);
|
||||||
pPF->SetProgressIndicator(myProgressIndicator);
|
pPF->SetProgressIndicator(*myProgressScope);
|
||||||
pPF->SetFuzzyValue(myFuzzyValue);
|
pPF->SetFuzzyValue(myFuzzyValue);
|
||||||
pPF->SetNonDestructive(myNonDestructive);
|
pPF->SetNonDestructive(myNonDestructive);
|
||||||
pPF->SetGlue(myGlue);
|
pPF->SetGlue(myGlue);
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
|
|
||||||
#include <BOPAlgo_Options.hxx>
|
#include <BOPAlgo_Options.hxx>
|
||||||
#include <Message_MsgFile.hxx>
|
#include <Message_MsgFile.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <NCollection_BaseAllocator.hxx>
|
#include <NCollection_BaseAllocator.hxx>
|
||||||
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <Standard_NotImplemented.hxx>
|
#include <Standard_NotImplemented.hxx>
|
||||||
#include <Standard_ProgramError.hxx>
|
#include <Standard_ProgramError.hxx>
|
||||||
@ -51,6 +52,7 @@ BOPAlgo_Options::BOPAlgo_Options()
|
|||||||
myReport(new Message_Report),
|
myReport(new Message_Report),
|
||||||
myRunParallel(myGlobalRunParallel),
|
myRunParallel(myGlobalRunParallel),
|
||||||
myFuzzyValue(Precision::Confusion()),
|
myFuzzyValue(Precision::Confusion()),
|
||||||
|
myProgressScope(0L),
|
||||||
myUseOBB(Standard_False)
|
myUseOBB(Standard_False)
|
||||||
{
|
{
|
||||||
BOPAlgo_LoadMessages();
|
BOPAlgo_LoadMessages();
|
||||||
@ -67,6 +69,7 @@ BOPAlgo_Options::BOPAlgo_Options
|
|||||||
myReport(new Message_Report),
|
myReport(new Message_Report),
|
||||||
myRunParallel(myGlobalRunParallel),
|
myRunParallel(myGlobalRunParallel),
|
||||||
myFuzzyValue(Precision::Confusion()),
|
myFuzzyValue(Precision::Confusion()),
|
||||||
|
myProgressScope(0L),
|
||||||
myUseOBB(Standard_False)
|
myUseOBB(Standard_False)
|
||||||
{
|
{
|
||||||
BOPAlgo_LoadMessages();
|
BOPAlgo_LoadMessages();
|
||||||
@ -132,22 +135,21 @@ void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPAlgo_Options::SetProgressIndicator
|
void BOPAlgo_Options::SetProgressIndicator
|
||||||
(const Handle(Message_ProgressIndicator)& theObj)
|
(const Message_ProgressScope& theScope)
|
||||||
{
|
{
|
||||||
if (!theObj.IsNull()) {
|
myProgressScope = &theScope;
|
||||||
myProgressIndicator = theObj;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UserBreak
|
//function : UserBreak
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPAlgo_Options::UserBreak() const
|
void BOPAlgo_Options::UserBreak() const
|
||||||
{
|
{
|
||||||
if (myProgressIndicator.IsNull()) {
|
if (!myProgressScope) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (myProgressIndicator->UserBreak()) {
|
if (myProgressScope->UserBreak()) {
|
||||||
throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
|
throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <NCollection_BaseAllocator.hxx>
|
#include <NCollection_BaseAllocator.hxx>
|
||||||
|
|
||||||
class Message_ProgressIndicator;
|
class Message_ProgressScope;
|
||||||
|
|
||||||
//! The class provides the following options for the algorithms in Boolean Component:
|
//! The class provides the following options for the algorithms in Boolean Component:
|
||||||
//! - *Memory allocation tool* - tool for memory allocations;
|
//! - *Memory allocation tool* - tool for memory allocations;
|
||||||
@ -156,7 +156,7 @@ public:
|
|||||||
//!@name Progress indicator
|
//!@name Progress indicator
|
||||||
|
|
||||||
//! Set the Progress Indicator object.
|
//! Set the Progress Indicator object.
|
||||||
Standard_EXPORT void SetProgressIndicator(const Handle(Message_ProgressIndicator)& theObj);
|
Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//!@name Usage of Oriented Bounding boxes
|
//!@name Usage of Oriented Bounding boxes
|
||||||
@ -185,7 +185,7 @@ protected:
|
|||||||
Handle(Message_Report) myReport;
|
Handle(Message_Report) myReport;
|
||||||
Standard_Boolean myRunParallel;
|
Standard_Boolean myRunParallel;
|
||||||
Standard_Real myFuzzyValue;
|
Standard_Real myFuzzyValue;
|
||||||
Handle(Message_ProgressIndicator) myProgressIndicator;
|
const Message_ProgressScope* myProgressScope;
|
||||||
Standard_Boolean myUseOBB;
|
Standard_Boolean myUseOBB;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -264,7 +264,7 @@ void BOPAlgo_PaveFiller::IntersectVE
|
|||||||
aVESolver.SetEdge(aE);
|
aVESolver.SetEdge(aE);
|
||||||
aVESolver.SetPaveBlock(aPB);
|
aVESolver.SetPaveBlock(aPB);
|
||||||
aVESolver.SetFuzzyValue(myFuzzyValue);
|
aVESolver.SetFuzzyValue(myFuzzyValue);
|
||||||
aVESolver.SetProgressIndicator(myProgressIndicator);
|
aVESolver.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -253,7 +253,7 @@ void BOPAlgo_PaveFiller::PerformEE()
|
|||||||
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
|
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
|
||||||
anEdgeEdge.SetBoxes (aBB1, aBB2);
|
anEdgeEdge.SetBoxes (aBB1, aBB2);
|
||||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
||||||
anEdgeEdge.SetProgressIndicator(myProgressIndicator);
|
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||||
}//for (; aIt2.More(); aIt2.Next()) {
|
}//for (; aIt2.More(); aIt2.Next()) {
|
||||||
}//for (; aIt1.More(); aIt1.Next()) {
|
}//for (; aIt1.More(); aIt1.Next()) {
|
||||||
}//for (; myIterator->More(); myIterator->Next()) {
|
}//for (; myIterator->More(); myIterator->Next()) {
|
||||||
@ -1073,7 +1073,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
|
|||||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
anEdgeEdge.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
||||||
else
|
else
|
||||||
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
|
||||||
anEdgeEdge.SetProgressIndicator(myProgressIndicator);
|
anEdgeEdge.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ void BOPAlgo_PaveFiller::PerformVF()
|
|||||||
aVertexFace.SetVertex(aV);
|
aVertexFace.SetVertex(aV);
|
||||||
aVertexFace.SetFace(aF);
|
aVertexFace.SetFace(aF);
|
||||||
aVertexFace.SetFuzzyValue(myFuzzyValue);
|
aVertexFace.SetFuzzyValue(myFuzzyValue);
|
||||||
aVertexFace.SetProgressIndicator(myProgressIndicator);
|
aVertexFace.SetProgressIndicator(*myProgressScope);
|
||||||
}//for (; myIterator->More(); myIterator->Next()) {
|
}//for (; myIterator->More(); myIterator->Next()) {
|
||||||
//
|
//
|
||||||
aNbVF=aVVF.Length();
|
aNbVF=aVVF.Length();
|
||||||
|
@ -278,7 +278,7 @@ void BOPAlgo_PaveFiller::PerformEF()
|
|||||||
aSR = aPBRange;
|
aSR = aPBRange;
|
||||||
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
|
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
|
||||||
aEdgeFace.SetRange (aPBRange);
|
aEdgeFace.SetRange (aPBRange);
|
||||||
aEdgeFace.SetProgressIndicator(myProgressIndicator);
|
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||||
// Save the pair to avoid their forced intersection
|
// Save the pair to avoid their forced intersection
|
||||||
BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
|
BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
|
||||||
if (!pMPB)
|
if (!pMPB)
|
||||||
@ -999,7 +999,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
|
|||||||
aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
|
||||||
aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
|
aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
|
||||||
aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
|
aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
|
||||||
aEdgeFace.SetProgressIndicator(myProgressIndicator);
|
aEdgeFace.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ void BOPAlgo_PaveFiller::PerformFF()
|
|||||||
//
|
//
|
||||||
aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
|
aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
|
||||||
aFaceFace.SetFuzzyValue(myFuzzyValue);
|
aFaceFace.SetFuzzyValue(myFuzzyValue);
|
||||||
aFaceFace.SetProgressIndicator(myProgressIndicator);
|
aFaceFace.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// for the Glue mode just add all interferences of that type
|
// for the Glue mode just add all interferences of that type
|
||||||
@ -1007,7 +1007,7 @@ void BOPAlgo_PaveFiller::PostTreatFF
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
// 2 Fuse shapes
|
// 2 Fuse shapes
|
||||||
aPF.SetProgressIndicator(myProgressIndicator);
|
aPF.SetProgressIndicator(*myProgressScope);
|
||||||
aPF.SetRunParallel(myRunParallel);
|
aPF.SetRunParallel(myRunParallel);
|
||||||
aPF.SetArguments(aLS);
|
aPF.SetArguments(aLS);
|
||||||
aPF.Perform();
|
aPF.Perform();
|
||||||
|
@ -484,7 +484,7 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
|
|||||||
aBSE.SetCommonBlock(aCB);
|
aBSE.SetCommonBlock(aCB);
|
||||||
}
|
}
|
||||||
aBSE.SetDS(myDS);
|
aBSE.SetDS(myDS);
|
||||||
aBSE.SetProgressIndicator(myProgressIndicator);
|
aBSE.SetProgressIndicator(*myProgressScope);
|
||||||
} // for (; aItPB.More(); aItPB.Next()) {
|
} // for (; aItPB.More(); aItPB.Next()) {
|
||||||
} // for (i=0; i<aNbPBP; ++i) {
|
} // for (i=0; i<aNbPBP; ++i) {
|
||||||
//
|
//
|
||||||
@ -596,7 +596,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
|||||||
BOPAlgo_MPC& aMPC=aVMPC.Appended();
|
BOPAlgo_MPC& aMPC=aVMPC.Appended();
|
||||||
aMPC.SetEdge(aE);
|
aMPC.SetEdge(aE);
|
||||||
aMPC.SetFace(aF1F);
|
aMPC.SetFace(aF1F);
|
||||||
aMPC.SetProgressIndicator(myProgressIndicator);
|
aMPC.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// On
|
// On
|
||||||
@ -660,7 +660,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
|||||||
|
|
||||||
aMPC.SetEdge(aE);
|
aMPC.SetEdge(aE);
|
||||||
aMPC.SetFace(aF1F);
|
aMPC.SetFace(aF1F);
|
||||||
aMPC.SetProgressIndicator(myProgressIndicator);
|
aMPC.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}// for (i=0; i<aNbFI; ++i) {
|
}// for (i=0; i<aNbFI; ++i) {
|
||||||
//
|
//
|
||||||
@ -710,7 +710,7 @@ void BOPAlgo_PaveFiller::MakePCurves()
|
|||||||
aMPC.SetEdge(aE);
|
aMPC.SetEdge(aE);
|
||||||
aMPC.SetFace(aFf[m]);
|
aMPC.SetFace(aFf[m]);
|
||||||
aMPC.SetFlag(Standard_True);
|
aMPC.SetFlag(Standard_True);
|
||||||
aMPC.SetProgressIndicator(myProgressIndicator);
|
aMPC.SetProgressIndicator(*myProgressScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ void BOPAlgo_Splitter::Perform()
|
|||||||
BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
|
BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
|
||||||
pPF->SetArguments(aLS);
|
pPF->SetArguments(aLS);
|
||||||
pPF->SetRunParallel(myRunParallel);
|
pPF->SetRunParallel(myRunParallel);
|
||||||
pPF->SetProgressIndicator(myProgressIndicator);
|
pPF->SetProgressIndicator(*myProgressScope);
|
||||||
pPF->SetFuzzyValue(myFuzzyValue);
|
pPF->SetFuzzyValue(myFuzzyValue);
|
||||||
pPF->SetNonDestructive(myNonDestructive);
|
pPF->SetNonDestructive(myNonDestructive);
|
||||||
pPF->SetGlue(myGlue);
|
pPF->SetGlue(myGlue);
|
||||||
|
@ -24,9 +24,8 @@
|
|||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||||
#include <BOPAlgo_Options.hxx>
|
#include <BOPAlgo_Options.hxx>
|
||||||
class Message_ProgressIndicator;
|
|
||||||
class TopoDS_Shape;
|
|
||||||
|
|
||||||
|
class TopoDS_Shape;
|
||||||
|
|
||||||
//! Provides the root interface for the API algorithms
|
//! Provides the root interface for the API algorithms
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
|
|||||||
myDSFiller->SetArguments(theArgs);
|
myDSFiller->SetArguments(theArgs);
|
||||||
// Set options for intersection
|
// Set options for intersection
|
||||||
myDSFiller->SetRunParallel(myRunParallel);
|
myDSFiller->SetRunParallel(myRunParallel);
|
||||||
myDSFiller->SetProgressIndicator(myProgressIndicator);
|
myDSFiller->SetProgressIndicator(*myProgressScope);
|
||||||
myDSFiller->SetFuzzyValue(myFuzzyValue);
|
myDSFiller->SetFuzzyValue(myFuzzyValue);
|
||||||
myDSFiller->SetNonDestructive(myNonDestructive);
|
myDSFiller->SetNonDestructive(myNonDestructive);
|
||||||
myDSFiller->SetGlue(myGlue);
|
myDSFiller->SetGlue(myGlue);
|
||||||
@ -145,7 +145,7 @@ void BRepAlgoAPI_BuilderAlgo::BuildResult()
|
|||||||
{
|
{
|
||||||
// Set options to the builder
|
// Set options to the builder
|
||||||
myBuilder->SetRunParallel(myRunParallel);
|
myBuilder->SetRunParallel(myRunParallel);
|
||||||
myBuilder->SetProgressIndicator(myProgressIndicator);
|
myBuilder->SetProgressIndicator(*myProgressScope);
|
||||||
myBuilder->SetCheckInverted(myCheckInverted);
|
myBuilder->SetCheckInverted(myCheckInverted);
|
||||||
myBuilder->SetToFillHistory(myFillHistory);
|
myBuilder->SetToFillHistory(myFillHistory);
|
||||||
// Perform building of the result with pre-calculated intersections
|
// Perform building of the result with pre-calculated intersections
|
||||||
|
@ -94,7 +94,7 @@ void BRepAlgoAPI_Check::Perform()
|
|||||||
anAnalyzer.SelfInterMode() = myTestSI;
|
anAnalyzer.SelfInterMode() = myTestSI;
|
||||||
// Set options from BOPAlgo_Options
|
// Set options from BOPAlgo_Options
|
||||||
anAnalyzer.SetRunParallel(myRunParallel);
|
anAnalyzer.SetRunParallel(myRunParallel);
|
||||||
anAnalyzer.SetProgressIndicator(myProgressIndicator);
|
anAnalyzer.SetProgressIndicator(*myProgressScope);
|
||||||
anAnalyzer.SetFuzzyValue(myFuzzyValue);
|
anAnalyzer.SetFuzzyValue(myFuzzyValue);
|
||||||
// Perform the check
|
// Perform the check
|
||||||
anAnalyzer.Perform();
|
anAnalyzer.Perform();
|
||||||
|
@ -85,8 +85,7 @@
|
|||||||
#include <GeomLib.hxx>
|
#include <GeomLib.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <gp_Vec.hxx>
|
#include <gp_Vec.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
|
||||||
#include <NCollection_UBTreeFiller.hxx>
|
#include <NCollection_UBTreeFiller.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
@ -1812,10 +1811,10 @@ void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
|
|||||||
#include <OSD_Timer.hxx>
|
#include <OSD_Timer.hxx>
|
||||||
#endif
|
#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;
|
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
|
#ifdef OCCT_DEBUG
|
||||||
Standard_Real t_total = 0., t_analysis = 0., t_assembling = 0., t_cutting = 0., t_merging = 0.;
|
Standard_Real t_total = 0., t_analysis = 0., t_assembling = 0., t_cutting = 0., t_merging = 0.;
|
||||||
OSD_Chronometer chr_total, chr_local;
|
OSD_Chronometer chr_total, chr_local;
|
||||||
@ -1831,10 +1830,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
chr_local.Reset();
|
chr_local.Reset();
|
||||||
chr_local.Start();
|
chr_local.Start();
|
||||||
#endif
|
#endif
|
||||||
FaceAnalysis (thePI);
|
FaceAnalysis (aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
chr_local.Stop();
|
chr_local.Stop();
|
||||||
chr_local.Show(t_analysis);
|
chr_local.Show(t_analysis);
|
||||||
@ -1855,10 +1853,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
chr_local.Reset();
|
chr_local.Reset();
|
||||||
chr_local.Start();
|
chr_local.Start();
|
||||||
#endif
|
#endif
|
||||||
VerticesAssembling (thePI);
|
VerticesAssembling (aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
chr_local.Stop();
|
chr_local.Stop();
|
||||||
chr_local.Show(t_assembling);
|
chr_local.Show(t_assembling);
|
||||||
@ -1871,10 +1868,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
chr_local.Reset();
|
chr_local.Reset();
|
||||||
chr_local.Start();
|
chr_local.Start();
|
||||||
#endif
|
#endif
|
||||||
Cutting (thePI);
|
Cutting (aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
chr_local.Stop();
|
chr_local.Stop();
|
||||||
chr_local.Show(t_cutting);
|
chr_local.Show(t_cutting);
|
||||||
@ -1886,10 +1882,9 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
chr_local.Reset();
|
chr_local.Reset();
|
||||||
chr_local.Start();
|
chr_local.Start();
|
||||||
#endif
|
#endif
|
||||||
Merging (Standard_True, thePI);
|
Merging (Standard_True, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
chr_local.Stop();
|
chr_local.Stop();
|
||||||
chr_local.Show(t_merging);
|
chr_local.Show(t_merging);
|
||||||
@ -1898,10 +1893,10 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aPS.Next( 1, Handle(TCollection_HAsciiString)());
|
aPS.Next();
|
||||||
if (myCutting)
|
if (myCutting)
|
||||||
aPS.Next( 1, Handle(TCollection_HAsciiString)());
|
aPS.Next();
|
||||||
aPS.Next( 1, Handle(TCollection_HAsciiString)());
|
aPS.Next();
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1913,7 +1908,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
std::cout << "Creating sewed shape..." << std::endl;
|
std::cout << "Creating sewed shape..." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
// examine the multiple edges if any and process sameparameter for edges if necessary
|
// examine the multiple edges if any and process sameparameter for edges if necessary
|
||||||
EdgeProcessing (thePI);
|
EdgeProcessing (aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
CreateSewedShape();
|
CreateSewedShape();
|
||||||
@ -1923,7 +1918,7 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeRegularity (thePI);
|
EdgeRegularity (aPS.Next());
|
||||||
|
|
||||||
if (mySameParameterMode && myFaceMode)
|
if (mySameParameterMode && myFaceMode)
|
||||||
SameParameterShape();
|
SameParameterShape();
|
||||||
@ -2235,7 +2230,7 @@ void BRepBuilderAPI_Sewing::Dump() const
|
|||||||
// myDegenerated
|
// myDegenerated
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)& thePI)
|
void BRepBuilderAPI_Sewing::FaceAnalysis(const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if (!myShape.IsNull() && myOldShapes.IsEmpty()) {
|
if (!myShape.IsNull() && myOldShapes.IsEmpty()) {
|
||||||
Add(myShape);
|
Add(myShape);
|
||||||
@ -2246,7 +2241,7 @@ void BRepBuilderAPI_Sewing::FaceAnalysis(const Handle(Message_ProgressIndicator)
|
|||||||
TopTools_MapOfShape SmallEdges;
|
TopTools_MapOfShape SmallEdges;
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape GluedVertices;
|
TopTools_IndexedDataMapOfShapeListOfShape GluedVertices;
|
||||||
Standard_Integer i = 1;
|
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 (i = 1; i <= myOldShapes.Extent() && aPS.More(); i++, aPS.Next()) {
|
||||||
for (TopExp_Explorer fexp(myOldShapes(i),TopAbs_FACE); fexp.More(); fexp.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,
|
TopTools_DataMapOfShapeListOfShape& aNodeEdges,
|
||||||
const TopTools_IndexedDataMapOfShapeListOfShape& aBoundFaces,
|
const TopTools_IndexedDataMapOfShapeListOfShape& aBoundFaces,
|
||||||
const Standard_Real Tolerance,
|
const Standard_Real Tolerance,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
// Create map of node -> vertices
|
// Create map of node -> vertices
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape NodeVertices;
|
TopTools_IndexedDataMapOfShapeListOfShape NodeVertices;
|
||||||
@ -2805,7 +2800,7 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
|
|||||||
#endif
|
#endif
|
||||||
// Merge nearest nodes
|
// Merge nearest nodes
|
||||||
TopTools_IndexedDataMapOfShapeShape NodeNearestNode;
|
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()) {
|
for (Standard_Integer i = 1; i <= nbNodes && aPS.More(); i++, aPS.Next()) {
|
||||||
const TopoDS_Vertex& node1 = TopoDS::Vertex(NodeVertices.FindKey(i));
|
const TopoDS_Vertex& node1 = TopoDS::Vertex(NodeVertices.FindKey(i));
|
||||||
// Find near nodes
|
// Find near nodes
|
||||||
@ -2938,11 +2933,11 @@ static Standard_Boolean GlueVertices(TopTools_IndexedDataMapOfShapeShape& aVerte
|
|||||||
return CreateNewNodes(NodeNearestNode,NodeVertices,aVertexNode,aNodeEdges);
|
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 nbVert = myVertexNode.Extent();
|
||||||
Standard_Integer nbVertFree = myVertexNodeFree.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) {
|
if (nbVert || nbVertFree) {
|
||||||
// Fill map node -> sections
|
// Fill map node -> sections
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
@ -2964,16 +2959,15 @@ void BRepBuilderAPI_Sewing::VerticesAssembling(const Handle(Message_ProgressIndi
|
|||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
std::cout << "Assemble " << nbVert << " vertices on faces..." << std::endl;
|
std::cout << "Assemble " << nbVert << " vertices on faces..." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, thePI));
|
while (GlueVertices(myVertexNode,myNodeSections,myBoundFaces,myTolerance, aPS.Next()));
|
||||||
}
|
}
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
|
||||||
if (nbVertFree) {
|
if (nbVertFree) {
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
std::cout << "Assemble " << nbVertFree << " vertices on floating edges..." << std::endl;
|
std::cout << "Assemble " << nbVertFree << " vertices on floating edges..." << std::endl;
|
||||||
#endif
|
#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 */,
|
void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
|
||||||
const Handle(Message_ProgressIndicator)& thePI)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
// TopTools_MapOfShape MergedEdges;
|
// 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);
|
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
|
||||||
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
||||||
|
|
||||||
@ -3623,7 +3617,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
|
|||||||
// myCuttingNode
|
// myCuttingNode
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& thePI)
|
void BRepBuilderAPI_Sewing::Cutting(const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
Standard_Integer i, nbVertices = myVertexNode.Extent();
|
Standard_Integer i, nbVertices = myVertexNode.Extent();
|
||||||
if (!nbVertices) return;
|
if (!nbVertices) return;
|
||||||
@ -3646,7 +3640,7 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
|
|||||||
Standard_Real first, last;
|
Standard_Real first, last;
|
||||||
// Iterate on all boundaries
|
// Iterate on all boundaries
|
||||||
Standard_Integer nbBounds = myBoundFaces.Extent();
|
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);
|
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
|
||||||
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
||||||
const TopoDS_Edge& bound = TopoDS::Edge(anIterB.Key());
|
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
|
// - make the contigous edges sameparameter
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepBuilderAPI_Sewing::EdgeProcessing(const Handle(Message_ProgressIndicator)& thePI)
|
void BRepBuilderAPI_Sewing::EdgeProcessing(const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
// constructs sectionEdge
|
// constructs sectionEdge
|
||||||
TopTools_IndexedMapOfShape MapFreeEdges;
|
TopTools_IndexedMapOfShape MapFreeEdges;
|
||||||
TopTools_DataMapOfShapeShape EdgeFace;
|
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);
|
TopTools_IndexedDataMapOfShapeListOfShape::Iterator anIterB(myBoundFaces);
|
||||||
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
for (; anIterB.More() && aPS.More(); anIterB.Next(), aPS.Next()) {
|
||||||
const TopoDS_Shape& bound = anIterB.Key();
|
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
|
//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;
|
TopTools_IndexedDataMapOfShapeListOfShape aMapEF;
|
||||||
TopExp::MapShapesAndAncestors(mySewedShape, TopAbs_EDGE, TopAbs_FACE, 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())
|
for (TopTools_MapIteratorOfMapOfShape aMEIt(myMergedEdges); aMEIt.More() && aPS.More(); aMEIt.Next(), aPS.Next())
|
||||||
{
|
{
|
||||||
TopoDS_Edge anEdge = TopoDS::Edge(myReShape->Apply(aMEIt.Value()));
|
TopoDS_Edge anEdge = TopoDS::Edge(myReShape->Apply(aMEIt.Value()));
|
||||||
|
@ -41,13 +41,12 @@
|
|||||||
#include <TColgp_Array1OfPnt.hxx>
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
#include <TColStd_SequenceOfReal.hxx>
|
#include <TColStd_SequenceOfReal.hxx>
|
||||||
|
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class BRepTools_ReShape;
|
class BRepTools_ReShape;
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Standard_NoSuchObject;
|
class Standard_NoSuchObject;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class Message_ProgressIndicator;
|
|
||||||
class TopoDS_Edge;
|
class TopoDS_Edge;
|
||||||
class TopoDS_Face;
|
class TopoDS_Face;
|
||||||
class Geom_Surface;
|
class Geom_Surface;
|
||||||
@ -105,8 +104,8 @@ public:
|
|||||||
Standard_EXPORT void Add (const TopoDS_Shape& shape);
|
Standard_EXPORT void Add (const TopoDS_Shape& shape);
|
||||||
|
|
||||||
//! Computing
|
//! Computing
|
||||||
//! thePI - progress indicator of algorithm
|
//! theProgress - progress indicator of algorithm
|
||||||
Standard_EXPORT void Perform (const Handle(Message_ProgressIndicator)& thePI = 0);
|
Standard_EXPORT void Perform (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Gives the sewed shape
|
//! Gives the sewed shape
|
||||||
//! a null shape if nothing constructed
|
//! a null shape if nothing constructed
|
||||||
@ -248,10 +247,10 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
//! Performs cutting of sections
|
//! Performs cutting of sections
|
||||||
//! thePI - progress indicator of processing
|
//! theProgress - progress indicator of processing
|
||||||
Standard_EXPORT void Cutting (const Handle(Message_ProgressIndicator)& thePI = 0);
|
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;
|
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.
|
//! Merged nearest edges.
|
||||||
Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfBoolean& SeqMergedOri);
|
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
|
//! 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();
|
Standard_EXPORT void CreateOutputInformations();
|
||||||
|
|
||||||
@ -277,8 +276,8 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
//! This method is called from Perform only
|
//! This method is called from Perform only
|
||||||
//! thePI - progress indicator of processing
|
//! theProgress - progress indicator of processing
|
||||||
Standard_EXPORT virtual void FaceAnalysis (const Handle(Message_ProgressIndicator)& thePI = 0);
|
Standard_EXPORT virtual void FaceAnalysis (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
|
|
||||||
//! This method is called from Perform only
|
//! This method is called from Perform only
|
||||||
@ -286,8 +285,8 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
//! This method is called from Perform only
|
//! This method is called from Perform only
|
||||||
//! thePI - progress indicator of processing
|
//! theProgress - progress indicator of processing
|
||||||
Standard_EXPORT virtual void VerticesAssembling (const Handle(Message_ProgressIndicator)& thePI = 0);
|
Standard_EXPORT virtual void VerticesAssembling (const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
|
|
||||||
//! This method is called from Perform only
|
//! This method is called from Perform only
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
#include <Geom2d_TrimmedCurve.hxx>
|
#include <Geom2d_TrimmedCurve.hxx>
|
||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopTools_ListOfShape.hxx>
|
||||||
@ -455,7 +456,7 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
|
|||||||
aSewing.Add(aSeq.Value(i));
|
aSewing.Add(aSeq.Value(i));
|
||||||
|
|
||||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDi, 1);
|
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDi, 1);
|
||||||
aSewing.Perform (aProgress);
|
aSewing.Perform (aProgress->Start());
|
||||||
aSewing.Dump();
|
aSewing.Dump();
|
||||||
|
|
||||||
const TopoDS_Shape& aRes = aSewing.SewedShape();
|
const TopoDS_Shape& aRes = aSewing.SewedShape();
|
||||||
|
@ -127,7 +127,8 @@ Handle(Transfer_FinderProcess) BRepToIGES_BREntity::GetTransferProcess() const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(IGESData_IGESEntity) BRepToIGES_BREntity::TransferShape
|
Handle(IGESData_IGESEntity) BRepToIGES_BREntity::TransferShape
|
||||||
(const TopoDS_Shape& start)
|
(const TopoDS_Shape& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
Handle(IGESData_IGESEntity) res;
|
Handle(IGESData_IGESEntity) res;
|
||||||
// TopoDS_Shape theShape;
|
// TopoDS_Shape theShape;
|
||||||
@ -164,31 +165,31 @@ Handle(IGESData_IGESEntity) BRepToIGES_BREntity::TransferShape
|
|||||||
TopoDS_Face F = TopoDS::Face(start);
|
TopoDS_Face F = TopoDS::Face(start);
|
||||||
BRepToIGES_BRShell BS(*this);
|
BRepToIGES_BRShell BS(*this);
|
||||||
BS.SetModel(GetModel());
|
BS.SetModel(GetModel());
|
||||||
res = BS.TransferFace(F);
|
res = BS.TransferFace(F, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_SHELL) {
|
else if (start.ShapeType() == TopAbs_SHELL) {
|
||||||
TopoDS_Shell S = TopoDS::Shell(start);
|
TopoDS_Shell S = TopoDS::Shell(start);
|
||||||
BRepToIGES_BRShell BS(*this);
|
BRepToIGES_BRShell BS(*this);
|
||||||
BS.SetModel(GetModel());
|
BS.SetModel(GetModel());
|
||||||
res = BS.TransferShell(S);
|
res = BS.TransferShell(S, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_SOLID) {
|
else if (start.ShapeType() == TopAbs_SOLID) {
|
||||||
TopoDS_Solid M = TopoDS::Solid(start);
|
TopoDS_Solid M = TopoDS::Solid(start);
|
||||||
BRepToIGES_BRSolid BS(*this);
|
BRepToIGES_BRSolid BS(*this);
|
||||||
BS.SetModel(GetModel());
|
BS.SetModel(GetModel());
|
||||||
res = BS.TransferSolid(M);
|
res = BS.TransferSolid(M, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_COMPSOLID) {
|
else if (start.ShapeType() == TopAbs_COMPSOLID) {
|
||||||
TopoDS_CompSolid C = TopoDS::CompSolid(start);
|
TopoDS_CompSolid C = TopoDS::CompSolid(start);
|
||||||
BRepToIGES_BRSolid BS(*this);
|
BRepToIGES_BRSolid BS(*this);
|
||||||
BS.SetModel(GetModel());
|
BS.SetModel(GetModel());
|
||||||
res = BS.TransferCompSolid(C);
|
res = BS.TransferCompSolid(C, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_COMPOUND) {
|
else if (start.ShapeType() == TopAbs_COMPOUND) {
|
||||||
TopoDS_Compound C = TopoDS::Compound(start);
|
TopoDS_Compound C = TopoDS::Compound(start);
|
||||||
BRepToIGES_BRSolid BS(*this);
|
BRepToIGES_BRSolid BS(*this);
|
||||||
BS.SetModel(GetModel());
|
BS.SetModel(GetModel());
|
||||||
res = BS.TransferCompound(C);
|
res = BS.TransferCompound(C, theProgress);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// message d`erreur
|
// message d`erreur
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <Standard_CString.hxx>
|
#include <Standard_CString.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class IGESData_IGESModel;
|
class IGESData_IGESModel;
|
||||||
class Transfer_FinderProcess;
|
class Transfer_FinderProcess;
|
||||||
class IGESData_IGESEntity;
|
class IGESData_IGESEntity;
|
||||||
@ -64,7 +66,9 @@ public:
|
|||||||
|
|
||||||
//! Returns the result of the transfert of any Shape
|
//! Returns the result of the transfert of any Shape
|
||||||
//! If the transfer has failed, this member return a NullEntity.
|
//! 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
|
//! Records a new Fail message
|
||||||
Standard_EXPORT void AddFail (const TopoDS_Shape& start, const Standard_CString amess);
|
Standard_EXPORT void AddFail (const TopoDS_Shape& start, const Standard_CString amess);
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include <IGESGeom_SurfaceOfRevolution.hxx>
|
#include <IGESGeom_SurfaceOfRevolution.hxx>
|
||||||
#include <IGESGeom_TrimmedSurface.hxx>
|
#include <IGESGeom_TrimmedSurface.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <NCollection_IncAllocator.hxx>
|
#include <NCollection_IncAllocator.hxx>
|
||||||
#include <NCollection_Map.hxx>
|
#include <NCollection_Map.hxx>
|
||||||
#include <ShapeAlgo.hxx>
|
#include <ShapeAlgo.hxx>
|
||||||
@ -86,7 +86,8 @@ BRepToIGES_BRShell::BRepToIGES_BRShell
|
|||||||
// TransferShell
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
|
|
||||||
@ -94,11 +95,11 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferShell(const TopoDS_Shap
|
|||||||
|
|
||||||
if (start.ShapeType() == TopAbs_FACE) {
|
if (start.ShapeType() == TopAbs_FACE) {
|
||||||
TopoDS_Face F = TopoDS::Face(start);
|
TopoDS_Face F = TopoDS::Face(start);
|
||||||
res = TransferFace(F);
|
res = TransferFace(F, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_SHELL) {
|
else if (start.ShapeType() == TopAbs_SHELL) {
|
||||||
TopoDS_Shell S = TopoDS::Shell(start);
|
TopoDS_Shell S = TopoDS::Shell(start);
|
||||||
res = TransferShell(S);
|
res = TransferShell(S, theProgress);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// message d`erreur
|
// message d`erreur
|
||||||
@ -112,16 +113,11 @@ 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(IGESData_IGESEntity) res;
|
||||||
|
|
||||||
Handle(Message_ProgressIndicator) progress = GetTransferProcess()->GetProgress();
|
|
||||||
if ( ! progress.IsNull() ) {
|
|
||||||
if ( progress->UserBreak() ) return res;
|
|
||||||
progress->Increment();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( start.IsNull()) {
|
if ( start.IsNull()) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -340,7 +336,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
|
|||||||
// TransferShell
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( start.IsNull()) return 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(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
||||||
Handle(IGESData_IGESEntity) IFace;
|
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());
|
TopoDS_Face F = TopoDS::Face(Ex.Current());
|
||||||
if (F.IsNull()) {
|
if (F.IsNull()) {
|
||||||
AddWarning(start," a Face is a null entity");
|
AddWarning(start," a Face is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IFace = TransferFace(F);
|
IFace = TransferFace (F, aRange);
|
||||||
if (!IFace.IsNull()) Seq->Append(IFace);
|
if (!IFace.IsNull()) Seq->Append(IFace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include <Standard_Handle.hxx>
|
#include <Standard_Handle.hxx>
|
||||||
|
|
||||||
#include <BRepToIGES_BREntity.hxx>
|
#include <BRepToIGES_BREntity.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class BRepToIGES_BREntity;
|
class BRepToIGES_BREntity;
|
||||||
class IGESData_IGESEntity;
|
class IGESData_IGESEntity;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
@ -48,15 +50,18 @@ public:
|
|||||||
//! Transfert an Shape entity from TopoDS to IGES
|
//! Transfert an Shape entity from TopoDS to IGES
|
||||||
//! This entity must be a Face or a Shell.
|
//! This entity must be a Face or a Shell.
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert an Shell entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert a Face entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <IGESData_HArray1OfIGESEntity.hxx>
|
#include <IGESData_HArray1OfIGESEntity.hxx>
|
||||||
#include <IGESData_IGESEntity.hxx>
|
#include <IGESData_IGESEntity.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <TColStd_HSequenceOfTransient.hxx>
|
#include <TColStd_HSequenceOfTransient.hxx>
|
||||||
#include <TopAbs_ShapeEnum.hxx>
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
@ -64,7 +65,8 @@ BRepToIGES_BRSolid::BRepToIGES_BRSolid
|
|||||||
// TransferSolid
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
|
|
||||||
@ -72,15 +74,15 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Shap
|
|||||||
|
|
||||||
if (start.ShapeType() == TopAbs_SOLID) {
|
if (start.ShapeType() == TopAbs_SOLID) {
|
||||||
TopoDS_Solid M = TopoDS::Solid(start);
|
TopoDS_Solid M = TopoDS::Solid(start);
|
||||||
res = TransferSolid(M);
|
res = TransferSolid(M, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_COMPSOLID) {
|
else if (start.ShapeType() == TopAbs_COMPSOLID) {
|
||||||
TopoDS_CompSolid C = TopoDS::CompSolid(start);
|
TopoDS_CompSolid C = TopoDS::CompSolid(start);
|
||||||
res = TransferCompSolid(C);
|
res = TransferCompSolid(C, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_COMPOUND) {
|
else if (start.ShapeType() == TopAbs_COMPOUND) {
|
||||||
TopoDS_Compound C = TopoDS::Compound(start);
|
TopoDS_Compound C = TopoDS::Compound(start);
|
||||||
res = TransferCompound(C);
|
res = TransferCompound(C, theProgress);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// error message
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( start.IsNull()) return res;
|
if ( start.IsNull()) return res;
|
||||||
@ -104,13 +107,19 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Soli
|
|||||||
BRepToIGES_BRShell BS(*this);
|
BRepToIGES_BRShell BS(*this);
|
||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
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());
|
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," an Shell is a null entity");
|
AddWarning(start," an Shell is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShell = BS.TransferShell(S);
|
IShell = BS.TransferShell (S, aRange);
|
||||||
if (!IShell.IsNull()) Seq->Append(IShell);
|
if (!IShell.IsNull()) Seq->Append(IShell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,7 +154,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferSolid(const TopoDS_Soli
|
|||||||
// TransferCompSolid
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( start.IsNull()) return res;
|
if ( start.IsNull()) return res;
|
||||||
@ -154,13 +164,19 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompSolid(const TopoDS_
|
|||||||
Handle(IGESData_IGESEntity) ISolid;
|
Handle(IGESData_IGESEntity) ISolid;
|
||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
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());
|
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," an Solid is a null entity");
|
AddWarning(start," an Solid is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ISolid = TransferSolid(S);
|
ISolid = TransferSolid (S, aRange);
|
||||||
if (!ISolid.IsNull()) Seq->Append(ISolid);
|
if (!ISolid.IsNull()) Seq->Append(ISolid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,7 +211,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompSolid(const TopoDS_
|
|||||||
// TransferCompound
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( start.IsNull()) return res;
|
if ( start.IsNull()) return res;
|
||||||
@ -207,46 +224,69 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
|
|||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
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
|
// 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());
|
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Solid is a null entity");
|
AddWarning(start," a Solid is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShape = TransferSolid(S);
|
IShape = TransferSolid (S, aRange);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// take all isolated Shells
|
// 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());
|
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Shell is a null entity");
|
AddWarning(start," a Shell is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShape = BS.TransferShell(S);
|
IShape = BS.TransferShell (S, aRange);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// take all isolated Faces
|
// 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());
|
TopoDS_Face S = TopoDS::Face(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Face is a null entity");
|
AddWarning(start," a Face is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShape = BS.TransferFace(S);
|
IShape = BS.TransferFace (S, aRange);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// take all isolated Wires
|
// 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());
|
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Wire is a null entity");
|
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
|
// 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());
|
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," an Edge is a null entity");
|
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
|
// 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());
|
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Vertex is a null entity");
|
AddWarning(start," a Vertex is a null entity");
|
||||||
@ -284,7 +326,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRSolid ::TransferCompound(const TopoDS_C
|
|||||||
}
|
}
|
||||||
|
|
||||||
// construct the group
|
// construct the group
|
||||||
Standard_Integer nbshapes = Seq->Length();
|
nbshapes = Seq->Length();
|
||||||
Handle(IGESData_HArray1OfIGESEntity) Tab;
|
Handle(IGESData_HArray1OfIGESEntity) Tab;
|
||||||
if (nbshapes >=1) {
|
if (nbshapes >=1) {
|
||||||
Tab = new IGESData_HArray1OfIGESEntity(1,nbshapes);
|
Tab = new IGESData_HArray1OfIGESEntity(1,nbshapes);
|
||||||
|
@ -49,19 +49,23 @@ public:
|
|||||||
//! Transfert a Shape entity from TopoDS to IGES
|
//! Transfert a Shape entity from TopoDS to IGES
|
||||||
//! this entity must be a Solid or a CompSolid or a Compound.
|
//! this entity must be a Solid or a CompSolid or a Compound.
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert a Solid entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert an CompSolid entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert a Compound entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
#include <IGESSolid_VertexList.hxx>
|
#include <IGESSolid_VertexList.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
#include <Interface_Static.hxx>
|
#include <Interface_Static.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <ShapeAlgo.hxx>
|
#include <ShapeAlgo.hxx>
|
||||||
#include <ShapeAlgo_AlgoContainer.hxx>
|
#include <ShapeAlgo_AlgoContainer.hxx>
|
||||||
#include <TColgp_HArray1OfXYZ.hxx>
|
#include <TColgp_HArray1OfXYZ.hxx>
|
||||||
@ -282,7 +282,8 @@ Standard_Integer BRepToIGESBRep_Entity::AddEdge(const TopoDS_Edge& myedge,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape
|
Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape
|
||||||
(const TopoDS_Shape& start)
|
(const TopoDS_Shape& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
Handle(IGESData_IGESEntity) res;
|
Handle(IGESData_IGESEntity) res;
|
||||||
//TopoDS_Shape theShape;
|
//TopoDS_Shape theShape;
|
||||||
@ -321,19 +322,19 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferShape
|
|||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_SHELL) {
|
else if (start.ShapeType() == TopAbs_SHELL) {
|
||||||
TopoDS_Shell S = TopoDS::Shell(start);
|
TopoDS_Shell S = TopoDS::Shell(start);
|
||||||
res = TransferShell(S);
|
res = TransferShell(S, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_SOLID) {
|
else if (start.ShapeType() == TopAbs_SOLID) {
|
||||||
TopoDS_Solid M = TopoDS::Solid(start);
|
TopoDS_Solid M = TopoDS::Solid(start);
|
||||||
res = TransferSolid(M);
|
res = TransferSolid(M, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_COMPSOLID) {
|
else if (start.ShapeType() == TopAbs_COMPSOLID) {
|
||||||
TopoDS_CompSolid C = TopoDS::CompSolid(start);
|
TopoDS_CompSolid C = TopoDS::CompSolid(start);
|
||||||
res = TransferCompSolid(C);
|
res = TransferCompSolid(C, theProgress);
|
||||||
}
|
}
|
||||||
else if (start.ShapeType() == TopAbs_COMPOUND) {
|
else if (start.ShapeType() == TopAbs_COMPOUND) {
|
||||||
TopoDS_Compound C = TopoDS::Compound(start);
|
TopoDS_Compound C = TopoDS::Compound(start);
|
||||||
res = TransferCompound(C);
|
res = TransferCompound(C, theProgress);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// error message
|
// 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(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;
|
Handle(IGESSolid_Face) myent = new IGESSolid_Face;
|
||||||
if ( start.IsNull()) return myent;
|
if ( start.IsNull()) return myent;
|
||||||
Handle(IGESData_IGESEntity) ISurf;
|
Handle(IGESData_IGESEntity) ISurf;
|
||||||
@ -623,7 +618,8 @@ Handle(IGESSolid_Face) BRepToIGESBRep_Entity ::TransferFace(const TopoDS_Face& s
|
|||||||
// TransferShell
|
// 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;
|
Handle(IGESSolid_Shell) myshell = new IGESSolid_Shell;
|
||||||
if ( start.IsNull()) return myshell;
|
if ( start.IsNull()) return myshell;
|
||||||
@ -633,7 +629,11 @@ Handle(IGESSolid_Shell) BRepToIGESBRep_Entity ::TransferShell(const TopoDS_Shell
|
|||||||
TColStd_SequenceOfInteger SeqFlag;
|
TColStd_SequenceOfInteger SeqFlag;
|
||||||
Handle(IGESSolid_Face) IFace;
|
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());
|
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 ( start.Orientation() == TopAbs_REVERSED ) F.Reverse(); //:l4 abv 12 Jan 99: CTS22022-2: writing reversed shells
|
||||||
if (F.IsNull()) {
|
if (F.IsNull()) {
|
||||||
@ -673,7 +673,8 @@ Handle(IGESSolid_Shell) BRepToIGESBRep_Entity ::TransferShell(const TopoDS_Shell
|
|||||||
// with a Solid
|
// 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;
|
Handle(IGESSolid_ManifoldSolid) mysol = new IGESSolid_ManifoldSolid;
|
||||||
if ( start.IsNull()) return mysol;
|
if ( start.IsNull()) return mysol;
|
||||||
@ -684,13 +685,19 @@ Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const Top
|
|||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
||||||
TColStd_SequenceOfInteger SeqFlag;
|
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());
|
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Shell is a null entity");
|
AddWarning(start," a Shell is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShell = TransferShell(S);
|
IShell = TransferShell (S, aRange);
|
||||||
if (!IShell.IsNull()) {
|
if (!IShell.IsNull()) {
|
||||||
Seq->Append(IShell);
|
Seq->Append(IShell);
|
||||||
if (S.Orientation() == TopAbs_FORWARD ) SeqFlag.Append(1);
|
if (S.Orientation() == TopAbs_FORWARD ) SeqFlag.Append(1);
|
||||||
@ -743,7 +750,8 @@ Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const Top
|
|||||||
// with a CompSolid
|
// 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;
|
Handle(IGESData_IGESEntity) myent;
|
||||||
if ( start.IsNull()) return 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(IGESSolid_ManifoldSolid) ISolid = new IGESSolid_ManifoldSolid;
|
||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
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());
|
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," an Solid is a null entity");
|
AddWarning(start," an Solid is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ISolid = TransferSolid(S);
|
ISolid = TransferSolid (S, aRange);
|
||||||
if (!ISolid.IsNull()) Seq->Append(ISolid);
|
if (!ISolid.IsNull()) Seq->Append(ISolid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -794,7 +808,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompSolid (const Topo
|
|||||||
// with a Compound
|
// 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;
|
Handle(IGESData_IGESEntity) res;
|
||||||
if ( start.IsNull()) return res;
|
if ( start.IsNull()) return res;
|
||||||
@ -804,33 +819,54 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
|
|||||||
Handle(IGESData_IGESEntity) IShape;
|
Handle(IGESData_IGESEntity) IShape;
|
||||||
Handle(TColStd_HSequenceOfTransient) Seq = new TColStd_HSequenceOfTransient();
|
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
|
// 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());
|
TopoDS_Solid S = TopoDS::Solid(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Solid is a null entity");
|
AddWarning(start," a Solid is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShape = TransferSolid(S);
|
IShape = TransferSolid (S, aRange);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// take all isolated Shells
|
// 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());
|
TopoDS_Shell S = TopoDS::Shell(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Shell is a null entity");
|
AddWarning(start," a Shell is a null entity");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
IShape = TransferShell(S);
|
IShape = TransferShell (S, aRange);
|
||||||
if (!IShape.IsNull()) Seq->Append(IShape);
|
if (!IShape.IsNull()) Seq->Append(IShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// take all isolated Faces
|
// 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());
|
TopoDS_Face S = TopoDS::Face(Ex.Current());
|
||||||
if (S.IsNull()) {
|
if (S.IsNull()) {
|
||||||
AddWarning(start," a Face is a null entity");
|
AddWarning(start," a Face is a null entity");
|
||||||
@ -843,7 +879,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
|
|||||||
|
|
||||||
|
|
||||||
// take all isolated Wires
|
// 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());
|
TopoDS_Wire S = TopoDS::Wire(Ex.Current());
|
||||||
|
|
||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
@ -854,7 +891,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
|
|||||||
|
|
||||||
|
|
||||||
// take all isolated Edges
|
// 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());
|
TopoDS_Edge S = TopoDS::Edge(Ex.Current());
|
||||||
|
|
||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
@ -865,7 +903,8 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
|
|||||||
|
|
||||||
|
|
||||||
// take all isolated Vertices
|
// 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());
|
TopoDS_Vertex S = TopoDS::Vertex(Ex.Current());
|
||||||
|
|
||||||
BRepToIGES_BRWire BW(*this);
|
BRepToIGES_BRWire BW(*this);
|
||||||
@ -875,7 +914,7 @@ Handle(IGESData_IGESEntity) BRepToIGESBRep_Entity::TransferCompound (const TopoD
|
|||||||
}
|
}
|
||||||
|
|
||||||
// construct the group
|
// construct the group
|
||||||
Standard_Integer nbshapes = Seq->Length();
|
nbshapes = Seq->Length();
|
||||||
if (nbshapes > 0) {
|
if (nbshapes > 0) {
|
||||||
Handle(IGESData_HArray1OfIGESEntity) Tab =
|
Handle(IGESData_HArray1OfIGESEntity) Tab =
|
||||||
new IGESData_HArray1OfIGESEntity(1,nbshapes);
|
new IGESData_HArray1OfIGESEntity(1,nbshapes);
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include <BRepToIGES_BREntity.hxx>
|
#include <BRepToIGES_BREntity.hxx>
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class IGESSolid_EdgeList;
|
class IGESSolid_EdgeList;
|
||||||
class IGESSolid_VertexList;
|
class IGESSolid_VertexList;
|
||||||
class TopoDS_Vertex;
|
class TopoDS_Vertex;
|
||||||
@ -43,7 +45,6 @@ class TopoDS_Solid;
|
|||||||
class TopoDS_CompSolid;
|
class TopoDS_CompSolid;
|
||||||
class TopoDS_Compound;
|
class TopoDS_Compound;
|
||||||
|
|
||||||
|
|
||||||
//! provides methods to transfer BRep entity from CASCADE to IGESBRep.
|
//! provides methods to transfer BRep entity from CASCADE to IGESBRep.
|
||||||
class BRepToIGESBRep_Entity : public BRepToIGES_BREntity
|
class BRepToIGESBRep_Entity : public BRepToIGES_BREntity
|
||||||
{
|
{
|
||||||
@ -80,7 +81,9 @@ public:
|
|||||||
|
|
||||||
//! Returns the result of the transfert of any Shape
|
//! Returns the result of the transfert of any Shape
|
||||||
//! If the transfer has failed, this member return a NullEntity.
|
//! 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
|
//! Transfert an Edge entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert an Shell entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert a Solid entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert an CompSolid entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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
|
//! Transfert a Compound entity from TopoDS to IGES
|
||||||
//! If this Entity could not be converted, this member returns a NullEntity.
|
//! 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());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -667,7 +667,7 @@ void BRepTools::Dump(const TopoDS_Shape& Sh, Standard_OStream& S)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools::Write(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;
|
BRepTools_ShapeSet SS;
|
||||||
SS.Add(Sh);
|
SS.Add(Sh);
|
||||||
@ -684,7 +684,7 @@ void BRepTools::Write(const TopoDS_Shape& Sh, Standard_OStream& S,
|
|||||||
void BRepTools::Read(TopoDS_Shape& Sh,
|
void BRepTools::Read(TopoDS_Shape& Sh,
|
||||||
std::istream& S,
|
std::istream& S,
|
||||||
const BRep_Builder& B,
|
const BRep_Builder& B,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
BRepTools_ShapeSet SS(B);
|
BRepTools_ShapeSet SS(B);
|
||||||
SS.Read(S, theProgress);
|
SS.Read(S, theProgress);
|
||||||
@ -698,7 +698,7 @@ void BRepTools::Read(TopoDS_Shape& Sh,
|
|||||||
|
|
||||||
Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
|
Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
|
||||||
const Standard_CString File,
|
const Standard_CString File,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
std::ofstream os;
|
std::ofstream os;
|
||||||
OSD_OpenStream(os, File, std::ios::out);
|
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,
|
Standard_Boolean BRepTools::Read(TopoDS_Shape& Sh,
|
||||||
const Standard_CString File,
|
const Standard_CString File,
|
||||||
const BRep_Builder& B,
|
const BRep_Builder& B,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
std::filebuf fic;
|
std::filebuf fic;
|
||||||
std::istream in(&fic);
|
std::istream in(&fic);
|
||||||
|
@ -27,8 +27,7 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
#include <Standard_CString.hxx>
|
#include <Standard_CString.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
|
||||||
|
|
||||||
class TopoDS_Face;
|
class TopoDS_Face;
|
||||||
class TopoDS_Wire;
|
class TopoDS_Wire;
|
||||||
@ -207,23 +206,22 @@ public:
|
|||||||
|
|
||||||
//! Writes <Sh> on <S> in an ASCII format.
|
//! Writes <Sh> on <S> in an ASCII format.
|
||||||
Standard_EXPORT static void Write (const TopoDS_Shape& Sh, Standard_OStream& S,
|
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>.
|
//! Reads a Shape from <S> in returns it in <Sh>.
|
||||||
//! <B> is used to build the shape.
|
//! <B> is used to build the shape.
|
||||||
Standard_EXPORT static void Read (TopoDS_Shape& Sh, Standard_IStream& S, const BRep_Builder& B,
|
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>.
|
//! Writes <Sh> in <File>.
|
||||||
Standard_EXPORT static Standard_Boolean Write
|
Standard_EXPORT static Standard_Boolean Write (const TopoDS_Shape& Sh, const Standard_CString File,
|
||||||
(const TopoDS_Shape& Sh, const Standard_CString File,
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
|
||||||
|
|
||||||
//! Reads a Shape from <File>, returns it in <Sh>.
|
//! Reads a Shape from <File>, returns it in <Sh>.
|
||||||
//! <B> is used to build the shape.
|
//! <B> is used to build the shape.
|
||||||
Standard_EXPORT static Standard_Boolean Read
|
Standard_EXPORT static Standard_Boolean Read (TopoDS_Shape& Sh, const Standard_CString File,
|
||||||
(TopoDS_Shape& Sh, const Standard_CString File, const BRep_Builder& B,
|
const BRep_Builder& B,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Evals real tolerance of edge <theE>.
|
//! Evals real tolerance of edge <theE>.
|
||||||
//! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
|
//! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
|
||||||
@ -253,8 +251,18 @@ public:
|
|||||||
Standard_EXPORT static void RemoveInternals (TopoDS_Shape& theS,
|
Standard_EXPORT static void RemoveInternals (TopoDS_Shape& theS,
|
||||||
const Standard_Boolean theForce = Standard_False);
|
const Standard_Boolean theForce = Standard_False);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
friend class BRepTools_WireExplorer;
|
friend class BRepTools_WireExplorer;
|
||||||
friend class BRepTools_Modification;
|
friend class BRepTools_Modification;
|
||||||
friend class BRepTools_Modifier;
|
friend class BRepTools_Modifier;
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include <BRepTools_Modification.hxx>
|
#include <BRepTools_Modification.hxx>
|
||||||
#include <BRepTools_Modifier.hxx>
|
#include <BRepTools_Modifier.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
|
||||||
#include <Standard_NoSuchObject.hxx>
|
#include <Standard_NoSuchObject.hxx>
|
||||||
#include <Standard_NullObject.hxx>
|
#include <Standard_NullObject.hxx>
|
||||||
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
||||||
@ -54,7 +53,7 @@
|
|||||||
#include <Standard_NullObject.hxx>
|
#include <Standard_NullObject.hxx>
|
||||||
#include <gp_Trsf.hxx>
|
#include <gp_Trsf.hxx>
|
||||||
#include <BRepTools_TrsfModification.hxx>
|
#include <BRepTools_TrsfModification.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
|
|
||||||
static void SetShapeFlags(const TopoDS_Shape& theInSh, TopoDS_Shape& theOutSh);
|
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;
|
static TopTools_IndexedMapOfShape MapE, MapF;
|
||||||
#endif
|
#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()) {
|
if (myShape.IsNull()) {
|
||||||
throw Standard_NullObject();
|
throw Standard_NullObject();
|
||||||
@ -128,7 +128,7 @@ void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M, const
|
|||||||
#endif
|
#endif
|
||||||
TopTools_DataMapIteratorOfDataMapOfShapeShape theIter(myMap);
|
TopTools_DataMapIteratorOfDataMapOfShapeShape theIter(myMap);
|
||||||
|
|
||||||
Message_ProgressSentry aPSentry(aProgress, "Converting Shape", 0, 2, 1);
|
Message_ProgressScope aPS(theProgress, "Converting Shape", 2);
|
||||||
|
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEF;
|
TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEF;
|
||||||
TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
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);
|
CreateOtherVertices(aMVE, aMEF, M);
|
||||||
|
|
||||||
Standard_Boolean aNewGeom;
|
Standard_Boolean aNewGeom;
|
||||||
Rebuild(myShape, M, aNewGeom, aProgress);
|
Rebuild(myShape, M, aNewGeom, aPS.Next());
|
||||||
|
|
||||||
if (!aPSentry.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
// The processing was broken
|
// The processing was broken
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
aPSentry.Next();
|
|
||||||
|
|
||||||
if (myShape.ShapeType() == TopAbs_FACE) {
|
if (myShape.ShapeType() == TopAbs_FACE) {
|
||||||
if (myShape.Orientation() == TopAbs_REVERSED) {
|
if (myShape.Orientation() == TopAbs_REVERSED) {
|
||||||
myMap(myShape).Reverse();
|
myMap(myShape).Reverse();
|
||||||
@ -242,7 +240,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild
|
|||||||
(const TopoDS_Shape& S,
|
(const TopoDS_Shape& S,
|
||||||
const Handle(BRepTools_Modification)& M,
|
const Handle(BRepTools_Modification)& M,
|
||||||
Standard_Boolean& theNewGeom,
|
Standard_Boolean& theNewGeom,
|
||||||
const Handle(Message_ProgressIndicator)& aProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_Modifier
|
#ifdef DEBUG_Modifier
|
||||||
int iF = MapF.Contains(S) ? MapF.FindIndex(S) : 0;
|
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;
|
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
|
// always call Rebuild
|
||||||
Standard_Boolean isSubNewGeom = Standard_False;
|
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 ;
|
rebuild = subrebuilt || rebuild ;
|
||||||
theNewGeom = theNewGeom || isSubNewGeom;
|
theNewGeom = theNewGeom || isSubNewGeom;
|
||||||
}
|
}
|
||||||
if (!aPSentry.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
// The processing was broken
|
// The processing was broken
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
|
@ -29,17 +29,16 @@
|
|||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
|
|
||||||
#include <Message_ProgressIndicator.hxx>
|
|
||||||
#include <NCollection_DataMap.hxx>
|
#include <NCollection_DataMap.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <TopTools_ShapeMapHasher.hxx>
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
#include <TopLoc_Location.hxx>
|
#include <TopLoc_Location.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_NullObject;
|
class Standard_NullObject;
|
||||||
class Standard_NoSuchObject;
|
class Standard_NoSuchObject;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class BRepTools_Modification;
|
class BRepTools_Modification;
|
||||||
class Message_ProgressIndicator;
|
|
||||||
class Geom_Curve;
|
class Geom_Curve;
|
||||||
class Geom_Surface;
|
class Geom_Surface;
|
||||||
|
|
||||||
@ -64,7 +63,8 @@ public:
|
|||||||
Standard_EXPORT void Init (const TopoDS_Shape& S);
|
Standard_EXPORT void Init (const TopoDS_Shape& S);
|
||||||
|
|
||||||
//! Performs the modifications described by <M>.
|
//! 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
|
//! Returns Standard_True if the modification has
|
||||||
//! been computed successfully.
|
//! been computed successfully.
|
||||||
@ -109,7 +109,7 @@ private:
|
|||||||
Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S,
|
Standard_EXPORT Standard_Boolean Rebuild (const TopoDS_Shape& S,
|
||||||
const Handle(BRepTools_Modification)& M,
|
const Handle(BRepTools_Modification)& M,
|
||||||
Standard_Boolean& theNewGeom,
|
Standard_Boolean& theNewGeom,
|
||||||
const Handle(Message_ProgressIndicator)& aProgress = NULL);
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
Standard_EXPORT void CreateNewVertices(
|
Standard_EXPORT void CreateNewVertices(
|
||||||
const TopTools_IndexedDataMapOfShapeListOfShape& theMVE,
|
const TopTools_IndexedDataMapOfShapeListOfShape& theMVE,
|
||||||
|
@ -39,8 +39,7 @@
|
|||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
#include <BRepTools_ShapeSet.hxx>
|
#include <BRepTools_ShapeSet.hxx>
|
||||||
#include <GeomTools.hxx>
|
#include <GeomTools.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
|
||||||
#include <Poly.hxx>
|
#include <Poly.hxx>
|
||||||
#include <Poly_Polygon2D.hxx>
|
#include <Poly_Polygon2D.hxx>
|
||||||
#include <Poly_Polygon3D.hxx>
|
#include <Poly_Polygon3D.hxx>
|
||||||
@ -246,32 +245,27 @@ void BRepTools_ShapeSet::DumpGeometry (Standard_OStream& OS)const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
|
void BRepTools_ShapeSet::WriteGeometry(Standard_OStream& OS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
|
||||||
{
|
{
|
||||||
//OCC19559
|
// Make nested progress scope for processing geometry
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing geometry", 0, 6, 1);
|
Message_ProgressScope aPS(theProgress, "Geometry", 100);
|
||||||
myCurves2d.Write (OS, theProgress);
|
|
||||||
if (!aPS.More())
|
myCurves2d.Write(OS, aPS.Next(20));
|
||||||
return;
|
if (aPS.UserBreak()) return;
|
||||||
aPS.Next();
|
|
||||||
myCurves.Write (OS, theProgress);
|
myCurves.Write(OS, aPS.Next(20));
|
||||||
if (!aPS.More())
|
if (aPS.UserBreak()) return;
|
||||||
return;
|
|
||||||
aPS.Next();
|
WritePolygon3D(OS, Standard_True, aPS.Next(10));
|
||||||
WritePolygon3D (OS, true, theProgress);
|
if (aPS.UserBreak()) return;
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
WritePolygonOnTriangulation(OS, Standard_True, aPS.Next(10));
|
||||||
aPS.Next();
|
if (aPS.UserBreak()) return;
|
||||||
WritePolygonOnTriangulation (OS, true, theProgress);
|
|
||||||
if (!aPS.More())
|
mySurfaces.Write(OS, aPS.Next(20));
|
||||||
return;
|
if (aPS.UserBreak()) return;
|
||||||
aPS.Next();
|
|
||||||
mySurfaces.Write (OS, theProgress);
|
WriteTriangulation(OS, Standard_True, aPS.Next(20));
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
|
||||||
aPS.Next();
|
|
||||||
WriteTriangulation (OS, true, theProgress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -280,35 +274,27 @@ void BRepTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools_ShapeSet::ReadGeometry (Standard_IStream& IS,
|
void BRepTools_ShapeSet::ReadGeometry(Standard_IStream& IS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator) &theProgress)
|
|
||||||
{
|
{
|
||||||
//OCC19559
|
// Make nested progress scope for processing geometry
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading geometry", 0, 6, 1);
|
Message_ProgressScope aPS(theProgress, "Geometry", 100);
|
||||||
myCurves2d.Read(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
myCurves2d.Read(IS, aPS.Next(20));
|
||||||
return;
|
if (aPS.UserBreak()) return;
|
||||||
aPS.Next();
|
|
||||||
myCurves.Read(IS, theProgress);
|
myCurves.Read(IS, aPS.Next(20));
|
||||||
if (!aPS.More())
|
if (aPS.UserBreak()) return;
|
||||||
return;
|
|
||||||
aPS.Next();
|
ReadPolygon3D(IS, aPS.Next(15));
|
||||||
ReadPolygon3D(IS, theProgress);
|
if (aPS.UserBreak()) return;
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
ReadPolygonOnTriangulation(IS, aPS.Next(15));
|
||||||
aPS.Next();
|
if (aPS.UserBreak()) return;
|
||||||
ReadPolygonOnTriangulation(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
mySurfaces.Read(IS, aPS.Next(15));
|
||||||
return;
|
if (aPS.UserBreak()) return;
|
||||||
aPS.Next();
|
|
||||||
mySurfaces.Read(IS, theProgress);
|
ReadTriangulation(IS, aPS.Next(15));
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
|
||||||
aPS.Next();
|
|
||||||
ReadTriangulation(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
|
||||||
aPS.Next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1170,11 +1156,11 @@ void BRepTools_ShapeSet::Check(const TopAbs_ShapeEnum T,
|
|||||||
|
|
||||||
void BRepTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS,
|
void BRepTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS,
|
||||||
const Standard_Boolean Compact,
|
const Standard_Boolean Compact,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theProgress)const
|
||||||
{
|
{
|
||||||
Standard_Integer i, j, nbpOntri = myNodes.Extent();
|
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)
|
if (Compact)
|
||||||
OS << "PolygonOnTriangulations " << nbpOntri << "\n";
|
OS << "PolygonOnTriangulations " << nbpOntri << "\n";
|
||||||
else {
|
else {
|
||||||
@ -1185,7 +1171,7 @@ void BRepTools_ShapeSet::WritePolygonOnTriangulation (Standard_OStream&
|
|||||||
|
|
||||||
Handle(Poly_PolygonOnTriangulation) Poly;
|
Handle(Poly_PolygonOnTriangulation) Poly;
|
||||||
Handle(TColStd_HArray1OfReal) Param;
|
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));
|
Poly = Handle(Poly_PolygonOnTriangulation)::DownCast(myNodes(i));
|
||||||
const TColStd_Array1OfInteger& Nodes = Poly->Nodes();
|
const TColStd_Array1OfInteger& Nodes = Poly->Nodes();
|
||||||
if (!Compact) {
|
if (!Compact) {
|
||||||
@ -1234,7 +1220,7 @@ void BRepTools_ShapeSet::DumpPolygonOnTriangulation(Standard_OStream& OS)const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS,
|
void BRepTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress)
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
IS >> buffer;
|
IS >> buffer;
|
||||||
@ -1246,8 +1232,8 @@ void BRepTools_ShapeSet::ReadPolygonOnTriangulation (Standard_IStream& IS,
|
|||||||
Handle(Poly_PolygonOnTriangulation) Poly;
|
Handle(Poly_PolygonOnTriangulation) Poly;
|
||||||
IS >> nbpol;
|
IS >> nbpol;
|
||||||
//OCC19559
|
//OCC19559
|
||||||
Message_ProgressSentry PS(theProgress, "Polygons On Triangulation", 0, nbpol, 1);
|
Message_ProgressScope aPS(theProgress, "Polygons On Triangulation", nbpol);
|
||||||
for (i=1; i<=nbpol&& PS.More(); i++, PS.Next()) {
|
for (i=1; i<=nbpol&& aPS.More(); i++, aPS.Next()) {
|
||||||
IS >> nbnodes;
|
IS >> nbnodes;
|
||||||
TColStd_Array1OfInteger Nodes(1, nbnodes);
|
TColStd_Array1OfInteger Nodes(1, nbnodes);
|
||||||
for (j = 1; j <= nbnodes; j++) {
|
for (j = 1; j <= nbnodes; j++) {
|
||||||
@ -1289,11 +1275,11 @@ void BRepTools_ShapeSet::ReadPolygonOnTriangulation (Standard_IStream& IS,
|
|||||||
|
|
||||||
void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS,
|
void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS,
|
||||||
const Standard_Boolean Compact,
|
const Standard_Boolean Compact,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress)const
|
const Message_ProgressRange& theProgress)const
|
||||||
{
|
{
|
||||||
Standard_Integer i, j, nbpol = myPolygons3D.Extent();
|
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)
|
if (Compact)
|
||||||
OS << "Polygon3D " << nbpol << "\n";
|
OS << "Polygon3D " << nbpol << "\n";
|
||||||
@ -1304,7 +1290,7 @@ void BRepTools_ShapeSet::WritePolygon3D (Standard_OStream& OS,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(Poly_Polygon3D) P;
|
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));
|
P = Handle(Poly_Polygon3D)::DownCast(myPolygons3D(i));
|
||||||
if (Compact) {
|
if (Compact) {
|
||||||
OS << P->NbNodes() << " ";
|
OS << P->NbNodes() << " ";
|
||||||
@ -1365,8 +1351,7 @@ void BRepTools_ShapeSet::DumpPolygon3D(Standard_OStream& OS)const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream& IS,
|
void BRepTools_ShapeSet::ReadPolygon3D(Standard_IStream& IS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
// Standard_Integer i, j, p, val, nbpol, nbnodes, hasparameters;
|
// Standard_Integer i, j, p, val, nbpol, nbnodes, hasparameters;
|
||||||
@ -1378,8 +1363,8 @@ void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream&
|
|||||||
Handle(Poly_Polygon3D) P;
|
Handle(Poly_Polygon3D) P;
|
||||||
IS >> nbpol;
|
IS >> nbpol;
|
||||||
//OCC19559
|
//OCC19559
|
||||||
Message_ProgressSentry PS(theProgress, "3D Polygons", 0, nbpol, 1);
|
Message_ProgressScope aPS(theProgress, "3D Polygons", nbpol);
|
||||||
for (i=1; i<=nbpol && PS.More(); i++, PS.Next()) {
|
for (i=1; i<=nbpol && aPS.More(); i++, aPS.Next()) {
|
||||||
IS >> nbnodes;
|
IS >> nbnodes;
|
||||||
IS >> hasparameters;
|
IS >> hasparameters;
|
||||||
TColgp_Array1OfPnt Nodes(1, nbnodes);
|
TColgp_Array1OfPnt Nodes(1, nbnodes);
|
||||||
@ -1412,12 +1397,12 @@ void BRepTools_ShapeSet::ReadPolygon3D (Standard_IStream&
|
|||||||
|
|
||||||
void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
|
void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
|
||||||
const Standard_Boolean Compact,
|
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 i, j, nbNodes, nbtri = myTriangulations.Extent();
|
||||||
Standard_Integer nbTriangles = 0, n1, n2, n3;
|
Standard_Integer nbTriangles = 0, n1, n2, n3;
|
||||||
|
|
||||||
Message_ProgressSentry PS(theProgress, "Triangulations", 0, nbtri, 1);
|
Message_ProgressScope aPS(theProgress, "Triangulations", nbtri);
|
||||||
|
|
||||||
if (Compact)
|
if (Compact)
|
||||||
OS << "Triangulations " << nbtri << "\n";
|
OS << "Triangulations " << nbtri << "\n";
|
||||||
@ -1428,7 +1413,7 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(Poly_Triangulation) T;
|
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));
|
T = Handle(Poly_Triangulation)::DownCast(myTriangulations(i));
|
||||||
if (Compact) {
|
if (Compact) {
|
||||||
@ -1514,8 +1499,7 @@ void BRepTools_ShapeSet::DumpTriangulation(Standard_OStream& OS)const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
|
void BRepTools_ShapeSet::ReadTriangulation(Standard_IStream& IS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator) &theProgress)
|
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
// Standard_Integer i, j, val, nbtri;
|
// Standard_Integer i, j, val, nbtri;
|
||||||
@ -1531,8 +1515,8 @@ void BRepTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
|
|||||||
|
|
||||||
IS >> nbtri;
|
IS >> nbtri;
|
||||||
//OCC19559
|
//OCC19559
|
||||||
Message_ProgressSentry PS(theProgress, "Triangulations", 0, nbtri, 1);
|
Message_ProgressScope aPS(theProgress, "Triangulations", nbtri);
|
||||||
for (i=1; i<=nbtri && PS.More();i++, PS.Next()) {
|
for (i=1; i<=nbtri && aPS.More();i++, aPS.Next()) {
|
||||||
|
|
||||||
IS >> nbNodes >> nbTriangles >> hasUV;
|
IS >> nbNodes >> nbTriangles >> hasUV;
|
||||||
GeomTools::GetReal(IS, d);
|
GeomTools::GetReal(IS, d);
|
||||||
|
@ -67,28 +67,23 @@ public:
|
|||||||
|
|
||||||
//! Writes the geometry of me on the stream <OS> in a
|
//! Writes the geometry of me on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT virtual void WriteGeometry
|
Standard_EXPORT virtual void WriteGeometry (Standard_OStream& OS,
|
||||||
(Standard_OStream& OS,
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) Standard_OVERRIDE;
|
|
||||||
|
|
||||||
//! Reads the geometry of me from the stream <IS>.
|
//! Reads the geometry of me from the stream <IS>.
|
||||||
Standard_EXPORT virtual void ReadGeometry
|
Standard_EXPORT virtual void ReadGeometry (Standard_IStream& IS,
|
||||||
(Standard_IStream& IS,
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) Standard_OVERRIDE;
|
|
||||||
|
|
||||||
//! Dumps the geometry of <S> on the stream <OS>.
|
//! Dumps the geometry of <S> on the stream <OS>.
|
||||||
Standard_EXPORT virtual void DumpGeometry
|
Standard_EXPORT virtual void DumpGeometry (const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
|
||||||
(const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
|
|
||||||
|
|
||||||
//! Writes the geometry of <S> on the stream <OS> in a
|
//! Writes the geometry of <S> on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT virtual void WriteGeometry
|
Standard_EXPORT virtual void WriteGeometry (const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
|
||||||
(const TopoDS_Shape& S, Standard_OStream& OS) const Standard_OVERRIDE;
|
|
||||||
|
|
||||||
//! Reads the geometry of a shape of type <T> from the
|
//! Reads the geometry of a shape of type <T> from the
|
||||||
//! stream <IS> and returns it in <S>.
|
//! stream <IS> and returns it in <S>.
|
||||||
Standard_EXPORT virtual void ReadGeometry
|
Standard_EXPORT virtual void ReadGeometry (const TopAbs_ShapeEnum T, Standard_IStream& IS, TopoDS_Shape& S) Standard_OVERRIDE;
|
||||||
(const TopAbs_ShapeEnum T, Standard_IStream& IS, TopoDS_Shape& S) Standard_OVERRIDE;
|
|
||||||
|
|
||||||
//! Inserts the shape <S2> in the shape <S1>. This
|
//! Inserts the shape <S2> in the shape <S1>. This
|
||||||
//! method must be redefined to use the correct
|
//! method must be redefined to use the correct
|
||||||
@ -99,17 +94,15 @@ public:
|
|||||||
|
|
||||||
//! Reads the 3d polygons of me
|
//! Reads the 3d polygons of me
|
||||||
//! from the stream <IS>.
|
//! from the stream <IS>.
|
||||||
Standard_EXPORT void ReadPolygon3D
|
Standard_EXPORT void ReadPolygon3D (Standard_IStream& IS,
|
||||||
(Standard_IStream& IS,
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
|
||||||
|
|
||||||
//! Writes the 3d polygons
|
//! Writes the 3d polygons
|
||||||
//! on the stream <OS> in a format that can
|
//! on the stream <OS> in a format that can
|
||||||
//! be read back by Read.
|
//! be read back by Read.
|
||||||
Standard_EXPORT void WritePolygon3D
|
Standard_EXPORT void WritePolygon3D (Standard_OStream& OS,
|
||||||
(Standard_OStream& OS,
|
|
||||||
const Standard_Boolean Compact = Standard_True,
|
const Standard_Boolean Compact = Standard_True,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Dumps the 3d polygons
|
//! Dumps the 3d polygons
|
||||||
//! on the stream <OS>.
|
//! on the stream <OS>.
|
||||||
@ -117,17 +110,15 @@ public:
|
|||||||
|
|
||||||
//! Reads the triangulation of me
|
//! Reads the triangulation of me
|
||||||
//! from the stream <IS>.
|
//! from the stream <IS>.
|
||||||
Standard_EXPORT void ReadTriangulation
|
Standard_EXPORT void ReadTriangulation (Standard_IStream& IS,
|
||||||
(Standard_IStream& IS,
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
|
||||||
|
|
||||||
//! Writes the triangulation
|
//! Writes the triangulation
|
||||||
//! on the stream <OS> in a format that can
|
//! on the stream <OS> in a format that can
|
||||||
//! be read back by Read.
|
//! be read back by Read.
|
||||||
Standard_EXPORT void WriteTriangulation
|
Standard_EXPORT void WriteTriangulation (Standard_OStream& OS,
|
||||||
(Standard_OStream& OS,
|
|
||||||
const Standard_Boolean Compact = Standard_True,
|
const Standard_Boolean Compact = Standard_True,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Dumps the triangulation
|
//! Dumps the triangulation
|
||||||
//! on the stream <OS>.
|
//! on the stream <OS>.
|
||||||
@ -135,24 +126,33 @@ public:
|
|||||||
|
|
||||||
//! Reads the polygons on triangulation of me
|
//! Reads the polygons on triangulation of me
|
||||||
//! from the stream <IS>.
|
//! from the stream <IS>.
|
||||||
Standard_EXPORT void ReadPolygonOnTriangulation
|
Standard_EXPORT void ReadPolygonOnTriangulation (Standard_IStream& IS,
|
||||||
(Standard_IStream& IS,
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
|
||||||
|
|
||||||
//! Writes the polygons on triangulation
|
//! Writes the polygons on triangulation
|
||||||
//! on the stream <OS> in a format that can
|
//! on the stream <OS> in a format that can
|
||||||
//! be read back by Read.
|
//! be read back by Read.
|
||||||
Standard_EXPORT void WritePolygonOnTriangulation
|
Standard_EXPORT void WritePolygonOnTriangulation (Standard_OStream& OS,
|
||||||
(Standard_OStream& OS,
|
|
||||||
const Standard_Boolean Compact = Standard_True,
|
const Standard_Boolean Compact = Standard_True,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Dumps the polygons on triangulation
|
//! Dumps the polygons on triangulation
|
||||||
//! on the stream <OS>.
|
//! on the stream <OS>.
|
||||||
Standard_EXPORT void DumpPolygonOnTriangulation (Standard_OStream& OS) const;
|
Standard_EXPORT void DumpPolygonOnTriangulation (Standard_OStream& OS) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BRep_Builder myBuilder;
|
BRep_Builder myBuilder;
|
||||||
GeomTools_SurfaceSet mySurfaces;
|
GeomTools_SurfaceSet mySurfaces;
|
||||||
GeomTools_CurveSet myCurves;
|
GeomTools_CurveSet myCurves;
|
||||||
|
@ -59,7 +59,7 @@ void BinDrivers_DocumentRetrievalDriver::ReadShapeSection
|
|||||||
(BinLDrivers_DocumentSection& /*theSection*/,
|
(BinLDrivers_DocumentSection& /*theSection*/,
|
||||||
Standard_IStream& theIS,
|
Standard_IStream& theIS,
|
||||||
const Standard_Boolean /*isMess*/,
|
const Standard_Boolean /*isMess*/,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
|
|
||||||
{
|
{
|
||||||
// Read Shapes
|
// Read Shapes
|
||||||
@ -70,7 +70,7 @@ void BinDrivers_DocumentRetrievalDriver::ReadShapeSection
|
|||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
|
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
|
||||||
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
|
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
|
||||||
aNamedShapeDriver->ReadShapeSection (theIS, theProgress);
|
aNamedShapeDriver->ReadShapeSection (theIS, theRange);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const& anException) {
|
catch(Standard_Failure const& anException) {
|
||||||
const TCollection_ExtendedString aMethStr
|
const TCollection_ExtendedString aMethStr
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
(BinLDrivers_DocumentSection& theSection,
|
(BinLDrivers_DocumentSection& theSection,
|
||||||
Standard_IStream& theIS,
|
Standard_IStream& theIS,
|
||||||
const Standard_Boolean isMess = Standard_False,
|
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
|
Standard_EXPORT virtual void CheckShapeSection
|
||||||
(const Storage_Position& thePos, Standard_IStream& theIS) Standard_OVERRIDE;
|
(const Storage_Position& thePos, Standard_IStream& theIS) Standard_OVERRIDE;
|
||||||
|
@ -100,7 +100,7 @@ void BinDrivers_DocumentStorageDriver::SetWithTriangles (const Handle(Message_Me
|
|||||||
void BinDrivers_DocumentStorageDriver::WriteShapeSection
|
void BinDrivers_DocumentStorageDriver::WriteShapeSection
|
||||||
(BinLDrivers_DocumentSection& theSection,
|
(BinLDrivers_DocumentSection& theSection,
|
||||||
Standard_OStream& theOS,
|
Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
|
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ void BinDrivers_DocumentStorageDriver::WriteShapeSection
|
|||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
|
Handle(BinMNaming_NamedShapeDriver) aNamedShapeDriver =
|
||||||
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
|
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
|
||||||
aNamedShapeDriver->WriteShapeSection (theOS, theProgress);
|
aNamedShapeDriver->WriteShapeSection (theOS, theRange);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const& anException) {
|
catch(Standard_Failure const& anException) {
|
||||||
TCollection_ExtendedString anErrorStr ("BinDrivers_DocumentStorageDriver, Shape Section :");
|
TCollection_ExtendedString anErrorStr ("BinDrivers_DocumentStorageDriver, Shape Section :");
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
Standard_EXPORT virtual void WriteShapeSection
|
Standard_EXPORT virtual void WriteShapeSection
|
||||||
(BinLDrivers_DocumentSection& theDocSection,
|
(BinLDrivers_DocumentSection& theDocSection,
|
||||||
Standard_OStream& theOS,
|
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.
|
//! Return true if shape should be stored with triangles.
|
||||||
Standard_EXPORT Standard_Boolean IsWithTriangles() const;
|
Standard_EXPORT Standard_Boolean IsWithTriangles() const;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <TDF_Label.hxx>
|
#include <TDF_Label.hxx>
|
||||||
#include <TDocStd_Document.hxx>
|
#include <TDocStd_Document.hxx>
|
||||||
#include <TDocStd_Owner.hxx>
|
#include <TDocStd_Owner.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentRetrievalDriver,PCDM_RetrievalDriver)
|
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentRetrievalDriver,PCDM_RetrievalDriver)
|
||||||
@ -80,7 +80,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read
|
|||||||
(const TCollection_ExtendedString& theFileName,
|
(const TCollection_ExtendedString& theFileName,
|
||||||
const Handle(CDM_Document)& theNewDocument,
|
const Handle(CDM_Document)& theNewDocument,
|
||||||
const Handle(CDM_Application)& theApplication,
|
const Handle(CDM_Application)& theApplication,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
std::ifstream aFileStream;
|
std::ifstream aFileStream;
|
||||||
OSD_OpenStream (aFileStream, theFileName, std::ios::in | std::ios::binary);
|
OSD_OpenStream (aFileStream, theFileName, std::ios::in | std::ios::binary);
|
||||||
@ -90,8 +90,8 @@ void BinLDrivers_DocumentRetrievalDriver::Read
|
|||||||
Handle(Storage_Data) dData;
|
Handle(Storage_Data) dData;
|
||||||
TCollection_ExtendedString aFormat = PCDM_ReadWriter::FileFormat (aFileStream, dData);
|
TCollection_ExtendedString aFormat = PCDM_ReadWriter::FileFormat (aFileStream, dData);
|
||||||
|
|
||||||
Read(aFileStream, dData, theNewDocument, theApplication, theProgress);
|
Read(aFileStream, dData, theNewDocument, theApplication, theRange);
|
||||||
if (!theProgress.IsNull() && theProgress->UserBreak())
|
if (!theRange.More())
|
||||||
{
|
{
|
||||||
myReaderStatus = PCDM_RS_UserBreak;
|
myReaderStatus = PCDM_RS_UserBreak;
|
||||||
return;
|
return;
|
||||||
@ -117,7 +117,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
|||||||
const Handle(Storage_Data)& theStorageData,
|
const Handle(Storage_Data)& theStorageData,
|
||||||
const Handle(CDM_Document)& theDoc,
|
const Handle(CDM_Document)& theDoc,
|
||||||
const Handle(CDM_Application)& theApplication,
|
const Handle(CDM_Application)& theApplication,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
myReaderStatus = PCDM_RS_DriverFailure;
|
myReaderStatus = PCDM_RS_DriverFailure;
|
||||||
myMsgDriver = theApplication -> MessageDriver();
|
myMsgDriver = theApplication -> MessageDriver();
|
||||||
@ -233,7 +233,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
|||||||
Handle(TDF_Data) aData = new TDF_Data();
|
Handle(TDF_Data) aData = new TDF_Data();
|
||||||
std::streampos aDocumentPos = -1;
|
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
|
// 2b. Read the TOC of Sections
|
||||||
if (aFileVer >= 3) {
|
if (aFileVer >= 3) {
|
||||||
@ -259,13 +259,12 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
|||||||
theIStream.seekg ((std::streampos) aCurSection.Offset());
|
theIStream.seekg ((std::streampos) aCurSection.Offset());
|
||||||
if (aCurSection.Name().IsEqual ((Standard_CString)SHAPESECTION_POS))
|
if (aCurSection.Name().IsEqual ((Standard_CString)SHAPESECTION_POS))
|
||||||
{
|
{
|
||||||
ReadShapeSection (aCurSection, theIStream, false, theProgress);
|
ReadShapeSection (aCurSection, theIStream, false, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
myReaderStatus = PCDM_RS_UserBreak;
|
myReaderStatus = PCDM_RS_UserBreak;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aPS.Next();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ReadSection (aCurSection, theDoc, theIStream);
|
ReadSection (aCurSection, theDoc, theIStream);
|
||||||
@ -306,13 +305,12 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
|||||||
CheckShapeSection(aShapeSectionPos, theIStream);
|
CheckShapeSection(aShapeSectionPos, theIStream);
|
||||||
// Read Shapes
|
// Read Shapes
|
||||||
BinLDrivers_DocumentSection aCurSection;
|
BinLDrivers_DocumentSection aCurSection;
|
||||||
ReadShapeSection (aCurSection, theIStream, Standard_False, theProgress);
|
ReadShapeSection (aCurSection, theIStream, Standard_False, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
myReaderStatus = PCDM_RS_UserBreak;
|
myReaderStatus = PCDM_RS_UserBreak;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aPS.Next();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end of reading Sections or shape section
|
} // end of reading Sections or shape section
|
||||||
@ -325,13 +323,13 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
|||||||
theIStream.read ((char*)&aTag, sizeof(Standard_Integer));
|
theIStream.read ((char*)&aTag, sizeof(Standard_Integer));
|
||||||
|
|
||||||
// read sub-tree of the root label
|
// 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())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
myReaderStatus = PCDM_RS_UserBreak;
|
myReaderStatus = PCDM_RS_UserBreak;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aPS.Next();
|
|
||||||
Clear();
|
Clear();
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
@ -369,13 +367,13 @@ void BinLDrivers_DocumentRetrievalDriver::Read (Standard_IStream&
|
|||||||
Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||||
(Standard_IStream& theIS,
|
(Standard_IStream& theIS,
|
||||||
const TDF_Label& theLabel,
|
const TDF_Label& theLabel,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
Standard_Integer nbRead = 0;
|
Standard_Integer nbRead = 0;
|
||||||
TCollection_ExtendedString aMethStr
|
TCollection_ExtendedString aMethStr
|
||||||
("BinLDrivers_DocumentRetrievalDriver: ");
|
("BinLDrivers_DocumentRetrievalDriver: ");
|
||||||
|
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading sub tree", 0, 2, 1, true);
|
Message_ProgressScope aPS(theRange, "Reading sub tree", 2, true);
|
||||||
|
|
||||||
// Read attributes:
|
// Read attributes:
|
||||||
theIS >> myPAtt;
|
theIS >> myPAtt;
|
||||||
@ -464,9 +462,9 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
aPS.Next();
|
|
||||||
// read sub-tree
|
// read sub-tree
|
||||||
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, theProgress);
|
Standard_Integer nbSubRead = ReadSubTree (theIS, aLab, aPS.Next());
|
||||||
// check for error
|
// check for error
|
||||||
if (nbSubRead == -1)
|
if (nbSubRead == -1)
|
||||||
return -1;
|
return -1;
|
||||||
@ -522,7 +520,7 @@ void BinLDrivers_DocumentRetrievalDriver::ReadShapeSection
|
|||||||
(BinLDrivers_DocumentSection& theSection,
|
(BinLDrivers_DocumentSection& theSection,
|
||||||
Standard_IStream& /*theIS*/,
|
Standard_IStream& /*theIS*/,
|
||||||
const Standard_Boolean isMess,
|
const Standard_Boolean isMess,
|
||||||
const Handle(Message_ProgressIndicator) &/*theProgress*/)
|
const Message_ProgressRange &/*theRange*/)
|
||||||
|
|
||||||
{
|
{
|
||||||
if(isMess && theSection.Length()) {
|
if(isMess && theSection.Length()) {
|
||||||
|
@ -62,13 +62,13 @@ public:
|
|||||||
Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName,
|
Standard_EXPORT virtual void Read (const TCollection_ExtendedString& theFileName,
|
||||||
const Handle(CDM_Document)& theNewDocument,
|
const Handle(CDM_Document)& theNewDocument,
|
||||||
const Handle(CDM_Application)& theApplication,
|
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,
|
Standard_EXPORT virtual void Read (Standard_IStream& theIStream,
|
||||||
const Handle(Storage_Data)& theStorageData,
|
const Handle(Storage_Data)& theStorageData,
|
||||||
const Handle(CDM_Document)& theDoc,
|
const Handle(CDM_Document)& theDoc,
|
||||||
const Handle(CDM_Application)& theApplication,
|
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);
|
Standard_EXPORT virtual Handle(BinMDF_ADriverTable) AttributeDrivers (const Handle(Message_Messenger)& theMsgDriver);
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ protected:
|
|||||||
Standard_EXPORT virtual Standard_Integer ReadSubTree
|
Standard_EXPORT virtual Standard_Integer ReadSubTree
|
||||||
(Standard_IStream& theIS,
|
(Standard_IStream& theIS,
|
||||||
const TDF_Label& theData,
|
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.
|
//! define the procedure of reading a section to file.
|
||||||
@ -98,7 +98,7 @@ protected:
|
|||||||
(BinLDrivers_DocumentSection& theSection,
|
(BinLDrivers_DocumentSection& theSection,
|
||||||
Standard_IStream& theIS,
|
Standard_IStream& theIS,
|
||||||
const Standard_Boolean isMess = Standard_False,
|
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.
|
//! checks the shapes section can be correctly retreived.
|
||||||
Standard_EXPORT virtual void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS);
|
Standard_EXPORT virtual void CheckShapeSection (const Storage_Position& thePos, Standard_IStream& theIS);
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <TDF_Label.hxx>
|
#include <TDF_Label.hxx>
|
||||||
#include <TDF_Tool.hxx>
|
#include <TDF_Tool.hxx>
|
||||||
#include <TDocStd_Document.hxx>
|
#include <TDocStd_Document.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
|
IMPLEMENT_STANDARD_RTTIEXT(BinLDrivers_DocumentStorageDriver,PCDM_StorageDriver)
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ BinLDrivers_DocumentStorageDriver::BinLDrivers_DocumentStorageDriver ()
|
|||||||
void BinLDrivers_DocumentStorageDriver::Write
|
void BinLDrivers_DocumentStorageDriver::Write
|
||||||
(const Handle(CDM_Document)& theDocument,
|
(const Handle(CDM_Document)& theDocument,
|
||||||
const TCollection_ExtendedString& theFileName,
|
const TCollection_ExtendedString& theFileName,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
SetIsError(Standard_False);
|
SetIsError(Standard_False);
|
||||||
SetStoreStatus(PCDM_SS_OK);
|
SetStoreStatus(PCDM_SS_OK);
|
||||||
@ -77,7 +77,7 @@ void BinLDrivers_DocumentStorageDriver::Write
|
|||||||
|
|
||||||
if (aFileStream.is_open() && aFileStream.good())
|
if (aFileStream.is_open() && aFileStream.good())
|
||||||
{
|
{
|
||||||
Write(theDocument, aFileStream, theProgress);
|
Write(theDocument, aFileStream, theRange);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ void BinLDrivers_DocumentStorageDriver::Write
|
|||||||
|
|
||||||
void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDoc,
|
void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDoc,
|
||||||
Standard_OStream& theOStream,
|
Standard_OStream& theOStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
myMsgDriver = theDoc->Application()->MessageDriver();
|
myMsgDriver = theDoc->Application()->MessageDriver();
|
||||||
myMapUnsupported.Clear();
|
myMapUnsupported.Clear();
|
||||||
@ -140,26 +140,26 @@ void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDo
|
|||||||
myRelocTable.Clear();
|
myRelocTable.Clear();
|
||||||
myPAtt.Init();
|
myPAtt.Init();
|
||||||
|
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing document", 0, 3, 1);
|
Message_ProgressScope aPS(theRange, "Writing document", 3);
|
||||||
|
|
||||||
// Write Doc structure
|
// Write Doc structure
|
||||||
WriteSubTree (aData->Root(), theOStream, theProgress); // Doc is written
|
WriteSubTree (aData->Root(), theOStream, aPS.Next()); // Doc is written
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
SetIsError(Standard_True);
|
SetIsError(Standard_True);
|
||||||
SetStoreStatus(PCDM_SS_UserBreak);
|
SetStoreStatus(PCDM_SS_UserBreak);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aPS.Next();
|
|
||||||
// 4. Write Shapes section
|
// 4. Write Shapes section
|
||||||
WriteShapeSection (aShapesSection, theOStream, theProgress);
|
WriteShapeSection (aShapesSection, theOStream, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
{
|
{
|
||||||
SetIsError(Standard_True);
|
SetIsError(Standard_True);
|
||||||
SetStoreStatus(PCDM_SS_UserBreak);
|
SetStoreStatus(PCDM_SS_UserBreak);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aPS.Next();
|
|
||||||
// Write application-defined sections
|
// Write application-defined sections
|
||||||
for (anIterS.Init (mySections); anIterS.More(); anIterS.Next()) {
|
for (anIterS.Init (mySections); anIterS.More(); anIterS.Next()) {
|
||||||
BinLDrivers_DocumentSection& aSection = anIterS.ChangeValue();
|
BinLDrivers_DocumentSection& aSection = anIterS.ChangeValue();
|
||||||
@ -230,14 +230,14 @@ void BinLDrivers_DocumentStorageDriver::UnsupportedAttrMsg
|
|||||||
void BinLDrivers_DocumentStorageDriver::WriteSubTree
|
void BinLDrivers_DocumentStorageDriver::WriteSubTree
|
||||||
(const TDF_Label& theLabel,
|
(const TDF_Label& theLabel,
|
||||||
Standard_OStream& theOS,
|
Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
// Skip empty labels
|
// Skip empty labels
|
||||||
if (!myEmptyLabels.IsEmpty() && myEmptyLabels.First() == theLabel) {
|
if (!myEmptyLabels.IsEmpty() && myEmptyLabels.First() == theLabel) {
|
||||||
myEmptyLabels.RemoveFirst();
|
myEmptyLabels.RemoveFirst();
|
||||||
return;
|
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
|
// Write label header: tag
|
||||||
Standard_Integer aTag = theLabel.Tag();
|
Standard_Integer aTag = theLabel.Tag();
|
||||||
#if DO_INVERSE
|
#if DO_INVERSE
|
||||||
@ -298,8 +298,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
|
|||||||
SetStoreStatus(PCDM_SS_UserBreak);
|
SetStoreStatus(PCDM_SS_UserBreak);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
aPS.Next();
|
WriteSubTree (aChildLab, theOS, aPS.Next());
|
||||||
WriteSubTree (aChildLab, theOS, theProgress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the end label marker
|
// Write the end label marker
|
||||||
@ -547,7 +546,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSection
|
|||||||
void BinLDrivers_DocumentStorageDriver::WriteShapeSection
|
void BinLDrivers_DocumentStorageDriver::WriteShapeSection
|
||||||
(BinLDrivers_DocumentSection& theSection,
|
(BinLDrivers_DocumentSection& theSection,
|
||||||
Standard_OStream& theOS,
|
Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& /*theProgress*/)
|
const Message_ProgressRange& /*theRange*/)
|
||||||
{
|
{
|
||||||
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
|
const Standard_Size aShapesSectionOffset = (Standard_Size) theOS.tellp();
|
||||||
theSection.Write (theOS, aShapesSectionOffset);
|
theSection.Write (theOS, aShapesSectionOffset);
|
||||||
|
@ -54,12 +54,12 @@ public:
|
|||||||
//! Write <theDocument> to the binary file <theFileName>
|
//! Write <theDocument> to the binary file <theFileName>
|
||||||
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
|
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
|
||||||
const TCollection_ExtendedString& theFileName,
|
const TCollection_ExtendedString& theFileName,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Write <theDocument> to theOStream
|
//! Write <theDocument> to theOStream
|
||||||
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
|
Standard_EXPORT virtual void Write (const Handle(CDM_Document)& theDocument,
|
||||||
Standard_OStream& theOStream,
|
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);
|
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>
|
//! Write the tree under <theLabel> to the stream <theOS>
|
||||||
Standard_EXPORT void WriteSubTree (const TDF_Label& theData,
|
Standard_EXPORT void WriteSubTree (const TDF_Label& theData,
|
||||||
Standard_OStream& theOS,
|
Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! define the procedure of writing a section to file.
|
//! define the procedure of writing a section to file.
|
||||||
Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName,
|
Standard_EXPORT virtual void WriteSection (const TCollection_AsciiString& theName,
|
||||||
@ -87,7 +87,7 @@ protected:
|
|||||||
//! defines the procedure of writing a shape section to file
|
//! defines the procedure of writing a shape section to file
|
||||||
Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection,
|
Standard_EXPORT virtual void WriteShapeSection (BinLDrivers_DocumentSection& theDocSection,
|
||||||
Standard_OStream& theOS,
|
Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
Handle(BinMDF_ADriverTable) myDrivers;
|
Handle(BinMDF_ADriverTable) myDrivers;
|
||||||
BinObjMgt_SRelocationTable myRelocTable;
|
BinObjMgt_SRelocationTable myRelocTable;
|
||||||
|
@ -277,11 +277,11 @@ void BinMNaming_NamedShapeDriver::Paste (const Handle(TDF_Attribute)& theSource,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinMNaming_NamedShapeDriver::WriteShapeSection (Standard_OStream& theOS,
|
void BinMNaming_NamedShapeDriver::WriteShapeSection (Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
theOS << SHAPESET;
|
theOS << SHAPESET;
|
||||||
myShapeSet.SetFormatNb(myFormatNb);
|
myShapeSet.SetFormatNb(myFormatNb);
|
||||||
myShapeSet.Write (theOS, theProgress);
|
myShapeSet.Write (theOS, theRange);
|
||||||
myShapeSet.Clear();
|
myShapeSet.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ void BinMNaming_NamedShapeDriver::Clear()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS,
|
void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
// check section title string; note that some versions of OCCT (up to 6.3.1)
|
// check section title string; note that some versions of OCCT (up to 6.3.1)
|
||||||
// might avoid writing shape section if it is empty
|
// might avoid writing shape section if it is empty
|
||||||
@ -310,7 +310,7 @@ void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS,
|
|||||||
theIS >> aSectionTitle;
|
theIS >> aSectionTitle;
|
||||||
if(aSectionTitle.Length() > 0 && aSectionTitle == SHAPESET) {
|
if(aSectionTitle.Length() > 0 && aSectionTitle == SHAPESET) {
|
||||||
myShapeSet.Clear();
|
myShapeSet.Clear();
|
||||||
myShapeSet.Read (theIS, theProgress);
|
myShapeSet.Read (theIS, theRange);
|
||||||
SetFormatNb(myShapeSet.FormatNb());
|
SetFormatNb(myShapeSet.FormatNb());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -53,11 +53,11 @@ public:
|
|||||||
|
|
||||||
//! Input the shapes from Bin Document file
|
//! Input the shapes from Bin Document file
|
||||||
Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS,
|
Standard_EXPORT void ReadShapeSection (Standard_IStream& theIS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& therange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Output the shapes into Bin Document file
|
//! Output the shapes into Bin Document file
|
||||||
Standard_EXPORT void WriteShapeSection (Standard_OStream& theOS,
|
Standard_EXPORT void WriteShapeSection (Standard_OStream& theOS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& therange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Clear myShapeSet
|
//! Clear myShapeSet
|
||||||
Standard_EXPORT void Clear();
|
Standard_EXPORT void Clear();
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include <BinTools.hxx>
|
#include <BinTools.hxx>
|
||||||
#include <BinTools_ShapeSet.hxx>
|
#include <BinTools_ShapeSet.hxx>
|
||||||
#include <FSD_FileHeader.hxx>
|
#include <FSD_FileHeader.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
|
||||||
#include <OSD_OpenFile.hxx>
|
#include <OSD_OpenFile.hxx>
|
||||||
#include <Storage_StreamTypeMismatchError.hxx>
|
#include <Storage_StreamTypeMismatchError.hxx>
|
||||||
|
|
||||||
@ -176,12 +175,12 @@ Standard_IStream& BinTools::GetBool(Standard_IStream& IS, Standard_Boolean& aVal
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools::Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
|
void BinTools::Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
BinTools_ShapeSet aShapeSet(Standard_True);
|
BinTools_ShapeSet aShapeSet(Standard_True);
|
||||||
aShapeSet.SetFormatNb (3);
|
aShapeSet.SetFormatNb (3);
|
||||||
aShapeSet.Add (theShape);
|
aShapeSet.Add (theShape);
|
||||||
aShapeSet.Write (theStream, theProgress);
|
aShapeSet.Write (theStream, theRange);
|
||||||
aShapeSet.Write (theShape, theStream);
|
aShapeSet.Write (theShape, theStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,10 +190,10 @@ void BinTools::Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
|
void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
BinTools_ShapeSet aShapeSet(Standard_True);
|
BinTools_ShapeSet aShapeSet(Standard_True);
|
||||||
aShapeSet.Read (theStream, theProgress);
|
aShapeSet.Read (theStream, theRange);
|
||||||
aShapeSet.Read (theShape, theStream, aShapeSet.NbShapes());
|
aShapeSet.Read (theShape, theStream, aShapeSet.NbShapes());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +203,7 @@ void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_CString theFile,
|
Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_CString theFile,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
std::ofstream aStream;
|
std::ofstream aStream;
|
||||||
aStream.precision (15);
|
aStream.precision (15);
|
||||||
@ -212,7 +211,7 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_C
|
|||||||
if (!aStream.good())
|
if (!aStream.good())
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
|
|
||||||
Write (theShape, aStream, theProgress);
|
Write (theShape, aStream, theRange);
|
||||||
aStream.close();
|
aStream.close();
|
||||||
return aStream.good();
|
return aStream.good();
|
||||||
}
|
}
|
||||||
@ -223,7 +222,7 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_C
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString theFile,
|
Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString theFile,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
std::filebuf aBuf;
|
std::filebuf aBuf;
|
||||||
OSD_OpenStream (aBuf, theFile, std::ios::in | std::ios::binary);
|
OSD_OpenStream (aBuf, theFile, std::ios::in | std::ios::binary);
|
||||||
@ -231,6 +230,6 @@ Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
|
|
||||||
Standard_IStream aStream (&aBuf);
|
Standard_IStream aStream (&aBuf);
|
||||||
Read (theShape, aStream, theProgress);
|
Read (theShape, aStream, theRange);
|
||||||
return aStream.good();
|
return aStream.good();
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <Standard_ExtCharacter.hxx>
|
#include <Standard_ExtCharacter.hxx>
|
||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class BinTools_ShapeSet;
|
class BinTools_ShapeSet;
|
||||||
@ -65,21 +65,21 @@ public:
|
|||||||
|
|
||||||
//! Writes <theShape> on <theStream> in binary format.
|
//! Writes <theShape> on <theStream> in binary format.
|
||||||
Standard_EXPORT static void Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
|
Standard_EXPORT static void Write (const TopoDS_Shape& theShape, Standard_OStream& theStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Reads a shape from <theStream> and returns it in <theShape>.
|
//! Reads a shape from <theStream> and returns it in <theShape>.
|
||||||
Standard_EXPORT static void Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
|
Standard_EXPORT static void Read (TopoDS_Shape& theShape, Standard_IStream& theStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Writes <theShape> in <theFile>.
|
//! Writes <theShape> in <theFile>.
|
||||||
Standard_EXPORT static Standard_Boolean Write
|
Standard_EXPORT static Standard_Boolean Write
|
||||||
(const TopoDS_Shape& theShape, const Standard_CString theFile,
|
(const TopoDS_Shape& theShape, const Standard_CString theFile,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Reads a shape from <theFile> and returns it in <theShape>.
|
//! Reads a shape from <theFile> and returns it in <theShape>.
|
||||||
Standard_EXPORT static Standard_Boolean Read
|
Standard_EXPORT static Standard_Boolean Read
|
||||||
(TopoDS_Shape& theShape, const Standard_CString theFile,
|
(TopoDS_Shape& theShape, const Standard_CString theFile,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <TColgp_Array1OfPnt2d.hxx>
|
#include <TColgp_Array1OfPnt2d.hxx>
|
||||||
#include <TColStd_Array1OfInteger.hxx>
|
#include <TColStd_Array1OfInteger.hxx>
|
||||||
#include <TColStd_Array1OfReal.hxx>
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
|
||||||
#define LINE 1
|
#define LINE 1
|
||||||
#define CIRCLE 2
|
#define CIRCLE 2
|
||||||
@ -347,10 +347,10 @@ void BinTools_Curve2dSet::WriteCurve2d(const Handle(Geom2d_Curve)& C,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_Curve2dSet::Write (Standard_OStream& OS,
|
void BinTools_Curve2dSet::Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theRange) const
|
||||||
{
|
{
|
||||||
Standard_Integer i, aNbCurves = myMap.Extent();
|
Standard_Integer i, aNbCurves = myMap.Extent();
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing 2D curves", 0, aNbCurves, 1);
|
Message_ProgressScope aPS(theRange, "Writing 2D curves",aNbCurves);
|
||||||
OS << "Curve2ds "<< aNbCurves << "\n";
|
OS << "Curve2ds "<< aNbCurves << "\n";
|
||||||
for (i = 1; i <= aNbCurves && aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= aNbCurves && aPS.More(); i++, aPS.Next()) {
|
||||||
WriteCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS);
|
WriteCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS);
|
||||||
@ -696,7 +696,7 @@ Standard_IStream& BinTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_Curve2dSet::Read (Standard_IStream& IS,
|
void BinTools_Curve2dSet::Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
|
|
||||||
@ -714,7 +714,7 @@ void BinTools_Curve2dSet::Read (Standard_IStream& IS,
|
|||||||
Handle(Geom2d_Curve) C;
|
Handle(Geom2d_Curve) C;
|
||||||
Standard_Integer i, aNbCurves;
|
Standard_Integer i, aNbCurves;
|
||||||
IS >> aNbCurves;
|
IS >> aNbCurves;
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading curves 2d", 0, aNbCurves, 1);
|
Message_ProgressScope aPS(theRange, "Reading curves 2d", aNbCurves);
|
||||||
IS.get();//remove <lf>
|
IS.get();//remove <lf>
|
||||||
for (i = 1; i <= aNbCurves && aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= aNbCurves && aPS.More(); i++, aPS.Next()) {
|
||||||
BinTools_Curve2dSet::ReadCurve2d(IS,C);
|
BinTools_Curve2dSet::ReadCurve2d(IS,C);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
|
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Geom2d_Curve;
|
class Geom2d_Curve;
|
||||||
@ -61,12 +61,12 @@ public:
|
|||||||
//! Writes the content of me on the stream <OS> in a
|
//! Writes the content of me on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the stream <IS>. me
|
//! Reads the content of me from the stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Dumps the curve on the binary stream, that can be read back.
|
//! Dumps the curve on the binary stream, that can be read back.
|
||||||
Standard_EXPORT static void WriteCurve2d(const Handle(Geom2d_Curve)& C, Standard_OStream& OS);
|
Standard_EXPORT static void WriteCurve2d(const Handle(Geom2d_Curve)& C, Standard_OStream& OS);
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include <TColgp_Array1OfPnt.hxx>
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
#include <TColStd_Array1OfInteger.hxx>
|
#include <TColStd_Array1OfInteger.hxx>
|
||||||
#include <TColStd_Array1OfReal.hxx>
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
|
||||||
#define LINE 1
|
#define LINE 1
|
||||||
#define CIRCLE 2
|
#define CIRCLE 2
|
||||||
@ -360,10 +360,10 @@ void BinTools_CurveSet::WriteCurve(const Handle(Geom_Curve)& C,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_CurveSet::Write (Standard_OStream& OS,
|
void BinTools_CurveSet::Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theRange)const
|
||||||
{
|
{
|
||||||
Standard_Integer i, nbcurv = myMap.Extent();
|
Standard_Integer i, nbcurv = myMap.Extent();
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing curves", 0, nbcurv, 1);
|
Message_ProgressScope aPS(theRange, "Writing curves", nbcurv);
|
||||||
OS << "Curves "<< nbcurv << "\n";
|
OS << "Curves "<< nbcurv << "\n";
|
||||||
for (i = 1; i <= nbcurv &&aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= nbcurv &&aPS.More(); i++, aPS.Next()) {
|
||||||
WriteCurve(Handle(Geom_Curve)::DownCast(myMap(i)),OS);
|
WriteCurve(Handle(Geom_Curve)::DownCast(myMap(i)),OS);
|
||||||
@ -715,7 +715,7 @@ Standard_IStream& BinTools_CurveSet::ReadCurve(Standard_IStream& IS,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_CurveSet::Read (Standard_IStream& IS,
|
void BinTools_CurveSet::Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
IS >> buffer;
|
IS >> buffer;
|
||||||
@ -733,7 +733,7 @@ void BinTools_CurveSet::Read (Standard_IStream& IS,
|
|||||||
Standard_Integer i, nbcurve;
|
Standard_Integer i, nbcurve;
|
||||||
IS >> nbcurve;
|
IS >> nbcurve;
|
||||||
|
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading curves", 0, nbcurve, 1);
|
Message_ProgressScope aPS(theRange, "Reading curves", nbcurve);
|
||||||
|
|
||||||
IS.get();//remove <lf>
|
IS.get();//remove <lf>
|
||||||
for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
|
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Geom_Curve;
|
class Geom_Curve;
|
||||||
@ -58,12 +58,12 @@ public:
|
|||||||
//! Writes the content of me on the stream <OS> in a
|
//! Writes the content of me on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the stream <IS>. me
|
//! Reads the content of me from the stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Dumps the curve on the stream in binary format
|
//! Dumps the curve on the stream in binary format
|
||||||
//! that can be read back.
|
//! that can be read back.
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
//#define MDTV_DEB 1
|
//#define MDTV_DEB 1
|
||||||
@ -296,33 +296,25 @@ void BinTools_ShapeSet::AddGeometry(const TopoDS_Shape& S)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
|
void BinTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theRange)const
|
||||||
{
|
{
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing geometry", 0, 6, 1);
|
Message_ProgressScope aPS(theRange, "Writing geometry", 6);
|
||||||
myCurves2d.Write(OS, theProgress);
|
myCurves2d.Write(OS, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
myCurves.Write(OS, aPS.Next());
|
||||||
myCurves.Write(OS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
WritePolygon3D(OS, aPS.Next());
|
||||||
WritePolygon3D(OS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
WritePolygonOnTriangulation(OS, aPS.Next());
|
||||||
WritePolygonOnTriangulation(OS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
mySurfaces.Write(OS, aPS.Next());
|
||||||
mySurfaces.Write(OS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
WriteTriangulation(OS, aPS.Next());
|
||||||
WriteTriangulation(OS, theProgress);
|
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
|
||||||
aPS.Next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -331,7 +323,7 @@ void BinTools_ShapeSet::WriteGeometry (Standard_OStream& OS,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_ShapeSet::Write (Standard_OStream& OS,
|
void BinTools_ShapeSet::Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theRange)const
|
||||||
{
|
{
|
||||||
|
|
||||||
// write the copyright
|
// write the copyright
|
||||||
@ -352,23 +344,22 @@ void BinTools_ShapeSet::Write (Standard_OStream& OS,
|
|||||||
// write the geometry
|
// write the geometry
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
|
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing geometry", 0, 2, 1);
|
Message_ProgressScope aPS(theRange, "Writing geometry", 2);
|
||||||
|
|
||||||
WriteGeometry(OS, theProgress);
|
WriteGeometry(OS, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
|
||||||
|
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
// write the shapes
|
// write the shapes
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
|
|
||||||
Standard_Integer i, nbShapes = myShapes.Extent();
|
Standard_Integer i, nbShapes = myShapes.Extent();
|
||||||
Message_ProgressSentry aPSinner(theProgress, "Writing shapes", 0, nbShapes, 1);
|
Message_ProgressScope aPSinner(aPS.Next(), "Writing shapes", nbShapes);
|
||||||
OS << "\nTShapes " << nbShapes << "\n";
|
OS << "\nTShapes " << nbShapes << "\n";
|
||||||
|
|
||||||
// subshapes are written first
|
// subshapes are written first
|
||||||
for (i = 1; i <= nbShapes && aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= nbShapes && aPSinner.More(); i++, aPSinner.Next()) {
|
||||||
|
|
||||||
const TopoDS_Shape& S = myShapes(i);
|
const TopoDS_Shape& S = myShapes(i);
|
||||||
|
|
||||||
@ -404,7 +395,7 @@ void BinTools_ShapeSet::Write (Standard_OStream& OS,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_ShapeSet::Read (Standard_IStream& IS,
|
void BinTools_ShapeSet::Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
|
|
||||||
Clear();
|
Clear();
|
||||||
@ -440,11 +431,10 @@ void BinTools_ShapeSet::Read (Standard_IStream& IS,
|
|||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
// read the geometry
|
// read the geometry
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
Message_ProgressSentry aPSouter(theProgress, "Reading", 0, 2, 1);
|
Message_ProgressScope aPSouter(theRange, "Reading", 2);
|
||||||
ReadGeometry(IS, theProgress);
|
ReadGeometry(IS, aPSouter.Next());
|
||||||
if (!aPSouter.More())
|
if (!aPSouter.More())
|
||||||
return;
|
return;
|
||||||
aPSouter.Next();
|
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
// read the shapes
|
// read the shapes
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
@ -460,7 +450,7 @@ void BinTools_ShapeSet::Read (Standard_IStream& IS,
|
|||||||
Standard_Integer nbShapes = 0;
|
Standard_Integer nbShapes = 0;
|
||||||
IS >> nbShapes;
|
IS >> nbShapes;
|
||||||
IS.get();//remove lf
|
IS.get();//remove lf
|
||||||
Message_ProgressSentry aPSinner(theProgress, "Reading Shapes", 0, nbShapes, 1);
|
Message_ProgressScope aPSinner(aPSouter.Next(), "Reading Shapes", nbShapes);
|
||||||
for (int i = 1; i <= nbShapes && aPSinner.More(); i++, aPSinner.Next()) {
|
for (int i = 1; i <= nbShapes && aPSinner.More(); i++, aPSinner.Next()) {
|
||||||
|
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
@ -561,33 +551,25 @@ void BinTools_ShapeSet::Read (TopoDS_Shape& S, Standard_IStream& IS,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_ShapeSet::ReadGeometry (Standard_IStream& IS,
|
void BinTools_ShapeSet::ReadGeometry (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading geomentry", 0, 6, 1);
|
Message_ProgressScope aPS(theRange, "Reading geomentry", 6);
|
||||||
myCurves2d.Read(IS, theProgress);
|
myCurves2d.Read(IS, aPS.Next());
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
myCurves.Read(IS, aPS.Next());
|
||||||
myCurves.Read(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
ReadPolygon3D(IS, aPS.Next());
|
||||||
ReadPolygon3D(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
ReadPolygonOnTriangulation(IS, aPS.Next());
|
||||||
ReadPolygonOnTriangulation(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
mySurfaces.Read(IS, aPS.Next());
|
||||||
mySurfaces.Read(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
if (!aPS.More())
|
||||||
return;
|
return;
|
||||||
aPS.Next();
|
ReadTriangulation(IS, aPS.Next());
|
||||||
ReadTriangulation(IS, theProgress);
|
|
||||||
if (!aPS.More())
|
|
||||||
return;
|
|
||||||
aPS.Next();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1229,14 +1211,14 @@ void BinTools_ShapeSet::AddShapes(TopoDS_Shape& S1,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BinTools_ShapeSet::WritePolygonOnTriangulation
|
void BinTools_ShapeSet::WritePolygonOnTriangulation
|
||||||
(Standard_OStream& OS,
|
(Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress) const
|
const Message_ProgressRange& theRange) const
|
||||||
{
|
{
|
||||||
const Standard_Integer aNbPol = myNodes.Extent();
|
const Standard_Integer aNbPol = myNodes.Extent();
|
||||||
OS << "PolygonOnTriangulations " << aNbPol << "\n";
|
OS << "PolygonOnTriangulations " << aNbPol << "\n";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing polygons on triangulation", 0, aNbPol, 1);
|
Message_ProgressScope aPS(theRange, "Writing polygons on triangulation", aNbPol);
|
||||||
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
||||||
{
|
{
|
||||||
const Handle(Poly_PolygonOnTriangulation)& aPoly = myNodes.FindKey (aPolIter);
|
const Handle(Poly_PolygonOnTriangulation)& aPoly = myNodes.FindKey (aPolIter);
|
||||||
@ -1279,7 +1261,7 @@ void BinTools_ShapeSet::WritePolygonOnTriangulation
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BinTools_ShapeSet::ReadPolygonOnTriangulation
|
void BinTools_ShapeSet::ReadPolygonOnTriangulation
|
||||||
(Standard_IStream& IS,
|
(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
char aHeader[255];
|
char aHeader[255];
|
||||||
IS >> aHeader;
|
IS >> aHeader;
|
||||||
@ -1294,7 +1276,7 @@ void BinTools_ShapeSet::ReadPolygonOnTriangulation
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading Polygones on triangulation", 0, aNbPol, 1);
|
Message_ProgressScope aPS(theRange, "Reading Polygones on triangulation", aNbPol);
|
||||||
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
||||||
{
|
{
|
||||||
Standard_Integer aNbNodes = 0;
|
Standard_Integer aNbNodes = 0;
|
||||||
@ -1337,14 +1319,14 @@ void BinTools_ShapeSet::ReadPolygonOnTriangulation
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BinTools_ShapeSet::WritePolygon3D (Standard_OStream& OS,
|
void BinTools_ShapeSet::WritePolygon3D (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theRange)const
|
||||||
{
|
{
|
||||||
const Standard_Integer aNbPol = myPolygons3D.Extent();
|
const Standard_Integer aNbPol = myPolygons3D.Extent();
|
||||||
OS << "Polygon3D " << aNbPol << "\n";
|
OS << "Polygon3D " << aNbPol << "\n";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing polygons 3D", 0, aNbPol, 1);
|
Message_ProgressScope aPS(theRange, "Writing polygons 3D", aNbPol);
|
||||||
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
||||||
{
|
{
|
||||||
const Handle(Poly_Polygon3D)& aPoly = myPolygons3D.FindKey (aPolIter);
|
const Handle(Poly_Polygon3D)& aPoly = myPolygons3D.FindKey (aPolIter);
|
||||||
@ -1386,7 +1368,7 @@ void BinTools_ShapeSet::WritePolygon3D(Standard_OStream& OS,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BinTools_ShapeSet::ReadPolygon3D (Standard_IStream& IS,
|
void BinTools_ShapeSet::ReadPolygon3D (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
char aHeader[255];
|
char aHeader[255];
|
||||||
IS >> aHeader;
|
IS >> aHeader;
|
||||||
@ -1405,7 +1387,7 @@ void BinTools_ShapeSet::ReadPolygon3D (Standard_IStream& IS,
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading polygones 3D", 0, aNbPol, 1);
|
Message_ProgressScope aPS(theRange, "Reading polygones 3D", aNbPol);
|
||||||
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
for (Standard_Integer aPolIter = 1; aPolIter <= aNbPol && aPS.More(); ++aPolIter, aPS.Next())
|
||||||
{
|
{
|
||||||
Standard_Integer aNbNodes = 0;
|
Standard_Integer aNbNodes = 0;
|
||||||
@ -1452,7 +1434,7 @@ void BinTools_ShapeSet::ReadPolygon3D (Standard_IStream& IS,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BinTools_ShapeSet::WriteTriangulation (Standard_OStream& OS,
|
void BinTools_ShapeSet::WriteTriangulation (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress) const
|
const Message_ProgressRange& theRange) const
|
||||||
{
|
{
|
||||||
const Standard_Integer aNbTriangulations = myTriangulations.Extent();
|
const Standard_Integer aNbTriangulations = myTriangulations.Extent();
|
||||||
OS << "Triangulations " << aNbTriangulations << "\n";
|
OS << "Triangulations " << aNbTriangulations << "\n";
|
||||||
@ -1460,7 +1442,7 @@ void BinTools_ShapeSet::WriteTriangulation (Standard_OStream& OS,
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing triangulation", 0, aNbTriangulations, 1);
|
Message_ProgressScope aPS(theRange, "Writing triangulation", aNbTriangulations);
|
||||||
for (Standard_Integer aTriangulationIter = 1; aTriangulationIter <= aNbTriangulations && aPS.More(); ++aTriangulationIter, aPS.Next())
|
for (Standard_Integer aTriangulationIter = 1; aTriangulationIter <= aNbTriangulations && aPS.More(); ++aTriangulationIter, aPS.Next())
|
||||||
{
|
{
|
||||||
const Handle(Poly_Triangulation)& aTriangulation = myTriangulations.FindKey (aTriangulationIter);
|
const Handle(Poly_Triangulation)& aTriangulation = myTriangulations.FindKey (aTriangulationIter);
|
||||||
@ -1515,7 +1497,7 @@ void BinTools_ShapeSet::WriteTriangulation (Standard_OStream& OS,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BinTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
|
void BinTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
char aHeader[255];
|
char aHeader[255];
|
||||||
IS >> aHeader;
|
IS >> aHeader;
|
||||||
@ -1531,7 +1513,7 @@ void BinTools_ShapeSet::ReadTriangulation (Standard_IStream& IS,
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading triangulation", 0, aNbTriangulations, 1);
|
Message_ProgressScope aPS(theRange, "Reading triangulation", aNbTriangulations);
|
||||||
for (Standard_Integer aTriangulationIter = 1; aTriangulationIter <= aNbTriangulations && aPS.More(); ++aTriangulationIter, aPS.Next())
|
for (Standard_Integer aTriangulationIter = 1; aTriangulationIter <= aNbTriangulations && aPS.More(); ++aTriangulationIter, aPS.Next())
|
||||||
{
|
{
|
||||||
Standard_Integer aNbNodes = 0, aNbTriangles = 0;
|
Standard_Integer aNbNodes = 0, aNbTriangles = 0;
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
//! Write the flags, the subshapes.
|
//! Write the flags, the subshapes.
|
||||||
Standard_EXPORT virtual void Write
|
Standard_EXPORT virtual void Write
|
||||||
(Standard_OStream& OS,
|
(Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the binary stream <IS>. me
|
//! Reads the content of me from the binary stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
//! Reads the flag, the subshapes.
|
//! Reads the flag, the subshapes.
|
||||||
Standard_EXPORT virtual void Read
|
Standard_EXPORT virtual void Read
|
||||||
(Standard_IStream& IS,
|
(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Writes on <OS> the shape <S>. Writes the
|
//! Writes on <OS> the shape <S>. Writes the
|
||||||
//! orientation, the index of the TShape and the index
|
//! orientation, the index of the TShape and the index
|
||||||
@ -128,12 +128,12 @@ public:
|
|||||||
//! binary format that can be read back by Read.
|
//! binary format that can be read back by Read.
|
||||||
Standard_EXPORT virtual void WriteGeometry
|
Standard_EXPORT virtual void WriteGeometry
|
||||||
(Standard_OStream& OS,
|
(Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the geometry of me from the stream <IS>.
|
//! Reads the geometry of me from the stream <IS>.
|
||||||
Standard_EXPORT virtual void ReadGeometry
|
Standard_EXPORT virtual void ReadGeometry
|
||||||
(Standard_IStream& IS,
|
(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Reads from <IS> a shape and returns it in S.
|
//! Reads from <IS> a shape and returns it in S.
|
||||||
//! <NbShapes> is the number of tshapes in the set.
|
//! <NbShapes> is the number of tshapes in the set.
|
||||||
@ -159,40 +159,40 @@ public:
|
|||||||
//! from the stream <IS>.
|
//! from the stream <IS>.
|
||||||
Standard_EXPORT void ReadPolygon3D
|
Standard_EXPORT void ReadPolygon3D
|
||||||
(Standard_IStream& IS,
|
(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Writes the 3d polygons
|
//! Writes the 3d polygons
|
||||||
//! on the stream <OS> in a format that can
|
//! on the stream <OS> in a format that can
|
||||||
//! be read back by Read.
|
//! be read back by Read.
|
||||||
Standard_EXPORT void WritePolygon3D
|
Standard_EXPORT void WritePolygon3D
|
||||||
(Standard_OStream& OS,
|
(Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the triangulation of me
|
//! Reads the triangulation of me
|
||||||
//! from the stream <IS>.
|
//! from the stream <IS>.
|
||||||
Standard_EXPORT void ReadTriangulation
|
Standard_EXPORT void ReadTriangulation
|
||||||
(Standard_IStream& IS,
|
(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Writes the triangulation
|
//! Writes the triangulation
|
||||||
//! on the stream <OS> in a format that can
|
//! on the stream <OS> in a format that can
|
||||||
//! be read back by Read.
|
//! be read back by Read.
|
||||||
Standard_EXPORT void WriteTriangulation
|
Standard_EXPORT void WriteTriangulation
|
||||||
(Standard_OStream& OS,
|
(Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the polygons on triangulation of me
|
//! Reads the polygons on triangulation of me
|
||||||
//! from the stream <IS>.
|
//! from the stream <IS>.
|
||||||
Standard_EXPORT void ReadPolygonOnTriangulation
|
Standard_EXPORT void ReadPolygonOnTriangulation
|
||||||
(Standard_IStream& IS,
|
(Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Writes the polygons on triangulation
|
//! Writes the polygons on triangulation
|
||||||
//! on the stream <OS> in a format that can
|
//! on the stream <OS> in a format that can
|
||||||
//! be read back by Read.
|
//! be read back by Read.
|
||||||
Standard_EXPORT void WritePolygonOnTriangulation
|
Standard_EXPORT void WritePolygonOnTriangulation
|
||||||
(Standard_OStream& OS,
|
(Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <TColStd_Array1OfInteger.hxx>
|
#include <TColStd_Array1OfInteger.hxx>
|
||||||
#include <TColStd_Array1OfReal.hxx>
|
#include <TColStd_Array1OfReal.hxx>
|
||||||
#include <TColStd_Array2OfReal.hxx>
|
#include <TColStd_Array2OfReal.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
|
||||||
#define PLANE 1
|
#define PLANE 1
|
||||||
#define CYLINDER 2
|
#define CYLINDER 2
|
||||||
@ -438,11 +438,11 @@ void BinTools_SurfaceSet::WriteSurface(const Handle(Geom_Surface)& S,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_SurfaceSet::Write (Standard_OStream& OS,
|
void BinTools_SurfaceSet::Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
const Message_ProgressRange& theRange)const
|
||||||
{
|
{
|
||||||
|
|
||||||
Standard_Integer i, nbsurf = myMap.Extent();
|
Standard_Integer i, nbsurf = myMap.Extent();
|
||||||
Message_ProgressSentry aPS(theProgress, "Writing surfases", 0, nbsurf, 1);
|
Message_ProgressScope aPS(theRange, "Writing surfases", nbsurf);
|
||||||
OS << "Surfaces "<< nbsurf << "\n";
|
OS << "Surfaces "<< nbsurf << "\n";
|
||||||
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
||||||
WriteSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS);
|
WriteSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS);
|
||||||
@ -877,7 +877,7 @@ Standard_IStream& BinTools_SurfaceSet::ReadSurface(Standard_IStream& IS,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BinTools_SurfaceSet::Read (Standard_IStream& IS,
|
void BinTools_SurfaceSet::Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
IS >> buffer;
|
IS >> buffer;
|
||||||
@ -894,7 +894,7 @@ void BinTools_SurfaceSet::Read (Standard_IStream& IS,
|
|||||||
Handle(Geom_Surface) S;
|
Handle(Geom_Surface) S;
|
||||||
Standard_Integer i, nbsurf;
|
Standard_Integer i, nbsurf;
|
||||||
IS >> nbsurf;
|
IS >> nbsurf;
|
||||||
Message_ProgressSentry aPS(theProgress, "Reading surfaces", 0, nbsurf, 1);
|
Message_ProgressScope aPS(theRange, "Reading surfaces", nbsurf);
|
||||||
IS.get ();//remove <lf>
|
IS.get ();//remove <lf>
|
||||||
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
||||||
BinTools_SurfaceSet::ReadSurface(IS,S);
|
BinTools_SurfaceSet::ReadSurface(IS,S);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
|
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Geom_Surface;
|
class Geom_Surface;
|
||||||
@ -58,12 +58,12 @@ public:
|
|||||||
//! Writes the content of me on the stream <OS> in
|
//! Writes the content of me on the stream <OS> in
|
||||||
//! binary format that can be read back by Read.
|
//! binary format that can be read back by Read.
|
||||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the stream <IS>. me
|
//! Reads the content of me from the stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
const Message_ProgressRange& therange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Dumps the surface on the stream in binary
|
//! Dumps the surface on the stream in binary
|
||||||
//! format that can be read back.
|
//! format that can be read back.
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include <Standard_NoSuchObject.hxx>
|
#include <Standard_NoSuchObject.hxx>
|
||||||
#include <Standard_ProgramError.hxx>
|
#include <Standard_ProgramError.hxx>
|
||||||
#include <UTL.hxx>
|
#include <UTL.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(CDF_Application,CDM_Application)
|
IMPLEMENT_STANDARD_RTTIEXT(CDF_Application,CDM_Application)
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -88,10 +87,10 @@ void CDF_Application::Close(const Handle(CDM_Document)& aDocument) {
|
|||||||
Handle(CDM_Document) CDF_Application::Retrieve (const TCollection_ExtendedString& aFolder,
|
Handle(CDM_Document) CDF_Application::Retrieve (const TCollection_ExtendedString& aFolder,
|
||||||
const TCollection_ExtendedString& aName,
|
const TCollection_ExtendedString& aName,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
TCollection_ExtendedString nullVersion;
|
TCollection_ExtendedString nullVersion;
|
||||||
return Retrieve(aFolder, aName, nullVersion, UseStorageConfiguration, theProgress);
|
return Retrieve(aFolder, aName, nullVersion, UseStorageConfiguration, theRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -102,7 +101,7 @@ Handle(CDM_Document) CDF_Application::Retrieve (const TCollection_ExtendedStrin
|
|||||||
const TCollection_ExtendedString& aName,
|
const TCollection_ExtendedString& aName,
|
||||||
const TCollection_ExtendedString& aVersion,
|
const TCollection_ExtendedString& aVersion,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
Handle(CDM_MetaData) theMetaData;
|
Handle(CDM_MetaData) theMetaData;
|
||||||
|
|
||||||
@ -113,7 +112,7 @@ Handle(CDM_Document) CDF_Application::Retrieve (const TCollection_ExtendedStrin
|
|||||||
|
|
||||||
CDF_TypeOfActivation theTypeOfActivation=TypeOfActivation(theMetaData);
|
CDF_TypeOfActivation theTypeOfActivation=TypeOfActivation(theMetaData);
|
||||||
Handle(CDM_Document) theDocument = Retrieve(theMetaData, UseStorageConfiguration,
|
Handle(CDM_Document) theDocument = Retrieve(theMetaData, UseStorageConfiguration,
|
||||||
Standard_False, theProgress);
|
Standard_False, theRange);
|
||||||
|
|
||||||
myDirectory->Add(theDocument);
|
myDirectory->Add(theDocument);
|
||||||
Activate(theDocument,theTypeOfActivation);
|
Activate(theDocument,theTypeOfActivation);
|
||||||
@ -211,8 +210,8 @@ Standard_Boolean CDF_Application::SetDefaultFolder(const Standard_ExtString aFol
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(CDM_Document) CDF_Application::Retrieve(const Handle(CDM_MetaData)& aMetaData,
|
Handle(CDM_Document) CDF_Application::Retrieve(const Handle(CDM_MetaData)& aMetaData,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress) {
|
const Message_ProgressRange& theRange) {
|
||||||
return Retrieve(aMetaData, UseStorageConfiguration, Standard_True, theProgress);
|
return Retrieve(aMetaData, UseStorageConfiguration, Standard_True, theRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -222,7 +221,7 @@ Handle(CDM_Document) CDF_Application::Retrieve(const Handle(CDM_MetaData)& aMeta
|
|||||||
Handle(CDM_Document) CDF_Application::Retrieve (const Handle(CDM_MetaData)& aMetaData,
|
Handle(CDM_Document) CDF_Application::Retrieve (const Handle(CDM_MetaData)& aMetaData,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Standard_Boolean IsComponent,
|
const Standard_Boolean IsComponent,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress) {
|
const Message_ProgressRange& theRange) {
|
||||||
|
|
||||||
Handle(CDM_Document) theDocumentToReturn;
|
Handle(CDM_Document) theDocumentToReturn;
|
||||||
myRetrievableStatus = PCDM_RS_DriverFailure;
|
myRetrievableStatus = PCDM_RS_DriverFailure;
|
||||||
@ -275,7 +274,7 @@ Handle(CDM_Document) CDF_Application::Retrieve (const Handle(CDM_MetaData)& aMet
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
theReader->Read (aMetaData->FileName(), theDocument, this, theProgress);
|
theReader->Read (aMetaData->FileName(), theDocument, this, theRange);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure const& anException) {
|
catch (Standard_Failure const& anException) {
|
||||||
myRetrievableStatus = theReader->GetStatus();
|
myRetrievableStatus = theReader->GetStatus();
|
||||||
@ -331,7 +330,7 @@ CDF_TypeOfActivation CDF_Application::TypeOfActivation(const Handle(CDM_MetaData
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(CDM_Document) CDF_Application::Read (Standard_IStream& theIStream,
|
Handle(CDM_Document) CDF_Application::Read (Standard_IStream& theIStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
Handle(CDM_Document) aDoc;
|
Handle(CDM_Document) aDoc;
|
||||||
Handle(Storage_Data) dData;
|
Handle(Storage_Data) dData;
|
||||||
@ -369,7 +368,7 @@ Handle(CDM_Document) CDF_Application::Read (Standard_IStream& theIStream,
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
aReader->Read (theIStream, dData, aDoc, this, theProgress);
|
aReader->Read (theIStream, dData, aDoc, this, theRange);
|
||||||
}
|
}
|
||||||
catch (Standard_Failure const& anException)
|
catch (Standard_Failure const& anException)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
(const TCollection_ExtendedString& aFolder,
|
(const TCollection_ExtendedString& aFolder,
|
||||||
const TCollection_ExtendedString& aName,
|
const TCollection_ExtendedString& aName,
|
||||||
const Standard_Boolean UseStorageConfiguration = Standard_True,
|
const Standard_Boolean UseStorageConfiguration = Standard_True,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! This method retrieves a document from the database.
|
//! This method retrieves a document from the database.
|
||||||
//! If the Document references other documents which have
|
//! If the Document references other documents which have
|
||||||
@ -113,7 +113,7 @@ public:
|
|||||||
const TCollection_ExtendedString& aName,
|
const TCollection_ExtendedString& aName,
|
||||||
const TCollection_ExtendedString& aVersion,
|
const TCollection_ExtendedString& aVersion,
|
||||||
const Standard_Boolean UseStorageConfiguration = Standard_True,
|
const Standard_Boolean UseStorageConfiguration = Standard_True,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
Standard_EXPORT PCDM_ReaderStatus CanRetrieve (const TCollection_ExtendedString& aFolder,
|
Standard_EXPORT PCDM_ReaderStatus CanRetrieve (const TCollection_ExtendedString& aFolder,
|
||||||
const TCollection_ExtendedString& aName);
|
const TCollection_ExtendedString& aName);
|
||||||
@ -129,7 +129,7 @@ public:
|
|||||||
//! the stream should support SEEK fuctionality
|
//! the stream should support SEEK fuctionality
|
||||||
Standard_EXPORT Handle(CDM_Document) Read
|
Standard_EXPORT Handle(CDM_Document) Read
|
||||||
(Standard_IStream& theIStream,
|
(Standard_IStream& theIStream,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! Returns instance of read driver for specified format.
|
//! Returns instance of read driver for specified format.
|
||||||
//!
|
//!
|
||||||
@ -201,13 +201,13 @@ private:
|
|||||||
Standard_EXPORT Handle(CDM_Document) Retrieve
|
Standard_EXPORT Handle(CDM_Document) Retrieve
|
||||||
(const Handle(CDM_MetaData)& aMetaData,
|
(const Handle(CDM_MetaData)& aMetaData,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) Standard_OVERRIDE;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
|
||||||
|
|
||||||
Standard_EXPORT Handle(CDM_Document) Retrieve
|
Standard_EXPORT Handle(CDM_Document) Retrieve
|
||||||
(const Handle(CDM_MetaData)& aMetaData,
|
(const Handle(CDM_MetaData)& aMetaData,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Standard_Boolean IsComponent,
|
const Standard_Boolean IsComponent,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
Standard_EXPORT Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& theMetaData) Standard_OVERRIDE;
|
Standard_EXPORT Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& theMetaData) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
@ -136,12 +136,12 @@ CDF_StoreSetNameStatus CDF_Store::SetName(const Standard_ExtString aName)
|
|||||||
return SetName(theName);
|
return SetName(theName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDF_Store::Realize (const Handle(Message_ProgressIndicator)& theProgress)
|
void CDF_Store::Realize (const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
Standard_ProgramError_Raise_if(!myList->IsConsistent(),"information are missing");
|
Standard_ProgramError_Raise_if(!myList->IsConsistent(),"information are missing");
|
||||||
Handle(CDM_MetaData) m;
|
Handle(CDM_MetaData) m;
|
||||||
myText = "";
|
myText = "";
|
||||||
myStatus = myList->Store(m, myText, theProgress);
|
myStatus = myList->Store(m, myText, theRange);
|
||||||
if(myStatus==PCDM_SS_OK) myPath = m->Path();
|
if(myStatus==PCDM_SS_OK) myPath = m->Path();
|
||||||
}
|
}
|
||||||
Standard_ExtString CDF_Store::Path() const {
|
Standard_ExtString CDF_Store::Path() const {
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <CDF_SubComponentStatus.hxx>
|
#include <CDF_SubComponentStatus.hxx>
|
||||||
#include <TCollection_HExtendedString.hxx>
|
#include <TCollection_HExtendedString.hxx>
|
||||||
|
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class CDF_StoreList;
|
class CDF_StoreList;
|
||||||
class CDM_Document;
|
class CDM_Document;
|
||||||
@ -89,7 +89,7 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT Standard_Boolean SetPreviousVersion (const Standard_ExtString aPreviousVersion);
|
Standard_EXPORT Standard_Boolean SetPreviousVersion (const Standard_ExtString aPreviousVersion);
|
||||||
|
|
||||||
Standard_EXPORT void Realize (const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
Standard_EXPORT void Realize (const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
//! returns the complete path of the created meta-data.
|
//! returns the complete path of the created meta-data.
|
||||||
Standard_EXPORT Standard_ExtString Path() const;
|
Standard_EXPORT Standard_ExtString Path() const;
|
||||||
|
@ -76,7 +76,7 @@ Handle(CDM_Document) CDF_StoreList::Value() const {
|
|||||||
}
|
}
|
||||||
PCDM_StoreStatus CDF_StoreList::Store (Handle(CDM_MetaData)& aMetaData,
|
PCDM_StoreStatus CDF_StoreList::Store (Handle(CDM_MetaData)& aMetaData,
|
||||||
TCollection_ExtendedString& aStatusAssociatedText,
|
TCollection_ExtendedString& aStatusAssociatedText,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
const Message_ProgressRange& theRange)
|
||||||
{
|
{
|
||||||
Handle(CDF_MetaDataDriver) theMetaDataDriver = Handle(CDF_Application)::DownCast((myMainDocument->Application()))->MetaDataDriver();
|
Handle(CDF_MetaDataDriver) theMetaDataDriver = Handle(CDF_Application)::DownCast((myMainDocument->Application()))->MetaDataDriver();
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ PCDM_StoreStatus CDF_StoreList::Store (Handle(CDM_MetaData)& aMetaData,
|
|||||||
}
|
}
|
||||||
TCollection_ExtendedString theName=theMetaDataDriver->BuildFileName(theDocument);
|
TCollection_ExtendedString theName=theMetaDataDriver->BuildFileName(theDocument);
|
||||||
|
|
||||||
aDocumentStorageDriver->Write(theDocument, theName, theProgress);
|
aDocumentStorageDriver->Write(theDocument, theName, theRange);
|
||||||
status = aDocumentStorageDriver->GetStoreStatus();
|
status = aDocumentStorageDriver->GetStoreStatus();
|
||||||
aMetaData = theMetaDataDriver->CreateMetaData(theDocument,theName);
|
aMetaData = theMetaDataDriver->CreateMetaData(theDocument,theName);
|
||||||
theDocument->SetMetaData(aMetaData);
|
theDocument->SetMetaData(aMetaData);
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
//! order of which they had been added.
|
//! order of which they had been added.
|
||||||
Standard_EXPORT PCDM_StoreStatus Store (Handle(CDM_MetaData)& aMetaData,
|
Standard_EXPORT PCDM_StoreStatus Store (Handle(CDM_MetaData)& aMetaData,
|
||||||
TCollection_ExtendedString& aStatusAssociatedText,
|
TCollection_ExtendedString& aStatusAssociatedText,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||||
|
|
||||||
Standard_EXPORT void Init();
|
Standard_EXPORT void Init();
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <TCollection_ExtendedString.hxx>
|
#include <TCollection_ExtendedString.hxx>
|
||||||
#include <CDM_MetaDataLookUpTable.hxx>
|
#include <CDM_MetaDataLookUpTable.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class CDM_Reference;
|
class CDM_Reference;
|
||||||
class CDM_MetaData;
|
class CDM_MetaData;
|
||||||
@ -95,7 +95,7 @@ private:
|
|||||||
Standard_EXPORT virtual Handle(CDM_Document) Retrieve
|
Standard_EXPORT virtual Handle(CDM_Document) Retrieve
|
||||||
(const Handle(CDM_MetaData)& aMetaData,
|
(const Handle(CDM_MetaData)& aMetaData,
|
||||||
const Standard_Boolean UseStorageConfiguration,
|
const Standard_Boolean UseStorageConfiguration,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) = 0;
|
const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
|
||||||
|
|
||||||
//! returns -1 if the metadata has no modification counter.
|
//! returns -1 if the metadata has no modification counter.
|
||||||
Standard_EXPORT virtual Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& aMetaData) = 0;
|
Standard_EXPORT virtual Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& aMetaData) = 0;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <Draw.hxx>
|
#include <Draw.hxx>
|
||||||
#include <Draw_Appli.hxx>
|
#include <Draw_Appli.hxx>
|
||||||
#include <Draw_ProgressIndicator.hxx>
|
#include <Draw_ProgressIndicator.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
#include <Draw_Segment3D.hxx>
|
#include <Draw_Segment3D.hxx>
|
||||||
#include <gp_Ax2.hxx>
|
#include <gp_Ax2.hxx>
|
||||||
#include <GProp.hxx>
|
#include <GProp.hxx>
|
||||||
@ -1340,12 +1341,8 @@ static Standard_Integer XProgress (Draw_Interpretor& di, Standard_Integer argc,
|
|||||||
|
|
||||||
TCollection_AsciiString anArgCase (argv[i]);
|
TCollection_AsciiString anArgCase (argv[i]);
|
||||||
anArgCase.LowerCase();
|
anArgCase.LowerCase();
|
||||||
if (anArgCase == "-tcloutput")
|
if ( argv[i][1] == 't' ) Draw_ProgressIndicator::DefaultTclMode() = turn;
|
||||||
{
|
else if (argv[i][1] == 'c') Draw_ProgressIndicator::DefaultConsoleMode() = turn;
|
||||||
Draw_ProgressIndicator::DefaultTclOutput() = Standard_True;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if ( argv[i][1] == 't' ) Draw_ProgressIndicator::DefaultTextMode() = turn;
|
|
||||||
else if ( argv[i][1] == 'g' ) Draw_ProgressIndicator::DefaultGraphMode() = turn;
|
else if ( argv[i][1] == 'g' ) Draw_ProgressIndicator::DefaultGraphMode() = turn;
|
||||||
else if ( ! strcmp ( argv[i], "-stop" ) && i+1 < argc )
|
else if ( ! strcmp ( argv[i], "-stop" ) && i+1 < argc )
|
||||||
{
|
{
|
||||||
@ -1355,12 +1352,19 @@ static Standard_Integer XProgress (Draw_Interpretor& di, Standard_Integer argc,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
di << "Progress Indicator defaults: text mode is ";
|
di << "Progress Indicator defaults: tcl mode is ";
|
||||||
if ( Draw_ProgressIndicator::DefaultTextMode() ) {
|
if ( Draw_ProgressIndicator::DefaultTclMode() ) {
|
||||||
di<<"ON";
|
di<<"ON";
|
||||||
} else {
|
} else {
|
||||||
di<<"OFF";
|
di<<"OFF";
|
||||||
}
|
}
|
||||||
|
di<<", console mode is ";
|
||||||
|
if (Draw_ProgressIndicator::DefaultConsoleMode()) {
|
||||||
|
di << "ON";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
di << "OFF";
|
||||||
|
}
|
||||||
di << ", graphical mode is ";
|
di << ", graphical mode is ";
|
||||||
if ( Draw_ProgressIndicator::DefaultGraphMode() ) {
|
if ( Draw_ProgressIndicator::DefaultGraphMode() ) {
|
||||||
di<<"ON";
|
di<<"ON";
|
||||||
@ -1507,11 +1511,11 @@ void DBRep::BasicCommands(Draw_Interpretor& theCommands)
|
|||||||
|
|
||||||
// Add command for DRAW-specific ProgressIndicator
|
// Add command for DRAW-specific ProgressIndicator
|
||||||
theCommands.Add ( "XProgress",
|
theCommands.Add ( "XProgress",
|
||||||
"XProgress [+|-t] [+|-g] [-tclOutput]"
|
"XProgress [+|-t] [+|-c] [+|-g]"
|
||||||
"\n\t\t: The options are:"
|
"\n\t\t The options are:"
|
||||||
"\n\t\t: +|-t, +|-g : switch on/off textual and graphical mode of Progress Indicator"
|
"\n\t\t +|-t : switch on/off output to tcl of Progress Indicator"
|
||||||
"\n\t\t: -tclOutput : switch on data output mode in tcl"
|
"\n\t\t +|-c : switch on/off output to cout of Progress Indicator"
|
||||||
"\n\t\t: Allows to control the output form of Progress Indicator",
|
"\n\t\t +|-g : switch on/off graphical mode of Progress Indicator",
|
||||||
XProgress,"DE: General");
|
XProgress,"DE: General");
|
||||||
|
|
||||||
theCommands.Add("binsave", "binsave shape filename\n"
|
theCommands.Add("binsave", "binsave shape filename\n"
|
||||||
@ -1585,8 +1589,9 @@ static void ssave(const Handle(Draw_Drawable3D)&d, std::ostream& OS)
|
|||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
BRepTools_ShapeSet S(B);
|
BRepTools_ShapeSet S(B);
|
||||||
S.Add (N->Shape());
|
S.Add (N->Shape());
|
||||||
S.Write (OS, Draw::GetProgressBar());
|
Handle(Draw_ProgressIndicator) aProgress = Draw::GetProgressBar();
|
||||||
if(!Draw::GetProgressBar().IsNull() && Draw::GetProgressBar()->UserBreak())
|
S.Write(OS, Message_ProgressIndicator::Start(aProgress));
|
||||||
|
if (! aProgress.IsNull() && aProgress->UserBreak())
|
||||||
return;
|
return;
|
||||||
S.Write(N->Shape(),OS);
|
S.Write(N->Shape(),OS);
|
||||||
}
|
}
|
||||||
@ -1595,9 +1600,10 @@ static Handle(Draw_Drawable3D) srestore (std::istream& IS)
|
|||||||
{
|
{
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
BRepTools_ShapeSet S(B);
|
BRepTools_ShapeSet S(B);
|
||||||
S.Read (IS, Draw::GetProgressBar());
|
Handle(Draw_ProgressIndicator) aProgress = Draw::GetProgressBar();
|
||||||
|
S.Read(IS, Message_ProgressIndicator::Start(aProgress));
|
||||||
Handle(DBRep_DrawableShape) N;
|
Handle(DBRep_DrawableShape) N;
|
||||||
if(!Draw::GetProgressBar().IsNull() && Draw::GetProgressBar()->UserBreak())
|
if (! aProgress.IsNull() && aProgress->UserBreak())
|
||||||
return N;
|
return N;
|
||||||
TopoDS_Shape theShape;
|
TopoDS_Shape theShape;
|
||||||
S.Read(theShape,IS );
|
S.Read(theShape,IS );
|
||||||
|
@ -158,11 +158,11 @@ static Standard_Integer DDocStd_Open (Draw_Interpretor& di,
|
|||||||
std::ifstream aFileStream;
|
std::ifstream aFileStream;
|
||||||
OSD_OpenStream (aFileStream, path, std::ios::in | std::ios::binary);
|
OSD_OpenStream (aFileStream, path, std::ios::in | std::ios::binary);
|
||||||
|
|
||||||
theStatus = A->Open (aFileStream, D, aProgress);
|
theStatus = A->Open (aFileStream, D, aProgress->Start());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
theStatus = A->Open (path, D, aProgress);
|
theStatus = A->Open (path, D, aProgress->Start());
|
||||||
}
|
}
|
||||||
if (theStatus == PCDM_RS_OK && !D.IsNull())
|
if (theStatus == PCDM_RS_OK && !D.IsNull())
|
||||||
{
|
{
|
||||||
@ -230,7 +230,7 @@ static Standard_Integer DDocStd_Save (Draw_Interpretor& di,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||||
A->Save (D, aProgress);
|
A->Save (D, aProgress->Start());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
di << "DDocStd_Save : Error\n";
|
di << "DDocStd_Save : Error\n";
|
||||||
@ -272,11 +272,11 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
|||||||
{
|
{
|
||||||
std::ofstream aFileStream;
|
std::ofstream aFileStream;
|
||||||
OSD_OpenStream (aFileStream, path, std::ios::out | std::ios::binary);
|
OSD_OpenStream (aFileStream, path, std::ios::out | std::ios::binary);
|
||||||
theStatus = A->SaveAs (D, aFileStream, aProgress);
|
theStatus = A->SaveAs (D, aFileStream, aProgress->Start());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
theStatus = A->SaveAs(D,path, aProgress);
|
theStatus = A->SaveAs(D,path, aProgress->Start());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theStatus != PCDM_SS_OK ) {
|
if (theStatus != PCDM_SS_OK ) {
|
||||||
|
@ -74,7 +74,7 @@ std::filebuf Draw_Spyfile;
|
|||||||
|
|
||||||
static std::ostream spystream(&Draw_Spyfile);
|
static std::ostream spystream(&Draw_Spyfile);
|
||||||
|
|
||||||
static Handle(Draw_ProgressIndicator) PInd = NULL;
|
static Handle(Draw_ProgressIndicator) global_Progress = NULL;
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean Draw_Interprete(const char* command);
|
Standard_EXPORT Standard_Boolean Draw_Interprete(const char* command);
|
||||||
// true if complete command
|
// true if complete command
|
||||||
@ -240,14 +240,14 @@ Draw_Interpretor& Draw::GetInterpretor()
|
|||||||
//function :
|
//function :
|
||||||
//purpose : Set/Get Progress Indicator
|
//purpose : Set/Get Progress Indicator
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void Draw::SetProgressBar(const Handle(Draw_ProgressIndicator)& thePI)
|
void Draw::SetProgressBar(const Handle(Draw_ProgressIndicator)& theProgress)
|
||||||
{
|
{
|
||||||
PInd = thePI;
|
global_Progress = theProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Draw_ProgressIndicator) Draw::GetProgressBar()
|
Handle(Draw_ProgressIndicator) Draw::GetProgressBar()
|
||||||
{
|
{
|
||||||
return PInd;
|
return global_Progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
@ -188,7 +188,7 @@ public:
|
|||||||
Standard_EXPORT static void Repaint();
|
Standard_EXPORT static void Repaint();
|
||||||
|
|
||||||
//! sets progress indicator
|
//! sets progress indicator
|
||||||
Standard_EXPORT static void SetProgressBar (const Handle(Draw_ProgressIndicator)& thePI);
|
Standard_EXPORT static void SetProgressBar (const Handle(Draw_ProgressIndicator)& theProgress);
|
||||||
|
|
||||||
//! gets progress indicator
|
//! gets progress indicator
|
||||||
Standard_EXPORT static Handle(Draw_ProgressIndicator) GetProgressBar();
|
Standard_EXPORT static Handle(Draw_ProgressIndicator) GetProgressBar();
|
||||||
|
@ -17,8 +17,12 @@
|
|||||||
#include <Draw_ProgressIndicator.hxx>
|
#include <Draw_ProgressIndicator.hxx>
|
||||||
#include <Message.hxx>
|
#include <Message.hxx>
|
||||||
#include <Message_Messenger.hxx>
|
#include <Message_Messenger.hxx>
|
||||||
#include <Message_ProgressScale.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
#include <NCollection_List.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
#include <OSD.hxx>
|
||||||
|
#include <OSD_Exception_CTRL_BREAK.hxx>
|
||||||
|
#include <OSD_Thread.hxx>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -29,15 +33,16 @@ IMPLEMENT_STANDARD_RTTIEXT(Draw_ProgressIndicator,Message_ProgressIndicator)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Draw_ProgressIndicator::Draw_ProgressIndicator (const Draw_Interpretor &di, Standard_Real theUpdateThreshold)
|
Draw_ProgressIndicator::Draw_ProgressIndicator (const Draw_Interpretor &di, Standard_Real theUpdateThreshold)
|
||||||
: myTextMode ( DefaultTextMode() ),
|
: myTclMode ( DefaultTclMode() ),
|
||||||
|
myConsoleMode ( DefaultConsoleMode() ),
|
||||||
myGraphMode ( DefaultGraphMode() ),
|
myGraphMode ( DefaultGraphMode() ),
|
||||||
myTclOutput ( DefaultTclOutput() ),
|
|
||||||
myDraw ( (Draw_Interpretor*)&di ),
|
myDraw ( (Draw_Interpretor*)&di ),
|
||||||
myShown ( Standard_False ),
|
myShown ( Standard_False ),
|
||||||
myBreak ( Standard_False ),
|
myBreak ( Standard_False ),
|
||||||
myUpdateThreshold ( 0.01 * theUpdateThreshold ),
|
myUpdateThreshold ( 0.01 * theUpdateThreshold ),
|
||||||
myLastPosition ( -1. ),
|
myLastPosition ( -1. ),
|
||||||
myStartTime ( 0 )
|
myStartTime ( 0 ),
|
||||||
|
myGuiThreadId (OSD_Thread::Current())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,23 +78,27 @@ void Draw_ProgressIndicator::Reset()
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
|
void Draw_ProgressIndicator::Show (const Message_ProgressScope& theScope, const Standard_Boolean force)
|
||||||
{
|
{
|
||||||
if ( ! myGraphMode && ! myTextMode )
|
if (!myGraphMode && !myTclMode && !myConsoleMode)
|
||||||
return Standard_False;
|
return;
|
||||||
|
|
||||||
// remember time of the first call to Show as process start time
|
// remember time of the first call to Show as process start time
|
||||||
|
if ( ! myStartTime )
|
||||||
|
{
|
||||||
if (!myStartTime)
|
if (!myStartTime)
|
||||||
{
|
{
|
||||||
time_t aTimeT;
|
time_t aTimeT;
|
||||||
time(&aTimeT);
|
time(&aTimeT);
|
||||||
myStartTime = (Standard_Size)aTimeT;
|
myStartTime = (Standard_Size)aTimeT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// unless show is forced, show updated state only if at least 1% progress has been reached since the last update
|
// unless show is forced, show updated state only if at least 1% progress has been reached since the last update
|
||||||
Standard_Real aPosition = GetPosition();
|
Standard_Real aPosition = GetPosition();
|
||||||
if ( ! force && aPosition < 1. && Abs (aPosition - myLastPosition) < myUpdateThreshold)
|
if ( ! force && aPosition < 1. && Abs (aPosition - myLastPosition) < myUpdateThreshold)
|
||||||
return Standard_False; // return if update interval has not elapsed
|
return; // return if update interval has not elapsed
|
||||||
|
|
||||||
myLastPosition = aPosition;
|
myLastPosition = aPosition;
|
||||||
|
|
||||||
// Prepare textual progress info
|
// Prepare textual progress info
|
||||||
@ -97,17 +106,19 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
|
|||||||
aText.setf (std::ios::fixed, std:: ios::floatfield);
|
aText.setf (std::ios::fixed, std:: ios::floatfield);
|
||||||
aText.precision(0);
|
aText.precision(0);
|
||||||
aText << "Progress: " << 100. * GetPosition() << "%";
|
aText << "Progress: " << 100. * GetPosition() << "%";
|
||||||
for ( Standard_Integer i=GetNbScopes(); i >=1; i-- ) {
|
NCollection_List<const Message_ProgressScope*> aScopes;
|
||||||
const Message_ProgressScale &scale = GetScope ( i );
|
for (const Message_ProgressScope* aPS = &theScope; aPS; aPS = aPS->Parent())
|
||||||
if ( scale.GetName().IsNull() ) continue; // skip unnamed scopes
|
aScopes.Prepend(aPS);
|
||||||
aText << " " << scale.GetName()->ToCString() << ": ";
|
for (NCollection_List<const Message_ProgressScope*>::Iterator it(aScopes); it.More(); it.Next())
|
||||||
|
{
|
||||||
// if scope has subscopes, print end of subscope as it s current position
|
const Message_ProgressScope* aPS = it.Value();
|
||||||
Standard_Real locPos = ( (i >1 && GetPosition()!=0) ? GetScope ( i-1 ).GetLast() : GetPosition() );
|
if (!aPS->Name()) continue; // skip unnamed scopes
|
||||||
// print progress info differently for finite and infinite scopes
|
aText << " " << aPS->Name() << ": ";
|
||||||
if ( scale.GetInfinite() )
|
|
||||||
|
// print progress info differently for finite and infinite scopes
|
||||||
|
Standard_Real aVal = aPS->Value();
|
||||||
|
if (aPS->IsInfinite())
|
||||||
{
|
{
|
||||||
Standard_Real aVal = scale.BaseToLocal(locPos);
|
|
||||||
if (Precision::IsInfinite(aVal))
|
if (Precision::IsInfinite(aVal))
|
||||||
{
|
{
|
||||||
aText << "finished";
|
aText << "finished";
|
||||||
@ -119,13 +130,14 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aText << scale.BaseToLocal ( locPos ) << " / " << scale.GetMax();
|
aText << aVal << " / " << aPS->MaxValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show graphic progress bar
|
// Show graphic progress bar.
|
||||||
if ( myGraphMode ) {
|
// It will be updated only within GUI thread.
|
||||||
|
if (myGraphMode && myGuiThreadId == OSD_Thread::Current())
|
||||||
|
{
|
||||||
// In addition, write elapsed/estimated/remaining time
|
// In addition, write elapsed/estimated/remaining time
|
||||||
if ( GetPosition() > 0.01 ) {
|
if ( GetPosition() > 0.01 ) {
|
||||||
time_t aTimeT;
|
time_t aTimeT;
|
||||||
@ -153,26 +165,22 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
|
|||||||
aCommand.setf(std::ios::fixed, std::ios::floatfield);
|
aCommand.setf(std::ios::fixed, std::ios::floatfield);
|
||||||
aCommand.precision(0);
|
aCommand.precision(0);
|
||||||
aCommand << ".xprogress.bar coords progress 2 2 " << (1 + 400 * GetPosition()) << " 21;";
|
aCommand << ".xprogress.bar coords progress 2 2 " << (1 + 400 * GetPosition()) << " 21;";
|
||||||
aCommand << ".xprogress.bar coords progress_next 2 2 " << (1 + 400 * GetScope(1).GetLast()) << " 21;";
|
aCommand << ".xprogress.bar coords progress_next 2 2 " << (1 + 400 * theScope.GetPortion()) << " 21;";
|
||||||
aCommand << ".xprogress.text configure -text \"" << aText.str() << "\";";
|
aCommand << ".xprogress.text configure -text \"" << aText.str() << "\";";
|
||||||
aCommand << "update";
|
aCommand << "update";
|
||||||
myDraw->Eval (aCommand.str().c_str());
|
myDraw->Eval (aCommand.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print textual progress info
|
// Print textual progress info
|
||||||
if (myTextMode)
|
if (myTclMode && myDraw)
|
||||||
{
|
|
||||||
if (myTclOutput && myDraw)
|
|
||||||
{
|
{
|
||||||
*myDraw << aText.str().c_str() << "\n";
|
*myDraw << aText.str().c_str() << "\n";
|
||||||
}
|
}
|
||||||
else
|
if (myConsoleMode)
|
||||||
{
|
{
|
||||||
std::cout << aText.str().c_str() << "\n";
|
std::cout << aText.str().c_str() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UserBreak
|
//function : UserBreak
|
||||||
@ -181,32 +189,65 @@ Standard_Boolean Draw_ProgressIndicator::Show(const Standard_Boolean force)
|
|||||||
|
|
||||||
Standard_Boolean Draw_ProgressIndicator::UserBreak()
|
Standard_Boolean Draw_ProgressIndicator::UserBreak()
|
||||||
{
|
{
|
||||||
if ( StopIndicator() == this ) {
|
if ( StopIndicator() == this )
|
||||||
|
{
|
||||||
// std::cout << "Progress Indicator - User Break: " << StopIndicator() << ", " << (void*)this << std::endl;
|
// std::cout << "Progress Indicator - User Break: " << StopIndicator() << ", " << (void*)this << std::endl;
|
||||||
myBreak = Standard_True;
|
myBreak = Standard_True;
|
||||||
myDraw->Eval ( "XProgress -stop 0" );
|
myDraw->Eval ( "XProgress -stop 0" );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// treatment of Ctrl-Break signal
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OSD::ControlBreak();
|
||||||
|
}
|
||||||
|
catch (OSD_Exception_CTRL_BREAK)
|
||||||
|
{
|
||||||
|
myBreak = Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
return myBreak;
|
return myBreak;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetTextMode
|
//function : SetTclMode
|
||||||
//purpose : Sets text output mode (on/off)
|
//purpose : Sets Tcl output mode (on/off)
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Draw_ProgressIndicator::SetTextMode(const Standard_Boolean theTextMode)
|
void Draw_ProgressIndicator::SetTclMode(const Standard_Boolean theTclMode)
|
||||||
{
|
{
|
||||||
myTextMode = theTextMode;
|
myTclMode = theTclMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : GetTextMode
|
//function : GetTclMode
|
||||||
//purpose : Returns text output mode (on/off)
|
//purpose : Returns Tcl output mode (on/off)
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean Draw_ProgressIndicator::GetTextMode() const
|
Standard_Boolean Draw_ProgressIndicator::GetTclMode() const
|
||||||
{
|
{
|
||||||
return myTextMode;
|
return myTclMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetConsoleMode
|
||||||
|
//purpose : Sets Console output mode (on/off)
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void Draw_ProgressIndicator::SetConsoleMode(const Standard_Boolean theMode)
|
||||||
|
{
|
||||||
|
myConsoleMode = theMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GetConsoleMode
|
||||||
|
//purpose : Returns Console output mode (on/off)
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
Standard_Boolean Draw_ProgressIndicator::GetConsoleMode() const
|
||||||
|
{
|
||||||
|
return myConsoleMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -230,14 +271,25 @@ Standard_Boolean Draw_ProgressIndicator::GetGraphMode() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : DefaultTextMode
|
//function : DefaultTclMode
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean &Draw_ProgressIndicator::DefaultTextMode()
|
Standard_Boolean &Draw_ProgressIndicator::DefaultTclMode()
|
||||||
{
|
{
|
||||||
static Standard_Boolean defTextMode = Standard_False;
|
static Standard_Boolean defTclMode = Standard_False;
|
||||||
return defTextMode;
|
return defTclMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : DefaultConsoleMode
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
Standard_Boolean &Draw_ProgressIndicator::DefaultConsoleMode()
|
||||||
|
{
|
||||||
|
static Standard_Boolean defConsoleMode = Standard_False;
|
||||||
|
return defConsoleMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -251,17 +303,6 @@ Standard_Boolean &Draw_ProgressIndicator::DefaultGraphMode()
|
|||||||
return defGraphMode;
|
return defGraphMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : DefaultTclOutput
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
Standard_Boolean &Draw_ProgressIndicator::DefaultTclOutput()
|
|
||||||
{
|
|
||||||
static Standard_Boolean defTclOutput = Standard_False;
|
|
||||||
return defTclOutput;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : StopIndicator
|
//function : StopIndicator
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -43,11 +43,18 @@ public:
|
|||||||
//! Destructor; calls Reset()
|
//! Destructor; calls Reset()
|
||||||
Standard_EXPORT ~Draw_ProgressIndicator();
|
Standard_EXPORT ~Draw_ProgressIndicator();
|
||||||
|
|
||||||
//! Sets text output mode (on/off)
|
//! Sets tcl output mode (on/off).
|
||||||
Standard_EXPORT void SetTextMode (const Standard_Boolean theTextMode);
|
Standard_EXPORT void SetTclMode (const Standard_Boolean theTclMode);
|
||||||
|
|
||||||
//! Gets text output mode (on/off)
|
//! Gets tcl output mode (on/off).
|
||||||
Standard_EXPORT Standard_Boolean GetTextMode() const;
|
Standard_EXPORT Standard_Boolean GetTclMode() const;
|
||||||
|
|
||||||
|
//! Sets console output mode (on/off).
|
||||||
|
//! If it is on then progress is shown in the standard output.
|
||||||
|
Standard_EXPORT void SetConsoleMode(const Standard_Boolean theMode);
|
||||||
|
|
||||||
|
//! Gets console output mode (on/off)
|
||||||
|
Standard_EXPORT Standard_Boolean GetConsoleMode() const;
|
||||||
|
|
||||||
//! Sets graphical output mode (on/off)
|
//! Sets graphical output mode (on/off)
|
||||||
Standard_EXPORT void SetGraphMode (const Standard_Boolean theGraphMode);
|
Standard_EXPORT void SetGraphMode (const Standard_Boolean theGraphMode);
|
||||||
@ -55,30 +62,26 @@ public:
|
|||||||
//! Gets graphical output mode (on/off)
|
//! Gets graphical output mode (on/off)
|
||||||
Standard_EXPORT Standard_Boolean GetGraphMode() const;
|
Standard_EXPORT Standard_Boolean GetGraphMode() const;
|
||||||
|
|
||||||
//! Sets tcl output mode (on/off)
|
|
||||||
void SetTclOutput (const Standard_Boolean theTclOutput) { myTclOutput = theTclOutput; }
|
|
||||||
|
|
||||||
//! Gets tcl output mode (on/off)
|
|
||||||
Standard_Boolean GetTclOutput() const { return myTclOutput; }
|
|
||||||
|
|
||||||
//! Clears/erases opened TCL windows if any
|
//! Clears/erases opened TCL windows if any
|
||||||
//! and sets myBreak to False
|
//! and sets myBreak to False
|
||||||
Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
|
Standard_EXPORT virtual void Reset() Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Defines method Show of Progress Indicator
|
//! Defines method Show of Progress Indicator
|
||||||
Standard_EXPORT virtual Standard_Boolean Show (const Standard_Boolean force = Standard_True) Standard_OVERRIDE;
|
Standard_EXPORT virtual void Show (const Message_ProgressScope& theScope,
|
||||||
|
const Standard_Boolean force = Standard_True) Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Redefines method UserBreak of Progress Indicator
|
//! Redefines method UserBreak of Progress Indicator
|
||||||
Standard_EXPORT virtual Standard_Boolean UserBreak() Standard_OVERRIDE;
|
Standard_EXPORT virtual Standard_Boolean UserBreak() Standard_OVERRIDE;
|
||||||
|
|
||||||
Standard_EXPORT static Standard_Boolean& DefaultTextMode();
|
//! Get/Set default value for tcl mode
|
||||||
|
Standard_EXPORT static Standard_Boolean& DefaultTclMode();
|
||||||
|
|
||||||
//! Get/Set default values for output modes
|
//! Get/Set default value for console mode
|
||||||
|
Standard_EXPORT static Standard_Boolean& DefaultConsoleMode();
|
||||||
|
|
||||||
|
//! Get/Set default value for graph mode
|
||||||
Standard_EXPORT static Standard_Boolean& DefaultGraphMode();
|
Standard_EXPORT static Standard_Boolean& DefaultGraphMode();
|
||||||
|
|
||||||
//! Get/Set default values for tcl output mode
|
|
||||||
Standard_EXPORT static Standard_Boolean& DefaultTclOutput();
|
|
||||||
|
|
||||||
//! Internal method for implementation of UserBreak mechanism;
|
//! Internal method for implementation of UserBreak mechanism;
|
||||||
//! note that it uses static variable and thus not thread-safe!
|
//! note that it uses static variable and thus not thread-safe!
|
||||||
Standard_EXPORT static Standard_Address& StopIndicator();
|
Standard_EXPORT static Standard_Address& StopIndicator();
|
||||||
@ -86,15 +89,16 @@ public:
|
|||||||
DEFINE_STANDARD_RTTIEXT(Draw_ProgressIndicator,Message_ProgressIndicator)
|
DEFINE_STANDARD_RTTIEXT(Draw_ProgressIndicator,Message_ProgressIndicator)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Standard_Boolean myTextMode;
|
Standard_Boolean myTclMode;
|
||||||
|
Standard_Boolean myConsoleMode;
|
||||||
Standard_Boolean myGraphMode;
|
Standard_Boolean myGraphMode;
|
||||||
Standard_Boolean myTclOutput;
|
|
||||||
Draw_Interpretor* myDraw;
|
Draw_Interpretor* myDraw;
|
||||||
Standard_Boolean myShown;
|
Standard_Boolean myShown;
|
||||||
Standard_Boolean myBreak;
|
Standard_Boolean myBreak;
|
||||||
Standard_Real myUpdateThreshold;
|
Standard_Real myUpdateThreshold;
|
||||||
Standard_Real myLastPosition;
|
Standard_Real myLastPosition;
|
||||||
Standard_Size myStartTime;
|
Standard_Size myStartTime;
|
||||||
|
Standard_ThreadId myGuiThreadId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _Draw_ProgressIndicator_HeaderFile
|
#endif // _Draw_ProgressIndicator_HeaderFile
|
||||||
|
@ -157,9 +157,6 @@ static Standard_Integer save(Draw_Interpretor& di, Standard_Integer n, const cha
|
|||||||
// find a tool
|
// find a tool
|
||||||
Draw_SaveAndRestore* tool = Draw_First;
|
Draw_SaveAndRestore* tool = Draw_First;
|
||||||
Handle(Draw_ProgressIndicator) progress = new Draw_ProgressIndicator ( di, 1 );
|
Handle(Draw_ProgressIndicator) progress = new Draw_ProgressIndicator ( di, 1 );
|
||||||
progress->SetScale ( 0, 100, 1 );
|
|
||||||
progress->NewScope(100,"Writing");
|
|
||||||
progress->Show();
|
|
||||||
|
|
||||||
while (tool) {
|
while (tool) {
|
||||||
if (tool->Test(D)) break;
|
if (tool->Test(D)) break;
|
||||||
@ -176,8 +173,6 @@ static Standard_Integer save(Draw_Interpretor& di, Standard_Integer n, const cha
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
Draw::SetProgressBar( 0 );
|
Draw::SetProgressBar( 0 );
|
||||||
progress->EndScope();
|
|
||||||
progress->Show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
os << "0\n\n";
|
os << "0\n\n";
|
||||||
@ -222,8 +217,7 @@ static Standard_Integer restore(Draw_Interpretor& di, Standard_Integer n, const
|
|||||||
if (!in.fail()) {
|
if (!in.fail()) {
|
||||||
// search a tool
|
// search a tool
|
||||||
Handle(Draw_ProgressIndicator) progress = new Draw_ProgressIndicator ( di, 1 );
|
Handle(Draw_ProgressIndicator) progress = new Draw_ProgressIndicator ( di, 1 );
|
||||||
progress->NewScope(100,"Reading");
|
Draw::SetProgressBar(progress);
|
||||||
progress->Show();
|
|
||||||
|
|
||||||
Draw_SaveAndRestore* tool = Draw_First;
|
Draw_SaveAndRestore* tool = Draw_First;
|
||||||
Draw_SaveAndRestore* aDBRepTool = NULL;
|
Draw_SaveAndRestore* aDBRepTool = NULL;
|
||||||
@ -232,7 +226,6 @@ static Standard_Integer restore(Draw_Interpretor& di, Standard_Integer n, const
|
|||||||
if (!strcmp(typ,toolName)) break;
|
if (!strcmp(typ,toolName)) break;
|
||||||
if (!strcmp("DBRep_DrawableShape",toolName))
|
if (!strcmp("DBRep_DrawableShape",toolName))
|
||||||
aDBRepTool = tool;
|
aDBRepTool = tool;
|
||||||
Draw::SetProgressBar(progress);
|
|
||||||
tool = tool->Next();
|
tool = tool->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,8 +247,6 @@ static Standard_Integer restore(Draw_Interpretor& di, Standard_Integer n, const
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
Draw::SetProgressBar( 0 );
|
Draw::SetProgressBar( 0 );
|
||||||
progress->EndScope();
|
|
||||||
progress->Show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
di << name;
|
di << name;
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
#include <TColgp_SequenceOfVec.hxx>
|
#include <TColgp_SequenceOfVec.hxx>
|
||||||
#include <TColStd_HArray1OfReal.hxx>
|
#include <TColStd_HArray1OfReal.hxx>
|
||||||
#include <TColStd_SequenceOfInteger.hxx>
|
#include <TColStd_SequenceOfInteger.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -448,7 +448,7 @@ void GeomPlate_BuildPlateSurface::
|
|||||||
// Function : Perform
|
// Function : Perform
|
||||||
// Calculates the surface filled with loaded constraints
|
// Calculates the surface filled with loaded constraints
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
void GeomPlate_BuildPlateSurface::Perform(const Handle(Message_ProgressIndicator) & aProgress)
|
void GeomPlate_BuildPlateSurface::Perform(const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
// Timing
|
// Timing
|
||||||
@ -479,8 +479,13 @@ void GeomPlate_BuildPlateSurface::Perform(const Handle(Message_ProgressIndicator
|
|||||||
//======================================================================
|
//======================================================================
|
||||||
// Initial Surface
|
// Initial Surface
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
Message_ProgressScope aPS(theProgress, NULL, 100, Standard_True);
|
||||||
if (!mySurfInitIsGive)
|
if (!mySurfInitIsGive)
|
||||||
ComputeSurfInit(aProgress);
|
{
|
||||||
|
ComputeSurfInit (aPS.Next(10));
|
||||||
|
if (aPS.UserBreak())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
if (NTLinCont>=2)
|
if (NTLinCont>=2)
|
||||||
@ -651,9 +656,9 @@ void GeomPlate_BuildPlateSurface::Perform(const Handle(Message_ProgressIndicator
|
|||||||
// Construction of the surface
|
// Construction of the surface
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
||||||
myPlate.SolveTI(myDegree, ComputeAnisotropie(), aProgress);
|
myPlate.SolveTI(myDegree, ComputeAnisotropie(), aPS.Next(90));
|
||||||
|
|
||||||
if (!aProgress.IsNull() && aProgress->UserBreak())
|
if (aPS.UserBreak())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -690,9 +695,9 @@ void GeomPlate_BuildPlateSurface::Perform(const Handle(Message_ProgressIndicator
|
|||||||
//====================================================================
|
//====================================================================
|
||||||
//Construction of the surface
|
//Construction of the surface
|
||||||
//====================================================================
|
//====================================================================
|
||||||
myPlate.SolveTI(myDegree, ComputeAnisotropie(), aProgress);
|
myPlate.SolveTI(myDegree, ComputeAnisotropie(), aPS.Next(90));
|
||||||
|
|
||||||
if (!aProgress.IsNull() && aProgress->UserBreak())
|
if (aPS.UserBreak())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1358,7 +1363,7 @@ Standard_Boolean GeomPlate_BuildPlateSurface::
|
|||||||
// there are point constraints.
|
// there are point constraints.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Handle(Message_ProgressIndicator) & aProgress)
|
void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
Standard_Integer nopt=2, popt=2, Np=1;
|
Standard_Integer nopt=2, popt=2, Np=1;
|
||||||
Standard_Boolean isHalfSpace = Standard_True;
|
Standard_Boolean isHalfSpace = Standard_True;
|
||||||
@ -1723,8 +1728,8 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Handle(Message_ProgressI
|
|||||||
//====================================================================
|
//====================================================================
|
||||||
// Construction of the surface
|
// Construction of the surface
|
||||||
//====================================================================
|
//====================================================================
|
||||||
myPlate.SolveTI(2, ComputeAnisotropie(), aProgress);
|
myPlate.SolveTI(2, ComputeAnisotropie(), theProgress);
|
||||||
if (!aProgress.IsNull() && aProgress->UserBreak())
|
if (theProgress.UserBreak())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ class gp_Pnt;
|
|||||||
class Geom2d_Curve;
|
class Geom2d_Curve;
|
||||||
class Adaptor3d_HCurve;
|
class Adaptor3d_HCurve;
|
||||||
class Adaptor2d_HCurve2d;
|
class Adaptor2d_HCurve2d;
|
||||||
class Message_ProgressIndicator;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -131,7 +130,7 @@ public:
|
|||||||
//! Exceptions
|
//! Exceptions
|
||||||
//! Standard_RangeError if the value of the constraint is
|
//! Standard_RangeError if the value of the constraint is
|
||||||
//! null or if plate is not done.
|
//! null or if plate is not done.
|
||||||
Standard_EXPORT void Perform(const Handle(Message_ProgressIndicator) & aProgress = Handle(Message_ProgressIndicator)());
|
Standard_EXPORT void Perform(const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! returns the CurveConstraints of order order
|
//! returns the CurveConstraints of order order
|
||||||
Standard_EXPORT Handle(GeomPlate_CurveConstraint) CurveConstraint (const Standard_Integer order) const;
|
Standard_EXPORT Handle(GeomPlate_CurveConstraint) CurveConstraint (const Standard_Integer order) const;
|
||||||
@ -218,7 +217,7 @@ private:
|
|||||||
|
|
||||||
Standard_EXPORT Handle(Adaptor2d_HCurve2d) ProjectedCurve (Handle(Adaptor3d_HCurve)& Curv);
|
Standard_EXPORT Handle(Adaptor2d_HCurve2d) ProjectedCurve (Handle(Adaptor3d_HCurve)& Curv);
|
||||||
|
|
||||||
Standard_EXPORT void ComputeSurfInit(const Handle(Message_ProgressIndicator) & aProgress);
|
Standard_EXPORT void ComputeSurfInit(const Message_ProgressRange& theProgress);
|
||||||
|
|
||||||
Standard_EXPORT void Intersect (Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, Handle(GeomPlate_HArray1OfSequenceOfReal)& PntG1G1);
|
Standard_EXPORT void Intersect (Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, Handle(GeomPlate_HArray1OfSequenceOfReal)& PntG1G1);
|
||||||
|
|
||||||
|
@ -33,8 +33,7 @@
|
|||||||
#include <gp_Hypr2d.hxx>
|
#include <gp_Hypr2d.hxx>
|
||||||
#include <gp_Lin2d.hxx>
|
#include <gp_Lin2d.hxx>
|
||||||
#include <gp_Parab2d.hxx>
|
#include <gp_Parab2d.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
#include <Standard_OutOfRange.hxx>
|
#include <Standard_OutOfRange.hxx>
|
||||||
@ -496,16 +495,14 @@ void GeomTools_Curve2dSet::Dump(Standard_OStream& OS)const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void GeomTools_Curve2dSet::Write (Standard_OStream& OS,
|
void GeomTools_Curve2dSet::Write(Standard_OStream& OS, const Message_ProgressRange& theProgress)const
|
||||||
const Handle(Message_ProgressIndicator) &theProgress)const
|
|
||||||
{
|
{
|
||||||
std::streamsize prec = OS.precision(17);
|
std::streamsize prec = OS.precision(17);
|
||||||
|
|
||||||
Standard_Integer i, nbsurf = myMap.Extent();
|
Standard_Integer i, nbsurf = myMap.Extent();
|
||||||
OS << "Curve2ds "<< nbsurf << "\n";
|
OS << "Curve2ds "<< nbsurf << "\n";
|
||||||
//OCC19559
|
Message_ProgressScope aPS(theProgress, "2D Curves", nbsurf);
|
||||||
Message_ProgressSentry PS(theProgress, "2D Curves", 0, nbsurf, 1);
|
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
||||||
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
|
|
||||||
PrintCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS,Standard_True);
|
PrintCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS,Standard_True);
|
||||||
}
|
}
|
||||||
OS.precision(prec);
|
OS.precision(prec);
|
||||||
@ -840,8 +837,7 @@ Handle(Geom2d_Curve) GeomTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void GeomTools_Curve2dSet::Read (Standard_IStream& IS,
|
void GeomTools_Curve2dSet::Read(Standard_IStream& IS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator) &theProgress)
|
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
IS >> buffer;
|
IS >> buffer;
|
||||||
@ -852,9 +848,8 @@ void GeomTools_Curve2dSet::Read (Standard_IStream& IS,
|
|||||||
|
|
||||||
Standard_Integer i, nbcurve;
|
Standard_Integer i, nbcurve;
|
||||||
IS >> nbcurve;
|
IS >> nbcurve;
|
||||||
//OCC19559
|
Message_ProgressScope aPS(theProgress, "2D Curves", nbcurve);
|
||||||
Message_ProgressSentry PS(theProgress, "2D Curves", 0, nbcurve, 1);
|
for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) {
|
||||||
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
|
|
||||||
Handle(Geom2d_Curve) C = GeomTools_Curve2dSet::ReadCurve2d (IS);
|
Handle(Geom2d_Curve) C = GeomTools_Curve2dSet::ReadCurve2d (IS);
|
||||||
myMap.Add(C);
|
myMap.Add(C);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
class Message_ProgressIndicator;
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Geom2d_Curve;
|
class Geom2d_Curve;
|
||||||
|
|
||||||
@ -61,12 +62,12 @@ public:
|
|||||||
//! Writes the content of me on the stream <OS> in a
|
//! Writes the content of me on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the stream <IS>. me
|
//! Reads the content of me from the stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Dumps the curve on the stream, if compact is True
|
//! Dumps the curve on the stream, if compact is True
|
||||||
//! use the compact format that can be read back.
|
//! use the compact format that can be read back.
|
||||||
|
@ -33,8 +33,7 @@
|
|||||||
#include <gp_Hypr.hxx>
|
#include <gp_Hypr.hxx>
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
#include <gp_Parab.hxx>
|
#include <gp_Parab.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
#include <Standard_OutOfRange.hxx>
|
#include <Standard_OutOfRange.hxx>
|
||||||
@ -513,16 +512,14 @@ void GeomTools_CurveSet::Dump(Standard_OStream& OS)const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void GeomTools_CurveSet::Write (Standard_OStream& OS,
|
void GeomTools_CurveSet::Write(Standard_OStream& OS, const Message_ProgressRange& theProgress)const
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
|
||||||
{
|
{
|
||||||
std::streamsize prec = OS.precision(17);
|
std::streamsize prec = OS.precision(17);
|
||||||
|
|
||||||
Standard_Integer i, nbcurve = myMap.Extent();
|
Standard_Integer i, nbcurve = myMap.Extent();
|
||||||
OS << "Curves "<< nbcurve << "\n";
|
OS << "Curves "<< nbcurve << "\n";
|
||||||
//OCC19559
|
Message_ProgressScope aPS(theProgress, "3D Curves", nbcurve);
|
||||||
Message_ProgressSentry PS(theProgress, "3D Curves", 0, nbcurve, 1);
|
for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) {
|
||||||
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
|
|
||||||
PrintCurve(Handle(Geom_Curve)::DownCast(myMap(i)),OS,Standard_True);
|
PrintCurve(Handle(Geom_Curve)::DownCast(myMap(i)),OS,Standard_True);
|
||||||
}
|
}
|
||||||
OS.precision(prec);
|
OS.precision(prec);
|
||||||
@ -861,8 +858,7 @@ Handle(Geom_Curve) GeomTools_CurveSet::ReadCurve (Standard_IStream& IS)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void GeomTools_CurveSet::Read (Standard_IStream& IS,
|
void GeomTools_CurveSet::Read(Standard_IStream& IS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
IS >> buffer;
|
IS >> buffer;
|
||||||
@ -873,9 +869,8 @@ void GeomTools_CurveSet::Read (Standard_IStream& IS,
|
|||||||
|
|
||||||
Standard_Integer i, nbcurve;
|
Standard_Integer i, nbcurve;
|
||||||
IS >> nbcurve;
|
IS >> nbcurve;
|
||||||
//OCC19559
|
Message_ProgressScope aPS(theProgress, "3D Curves", nbcurve);
|
||||||
Message_ProgressSentry PS(theProgress, "3D Curves", 0, nbcurve, 1);
|
for (i = 1; i <= nbcurve && aPS.More(); i++, aPS.Next()) {
|
||||||
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
|
|
||||||
Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve (IS);
|
Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve (IS);
|
||||||
myMap.Add(C);
|
myMap.Add(C);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
class Message_ProgressIndicator;
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Geom_Curve;
|
class Geom_Curve;
|
||||||
|
|
||||||
@ -61,12 +62,12 @@ public:
|
|||||||
//! Writes the content of me on the stream <OS> in a
|
//! Writes the content of me on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the stream <IS>. me
|
//! Reads the content of me from the stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Dumps the curve on the stream, if compact is True
|
//! Dumps the curve on the stream, if compact is True
|
||||||
//! use the compact format that can be read back.
|
//! use the compact format that can be read back.
|
||||||
|
@ -36,8 +36,7 @@
|
|||||||
#include <gp_Pln.hxx>
|
#include <gp_Pln.hxx>
|
||||||
#include <gp_Sphere.hxx>
|
#include <gp_Sphere.hxx>
|
||||||
#include <gp_Torus.hxx>
|
#include <gp_Torus.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
#include <Standard_OutOfRange.hxx>
|
#include <Standard_OutOfRange.hxx>
|
||||||
@ -633,16 +632,14 @@ void GeomTools_SurfaceSet::Dump(Standard_OStream& OS)const
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void GeomTools_SurfaceSet::Write (Standard_OStream& OS,
|
void GeomTools_SurfaceSet::Write(Standard_OStream& OS, const Message_ProgressRange& theProgress)const
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
|
||||||
{
|
{
|
||||||
std::streamsize prec = OS.precision(17);
|
std::streamsize prec = OS.precision(17);
|
||||||
|
|
||||||
Standard_Integer i, nbsurf = myMap.Extent();
|
Standard_Integer i, nbsurf = myMap.Extent();
|
||||||
OS << "Surfaces "<< nbsurf << "\n";
|
OS << "Surfaces "<< nbsurf << "\n";
|
||||||
//OCC19559
|
Message_ProgressScope aPS(theProgress, "Surfaces", nbsurf);
|
||||||
Message_ProgressSentry PS(theProgress, "Surfaces", 0, nbsurf, 1);
|
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
||||||
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
|
|
||||||
PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_True);
|
PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_True);
|
||||||
}
|
}
|
||||||
OS.precision(prec);
|
OS.precision(prec);
|
||||||
@ -1052,8 +1049,7 @@ Handle(Geom_Surface) GeomTools_SurfaceSet::ReadSurface (Standard_IStream& IS)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void GeomTools_SurfaceSet::Read (Standard_IStream& IS,
|
void GeomTools_SurfaceSet::Read(Standard_IStream& IS, const Message_ProgressRange& theProgress)
|
||||||
const Handle(Message_ProgressIndicator)& theProgress)
|
|
||||||
{
|
{
|
||||||
char buffer[255];
|
char buffer[255];
|
||||||
IS >> buffer;
|
IS >> buffer;
|
||||||
@ -1064,9 +1060,8 @@ void GeomTools_SurfaceSet::Read (Standard_IStream& IS,
|
|||||||
|
|
||||||
Standard_Integer i, nbsurf;
|
Standard_Integer i, nbsurf;
|
||||||
IS >> nbsurf;
|
IS >> nbsurf;
|
||||||
//OCC19559
|
Message_ProgressScope aPS(theProgress, "Surfaces", nbsurf);
|
||||||
Message_ProgressSentry PS(theProgress, "Surfaces", 0, nbsurf, 1);
|
for (i = 1; i <= nbsurf && aPS.More(); i++, aPS.Next()) {
|
||||||
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
|
|
||||||
Handle(Geom_Surface) S = GeomTools_SurfaceSet::ReadSurface (IS);
|
Handle(Geom_Surface) S = GeomTools_SurfaceSet::ReadSurface (IS);
|
||||||
myMap.Add(S);
|
myMap.Add(S);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
#include <Standard_IStream.hxx>
|
#include <Standard_IStream.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
class Message_ProgressIndicator;
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Standard_OutOfRange;
|
class Standard_OutOfRange;
|
||||||
class Geom_Surface;
|
class Geom_Surface;
|
||||||
|
|
||||||
@ -61,12 +62,12 @@ public:
|
|||||||
//! Writes the content of me on the stream <OS> in a
|
//! Writes the content of me on the stream <OS> in a
|
||||||
//! format that can be read back by Read.
|
//! format that can be read back by Read.
|
||||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const;
|
||||||
|
|
||||||
//! Reads the content of me from the stream <IS>. me
|
//! Reads the content of me from the stream <IS>. me
|
||||||
//! is first cleared.
|
//! is first cleared.
|
||||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Dumps the surface on the stream, if compact is True
|
//! Dumps the surface on the stream, if compact is True
|
||||||
//! use the compact format that can be read back.
|
//! use the compact format that can be read back.
|
||||||
|
@ -45,8 +45,8 @@
|
|||||||
#include <XSControl_WorkSession.hxx>
|
#include <XSControl_WorkSession.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Transfer
|
//function : checkColorRange
|
||||||
//purpose : basic working method
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
static void checkColorRange (Standard_Real& theCol)
|
static void checkColorRange (Standard_Real& theCol)
|
||||||
{
|
{
|
||||||
@ -143,7 +143,12 @@ static void AddCompositeShape (const Handle(XCAFDoc_ShapeTool)& theSTool,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Reader::Transfer (Handle(TDocStd_Document) &doc)
|
//=======================================================================
|
||||||
|
//function : Transfer
|
||||||
|
//purpose : basic working method
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean IGESCAFControl_Reader::Transfer (Handle(TDocStd_Document) &doc,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
// read all shapes
|
// read all shapes
|
||||||
Standard_Integer num;// = NbRootsForTransfer();
|
Standard_Integer num;// = NbRootsForTransfer();
|
||||||
@ -152,7 +157,7 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (Handle(TDocStd_Document) &doc)
|
|||||||
// TransferOneRoot ( i );
|
// TransferOneRoot ( i );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
TransferRoots(); // replaces the above
|
TransferRoots(theProgress); // replaces the above
|
||||||
num = NbShapes();
|
num = NbShapes();
|
||||||
if ( num <=0 ) return Standard_False;
|
if ( num <=0 ) return Standard_False;
|
||||||
|
|
||||||
@ -334,8 +339,9 @@ Standard_Boolean IGESCAFControl_Reader::Transfer (Handle(TDocStd_Document) &doc)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Reader::Perform (const Standard_CString filename,
|
Standard_Boolean IGESCAFControl_Reader::Perform (const Standard_CString filename,
|
||||||
Handle(TDocStd_Document) &doc)
|
Handle(TDocStd_Document) &doc,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if ( ReadFile ( filename ) != IFSelect_RetDone ) return Standard_False;
|
if ( ReadFile ( filename ) != IFSelect_RetDone ) return Standard_False;
|
||||||
return Transfer ( doc );
|
return Transfer ( doc, theProgress );
|
||||||
}
|
}
|
||||||
|
@ -68,14 +68,19 @@ class IGESCAFControl_Reader : public IGESControl_Reader
|
|||||||
|
|
||||||
//! Translates currently loaded IGES file into the document
|
//! Translates currently loaded IGES file into the document
|
||||||
//! Returns True if succeeded, and False in case of fail
|
//! Returns True if succeeded, and False in case of fail
|
||||||
Standard_EXPORT Standard_Boolean Transfer (Handle(TDocStd_Document)& theDoc);
|
Standard_EXPORT Standard_Boolean Transfer (Handle(TDocStd_Document)& theDoc,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
Standard_Boolean Perform (const TCollection_AsciiString& theFileName, Handle(TDocStd_Document)& theDoc)
|
Standard_Boolean Perform (const TCollection_AsciiString& theFileName,
|
||||||
{ return Perform (theFileName.ToCString(), theDoc); }
|
Handle(TDocStd_Document)& theDoc,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange())
|
||||||
|
{ return Perform (theFileName.ToCString(), theDoc, theProgress); }
|
||||||
|
|
||||||
//! Translate IGES file given by filename into the document
|
//! Translate IGES file given by filename into the document
|
||||||
//! Return True if succeeded, and False in case of fail
|
//! Return True if succeeded, and False in case of fail
|
||||||
Standard_EXPORT Standard_Boolean Perform (const Standard_CString theFileName, Handle(TDocStd_Document)& theDoc);
|
Standard_EXPORT Standard_Boolean Perform (const Standard_CString theFileName,
|
||||||
|
Handle(TDocStd_Document)& theDoc,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Set ColorMode for indicate read Colors or not.
|
//! Set ColorMode for indicate read Colors or not.
|
||||||
void SetColorMode (const Standard_Boolean theMode)
|
void SetColorMode (const Standard_Boolean theMode)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <IGESGraph_DefinitionLevel.hxx>
|
#include <IGESGraph_DefinitionLevel.hxx>
|
||||||
#include <IGESSolid_Face.hxx>
|
#include <IGESSolid_Face.hxx>
|
||||||
#include <IGESBasic_Name.hxx>
|
#include <IGESBasic_Name.hxx>
|
||||||
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <NCollection_DataMap.hxx>
|
#include <NCollection_DataMap.hxx>
|
||||||
#include <Standard_Transient.hxx>
|
#include <Standard_Transient.hxx>
|
||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
@ -142,7 +143,8 @@ IGESCAFControl_Writer::IGESCAFControl_Writer (const Handle(XSControl_WorkSession
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document) &doc)
|
Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document) &doc,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
// translate free top-level shapes of the DECAF document
|
// translate free top-level shapes of the DECAF document
|
||||||
Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
|
Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
|
||||||
@ -150,7 +152,7 @@ Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document)
|
|||||||
|
|
||||||
TDF_LabelSequence labels;
|
TDF_LabelSequence labels;
|
||||||
STool->GetFreeShapes ( labels );
|
STool->GetFreeShapes ( labels );
|
||||||
return Transfer (labels);
|
return Transfer (labels, theProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -158,11 +160,12 @@ Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label)
|
Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
TDF_LabelSequence labels;
|
TDF_LabelSequence labels;
|
||||||
labels.Append( label );
|
labels.Append( label );
|
||||||
return Transfer( labels );
|
return Transfer( labels, theProgress );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -170,13 +173,16 @@ Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_LabelSequence& labels)
|
Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_LabelSequence& labels,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if ( labels.Length() <=0 ) return Standard_False;
|
if ( labels.Length() <=0 ) return Standard_False;
|
||||||
for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
|
Message_ProgressScope aPS(theProgress, "Labels", labels.Length());
|
||||||
|
for ( Standard_Integer i=1; i <= labels.Length() && aPS.More(); i++ )
|
||||||
|
{
|
||||||
TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( labels.Value(i) );
|
TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( labels.Value(i) );
|
||||||
if ( ! shape.IsNull() )
|
if ( ! shape.IsNull() )
|
||||||
AddShape ( shape );
|
AddShape (shape, aPS.Next());
|
||||||
// IGESControl_Writer::Transfer ( shape );
|
// IGESControl_Writer::Transfer ( shape );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,9 +211,10 @@ Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_LabelSequence& label
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
|
Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
|
||||||
const Standard_CString filename)
|
const Standard_CString filename,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if ( ! Transfer ( doc ) ) return Standard_False;
|
if ( ! Transfer ( doc, theProgress ) ) return Standard_False;
|
||||||
return Write ( filename ) == IFSelect_RetDone;
|
return Write ( filename ) == IFSelect_RetDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,9 +224,10 @@ Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
|
Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
|
||||||
const TCollection_AsciiString &filename)
|
const TCollection_AsciiString &filename,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if ( ! Transfer ( doc ) ) return Standard_False;
|
if ( ! Transfer ( doc, theProgress ) ) return Standard_False;
|
||||||
return Write ( filename.ToCString() ) == IFSelect_RetDone;
|
return Write ( filename.ToCString() ) == IFSelect_RetDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,21 +69,28 @@ public:
|
|||||||
|
|
||||||
//! Transfers a document to a IGES model
|
//! Transfers a document to a IGES model
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc);
|
Standard_EXPORT Standard_Boolean Transfer (const Handle(TDocStd_Document)& doc,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfers labels to a IGES model
|
//! Transfers labels to a IGES model
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const TDF_LabelSequence& labels);
|
Standard_EXPORT Standard_Boolean Transfer (const TDF_LabelSequence& labels,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfers label to a IGES model
|
//! Transfers label to a IGES model
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const TDF_Label& label);
|
Standard_EXPORT Standard_Boolean Transfer (const TDF_Label& label,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc, const TCollection_AsciiString& filename);
|
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc,
|
||||||
|
const TCollection_AsciiString& filename,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfers a document and writes it to a IGES file
|
//! Transfers a document and writes it to a IGES file
|
||||||
//! Returns True if translation is OK
|
//! Returns True if translation is OK
|
||||||
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc, const Standard_CString filename);
|
Standard_EXPORT Standard_Boolean Perform (const Handle(TDocStd_Document)& doc,
|
||||||
|
const Standard_CString filename,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Set ColorMode for indicate write Colors or not.
|
//! Set ColorMode for indicate write Colors or not.
|
||||||
Standard_EXPORT void SetColorMode (const Standard_Boolean colormode);
|
Standard_EXPORT void SetColorMode (const Standard_Boolean colormode);
|
||||||
|
@ -54,7 +54,8 @@ Standard_Boolean IGESControl_ActorWrite::Recognize
|
|||||||
|
|
||||||
Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer
|
Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer
|
||||||
(const Handle(Transfer_Finder)& start,
|
(const Handle(Transfer_Finder)& start,
|
||||||
const Handle(Transfer_FinderProcess)& FP)
|
const Handle(Transfer_FinderProcess)& FP,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
||||||
|
|
||||||
@ -74,14 +75,14 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer
|
|||||||
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, Tol, maxTol,
|
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, Tol, maxTol,
|
||||||
"write.iges.resource.name",
|
"write.iges.resource.name",
|
||||||
"write.iges.sequence", info,
|
"write.iges.sequence", info,
|
||||||
FP->GetProgress() );
|
theProgress );
|
||||||
// modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
|
// modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
|
||||||
|
|
||||||
BRepToIGES_BREntity BR0; BR0.SetModel(modl); BR0.SetTransferProcess(FP);
|
BRepToIGES_BREntity BR0; BR0.SetModel(modl); BR0.SetTransferProcess(FP);
|
||||||
BRepToIGESBRep_Entity BR1; BR1.SetModel(modl); BR1.SetTransferProcess(FP);
|
BRepToIGESBRep_Entity BR1; BR1.SetModel(modl); BR1.SetTransferProcess(FP);
|
||||||
|
|
||||||
if (themodetrans == 0) ent = BR0.TransferShape(shape);
|
if (themodetrans == 0) ent = BR0.TransferShape(shape, theProgress);
|
||||||
if (themodetrans == 1) ent = BR1.TransferShape(shape);
|
if (themodetrans == 1) ent = BR1.TransferShape(shape, theProgress);
|
||||||
// modified by NIZHNY-EAP Tue Aug 29 11:37:18 2000 ___BEGIN___
|
// modified by NIZHNY-EAP Tue Aug 29 11:37:18 2000 ___BEGIN___
|
||||||
XSAlgo::AlgoContainer()->MergeTransferInfo(FP, info);
|
XSAlgo::AlgoContainer()->MergeTransferInfo(FP, info);
|
||||||
// modified by NIZHNY-EAP Tue Aug 29 11:37:25 2000 ___END___
|
// modified by NIZHNY-EAP Tue Aug 29 11:37:25 2000 ___END___
|
||||||
|
@ -46,7 +46,10 @@ public:
|
|||||||
//!
|
//!
|
||||||
//! ModeTrans may be : 0 -> groups of Faces
|
//! ModeTrans may be : 0 -> groups of Faces
|
||||||
//! or 1 -> BRep
|
//! or 1 -> BRep
|
||||||
Standard_EXPORT virtual Handle(Transfer_Binder) Transfer (const Handle(Transfer_Finder)& start, const Handle(Transfer_FinderProcess)& FP) Standard_OVERRIDE;
|
Standard_EXPORT virtual Handle(Transfer_Binder) Transfer
|
||||||
|
(const Handle(Transfer_Finder)& start,
|
||||||
|
const Handle(Transfer_FinderProcess)& FP,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,9 +344,10 @@ Handle(Transfer_ActorOfTransientProcess) IGESControl_Controller::ActorRead (cons
|
|||||||
IFSelect_ReturnStatus IGESControl_Controller::TransferWriteShape (const TopoDS_Shape& shape,
|
IFSelect_ReturnStatus IGESControl_Controller::TransferWriteShape (const TopoDS_Shape& shape,
|
||||||
const Handle(Transfer_FinderProcess)& FP,
|
const Handle(Transfer_FinderProcess)& FP,
|
||||||
const Handle(Interface_InterfaceModel)& model,
|
const Handle(Interface_InterfaceModel)& model,
|
||||||
const Standard_Integer modetrans) const
|
const Standard_Integer modetrans,
|
||||||
|
const Message_ProgressRange& theProgress) const
|
||||||
{
|
{
|
||||||
return XSControl_Controller::TransferWriteShape (shape,FP,model,modetrans);
|
return XSControl_Controller::TransferWriteShape(shape, FP, model, modetrans, theProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -62,7 +62,12 @@ public:
|
|||||||
//! -2 bad model (requires an IGESModel)
|
//! -2 bad model (requires an IGESModel)
|
||||||
//! modeshape : 0 groupe of face (version < 5.1)
|
//! modeshape : 0 groupe of face (version < 5.1)
|
||||||
//! 1 BREP-version 5.1 of IGES
|
//! 1 BREP-version 5.1 of IGES
|
||||||
Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& shape, const Handle(Transfer_FinderProcess)& FP, const Handle(Interface_InterfaceModel)& model, const Standard_Integer modetrans = 0) const Standard_OVERRIDE;
|
Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape
|
||||||
|
(const TopoDS_Shape& shape,
|
||||||
|
const Handle(Transfer_FinderProcess)& FP,
|
||||||
|
const Handle(Interface_InterfaceModel)& model,
|
||||||
|
const Standard_Integer modetrans = 0,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) const Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Standard Initialisation. It creates a Controller for IGES and
|
//! Standard Initialisation. It creates a Controller for IGES and
|
||||||
//! records it to various names, available to select it later
|
//! records it to various names, available to select it later
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include <IGESSelect_WorkLibrary.hxx>
|
#include <IGESSelect_WorkLibrary.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
#include <Interface_Static.hxx>
|
#include <Interface_Static.hxx>
|
||||||
#include <Message_ProgressIndicator.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <OSD_OpenFile.hxx>
|
#include <OSD_OpenFile.hxx>
|
||||||
#include <ShapeAnalysis_ShapeTolerance.hxx>
|
#include <ShapeAnalysis_ShapeTolerance.hxx>
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
@ -82,21 +82,14 @@ IGESControl_Writer::IGESControl_Writer
|
|||||||
myEditor (model,IGESSelect_WorkLibrary::DefineProtocol()) ,
|
myEditor (model,IGESSelect_WorkLibrary::DefineProtocol()) ,
|
||||||
myWriteMode (modecr) , myIsComputed (Standard_False) { }
|
myWriteMode (modecr) , myIsComputed (Standard_False) { }
|
||||||
|
|
||||||
Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
|
Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if (theShape.IsNull()) return Standard_False;
|
if (theShape.IsNull()) return Standard_False;
|
||||||
|
|
||||||
// for progress indication
|
|
||||||
Handle(Message_ProgressIndicator) progress = myTP->GetProgress();
|
|
||||||
if ( ! progress.IsNull() ) {
|
|
||||||
Standard_Integer nbfaces=0;
|
|
||||||
for( TopExp_Explorer exp(theShape,TopAbs_FACE); exp.More(); exp.Next() )
|
|
||||||
nbfaces++;
|
|
||||||
progress->SetScale ( "Faces", 0, nbfaces, 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
||||||
|
|
||||||
|
Message_ProgressScope aPS(theProgress, NULL, 2);
|
||||||
// modified by NIZHNY-EAP Tue Aug 29 11:16:54 2000 ___BEGIN___
|
// modified by NIZHNY-EAP Tue Aug 29 11:16:54 2000 ___BEGIN___
|
||||||
Handle(Standard_Transient) info;
|
Handle(Standard_Transient) info;
|
||||||
Standard_Real Tol = Interface_Static::RVal("write.precision.val");
|
Standard_Real Tol = Interface_Static::RVal("write.precision.val");
|
||||||
@ -104,11 +97,17 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
|
|||||||
TopoDS_Shape Shape = XSAlgo::AlgoContainer()->ProcessShape( theShape, Tol, maxTol,
|
TopoDS_Shape Shape = XSAlgo::AlgoContainer()->ProcessShape( theShape, Tol, maxTol,
|
||||||
"write.iges.resource.name",
|
"write.iges.resource.name",
|
||||||
"write.iges.sequence", info,
|
"write.iges.sequence", info,
|
||||||
progress );
|
aPS.Next());
|
||||||
|
if (!aPS.More())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
// modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
|
// modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
|
||||||
BRepToIGES_BREntity B0; B0.SetTransferProcess(myTP); B0.SetModel(myModel);
|
BRepToIGES_BREntity B0; B0.SetTransferProcess(myTP); B0.SetModel(myModel);
|
||||||
BRepToIGESBRep_Entity B1; B1.SetTransferProcess(myTP); B1.SetModel(myModel);
|
BRepToIGESBRep_Entity B1; B1.SetTransferProcess(myTP); B1.SetModel(myModel);
|
||||||
Handle(IGESData_IGESEntity) ent = myWriteMode? B1.TransferShape(Shape) : B0.TransferShape(Shape);
|
Handle(IGESData_IGESEntity) ent = myWriteMode?
|
||||||
|
B1.TransferShape (Shape, aPS.Next()) : B0.TransferShape(Shape, aPS.Next());
|
||||||
|
if (!aPS.More())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
if(ent.IsNull())
|
if(ent.IsNull())
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <Standard_CString.hxx>
|
#include <Standard_CString.hxx>
|
||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Transfer_FinderProcess;
|
class Transfer_FinderProcess;
|
||||||
class IGESData_IGESModel;
|
class IGESData_IGESModel;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
@ -85,7 +87,8 @@ public:
|
|||||||
|
|
||||||
//! Translates a Shape to IGES Entities and adds them to the model
|
//! Translates a Shape to IGES Entities and adds them to the model
|
||||||
//! Returns True if done, False if Shape not suitable for IGES or null
|
//! Returns True if done, False if Shape not suitable for IGES or null
|
||||||
Standard_EXPORT Standard_Boolean AddShape (const TopoDS_Shape& sh);
|
Standard_EXPORT Standard_Boolean AddShape (const TopoDS_Shape& sh,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Translates a Geometry (Surface or Curve) to IGES Entities and
|
//! Translates a Geometry (Surface or Curve) to IGES Entities and
|
||||||
//! adds them to the model
|
//! adds them to the model
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <Interface_InterfaceModel.hxx>
|
#include <Interface_InterfaceModel.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
#include <Interface_Static.hxx>
|
#include <Interface_Static.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <ShapeExtend_Explorer.hxx>
|
#include <ShapeExtend_Explorer.hxx>
|
||||||
#include <ShapeFix_ShapeTolerance.hxx>
|
#include <ShapeFix_ShapeTolerance.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
@ -141,7 +141,8 @@ static void TrimTolerances (const TopoDS_Shape& shape,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
|
Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
|
||||||
(const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP)
|
(const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
DeclareAndCast(IGESData_IGESModel,mymodel,themodel);
|
DeclareAndCast(IGESData_IGESModel,mymodel,themodel);
|
||||||
DeclareAndCast(IGESData_IGESEntity,ent,start);
|
DeclareAndCast(IGESData_IGESEntity,ent,start);
|
||||||
@ -162,7 +163,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
|
|||||||
(typnum == 408) || (typnum == 308)) {
|
(typnum == 408) || (typnum == 308)) {
|
||||||
|
|
||||||
// Start progress scope (no need to check if progress exists -- it is safe)
|
// Start progress scope (no need to check if progress exists -- it is safe)
|
||||||
Message_ProgressSentry aPSentry(TP->GetProgress(), "Transfer stage", 0, 2, 1);
|
Message_ProgressScope aPS(theProgress, "Transfer stage", 2);
|
||||||
|
|
||||||
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
||||||
IGESToBRep_CurveAndSurface CAS;
|
IGESToBRep_CurveAndSurface CAS;
|
||||||
@ -189,22 +190,19 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
shape = CAS.TransferGeometry(ent);
|
shape = CAS.TransferGeometry(ent, aPS.Next());
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
shape.Nullify();
|
shape.Nullify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch to fix stage.
|
|
||||||
aPSentry.Next();
|
|
||||||
|
|
||||||
// fixing shape
|
// fixing shape
|
||||||
Handle(Standard_Transient) info;
|
Handle(Standard_Transient) info;
|
||||||
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, theeps, CAS.GetMaxTol(),
|
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, theeps, CAS.GetMaxTol(),
|
||||||
"read.iges.resource.name",
|
"read.iges.resource.name",
|
||||||
"read.iges.sequence", info,
|
"read.iges.sequence", info,
|
||||||
TP->GetProgress() );
|
aPS.Next());
|
||||||
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
|
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,12 +24,13 @@
|
|||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
#include <Transfer_ActorOfTransientProcess.hxx>
|
#include <Transfer_ActorOfTransientProcess.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Interface_InterfaceModel;
|
class Interface_InterfaceModel;
|
||||||
class Standard_Transient;
|
class Standard_Transient;
|
||||||
class Transfer_Binder;
|
class Transfer_Binder;
|
||||||
class Transfer_TransientProcess;
|
class Transfer_TransientProcess;
|
||||||
|
|
||||||
|
|
||||||
class IGESToBRep_Actor;
|
class IGESToBRep_Actor;
|
||||||
DEFINE_STANDARD_HANDLE(IGESToBRep_Actor, Transfer_ActorOfTransientProcess)
|
DEFINE_STANDARD_HANDLE(IGESToBRep_Actor, Transfer_ActorOfTransientProcess)
|
||||||
|
|
||||||
@ -58,7 +59,10 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE;
|
Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE;
|
||||||
|
|
||||||
Standard_EXPORT virtual Handle(Transfer_Binder) Transfer (const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP) Standard_OVERRIDE;
|
Standard_EXPORT virtual Handle(Transfer_Binder) Transfer
|
||||||
|
(const Handle(Standard_Transient)& start,
|
||||||
|
const Handle(Transfer_TransientProcess)& TP,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE;
|
||||||
|
|
||||||
//! Returns the tolerance which was actually used, either from
|
//! Returns the tolerance which was actually used, either from
|
||||||
//! the file or from statics
|
//! the file or from statics
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
#include <IGESToBRep_TopoSurface.hxx>
|
#include <IGESToBRep_TopoSurface.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
#include <Message_Msg.hxx>
|
#include <Message_Msg.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <ShapeBuild_Edge.hxx>
|
#include <ShapeBuild_Edge.hxx>
|
||||||
#include <ShapeExtend_WireData.hxx>
|
#include <ShapeExtend_WireData.hxx>
|
||||||
@ -128,7 +128,8 @@ IGESToBRep_BRepEntity::IGESToBRep_BRepEntity
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
TopoDS_Shape IGESToBRep_BRepEntity::TransferBRepEntity
|
TopoDS_Shape IGESToBRep_BRepEntity::TransferBRepEntity
|
||||||
(const Handle(IGESData_IGESEntity)& start)
|
(const Handle(IGESData_IGESEntity)& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
TopoDS_Shape res;
|
TopoDS_Shape res;
|
||||||
|
|
||||||
@ -138,11 +139,11 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferBRepEntity
|
|||||||
}
|
}
|
||||||
else if (start->IsKind(STANDARD_TYPE(IGESSolid_Shell))) {
|
else if (start->IsKind(STANDARD_TYPE(IGESSolid_Shell))) {
|
||||||
DeclareAndCast(IGESSolid_Shell, st514, start);
|
DeclareAndCast(IGESSolid_Shell, st514, start);
|
||||||
res = TransferShell(st514);
|
res = TransferShell(st514, theProgress);
|
||||||
}
|
}
|
||||||
else if (start->IsKind(STANDARD_TYPE(IGESSolid_ManifoldSolid))) {
|
else if (start->IsKind(STANDARD_TYPE(IGESSolid_ManifoldSolid))) {
|
||||||
DeclareAndCast(IGESSolid_ManifoldSolid, st186, start);
|
DeclareAndCast(IGESSolid_ManifoldSolid, st186, start);
|
||||||
res = TransferManifoldSolid(st186);
|
res = TransferManifoldSolid(st186, theProgress);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Message_Msg Msg1005("IGES_1005");
|
Message_Msg Msg1005("IGES_1005");
|
||||||
@ -531,7 +532,8 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferFace
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
TopoDS_Shape IGESToBRep_BRepEntity::TransferShell
|
TopoDS_Shape IGESToBRep_BRepEntity::TransferShell
|
||||||
(const Handle(IGESSolid_Shell)& start)
|
(const Handle(IGESSolid_Shell)& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
TopoDS_Shape res;
|
TopoDS_Shape res;
|
||||||
|
|
||||||
@ -542,13 +544,8 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferShell
|
|||||||
Standard_Integer nbfaces = start->NbFaces();
|
Standard_Integer nbfaces = start->NbFaces();
|
||||||
if (nbfaces != 0) {
|
if (nbfaces != 0) {
|
||||||
Standard_Boolean closed = Standard_True; //:39
|
Standard_Boolean closed = Standard_True; //:39
|
||||||
Handle(Message_ProgressIndicator) progress = GetTransferProcess()->GetProgress();
|
Message_ProgressScope aPS(theProgress, "Face", nbfaces);
|
||||||
if ( ! progress.IsNull() ) progress->SetScale ( "Face", 0, nbfaces, 1 );
|
for (Standard_Integer iface = 1; iface <= nbfaces && aPS.More(); iface++, aPS.Next()) {
|
||||||
for (Standard_Integer iface = 1; iface <= nbfaces; iface++) {
|
|
||||||
if ( ! progress.IsNull() ) {
|
|
||||||
progress->Increment();
|
|
||||||
if ( progress->UserBreak() ) break;
|
|
||||||
}
|
|
||||||
Handle(IGESSolid_Face) face = start->Face(iface);
|
Handle(IGESSolid_Face) face = start->Face(iface);
|
||||||
Standard_Boolean orientation = start->Orientation(iface);
|
Standard_Boolean orientation = start->Orientation(iface);
|
||||||
TopoDS_Shape Sh = TransferFace(face);
|
TopoDS_Shape Sh = TransferFace(face);
|
||||||
@ -595,7 +592,8 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferShell
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
TopoDS_Shape IGESToBRep_BRepEntity::TransferManifoldSolid
|
TopoDS_Shape IGESToBRep_BRepEntity::TransferManifoldSolid
|
||||||
(const Handle(IGESSolid_ManifoldSolid)& start)
|
(const Handle(IGESSolid_ManifoldSolid)& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
TopoDS_Shape res;
|
TopoDS_Shape res;
|
||||||
|
|
||||||
@ -606,7 +604,7 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferManifoldSolid
|
|||||||
Handle(IGESSolid_Shell) shell = start->Shell();
|
Handle(IGESSolid_Shell) shell = start->Shell();
|
||||||
Standard_Boolean isoriented = start->OrientationFlag();
|
Standard_Boolean isoriented = start->OrientationFlag();
|
||||||
Standard_Integer nbshell = start->NbVoidShells();
|
Standard_Integer nbshell = start->NbVoidShells();
|
||||||
TopoDS_Shape Sh = TransferShell(shell);
|
TopoDS_Shape Sh = TransferShell(shell, theProgress);
|
||||||
if (!Sh.IsNull()) {
|
if (!Sh.IsNull()) {
|
||||||
if (Sh.ShapeType() == TopAbs_SHELL) {
|
if (Sh.ShapeType() == TopAbs_SHELL) {
|
||||||
TopoDS_Shell Shell = TopoDS::Shell(Sh);
|
TopoDS_Shell Shell = TopoDS::Shell(Sh);
|
||||||
@ -616,11 +614,11 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferManifoldSolid
|
|||||||
|
|
||||||
if (nbshell != 0) {
|
if (nbshell != 0) {
|
||||||
// progress scope without name, since usually we have single shell in solid
|
// progress scope without name, since usually we have single shell in solid
|
||||||
Message_ProgressSentry PS ( GetTransferProcess()->GetProgress(), 0, 0, nbshell, 1 );
|
Message_ProgressScope aPS (theProgress, NULL, nbshell);
|
||||||
for (Standard_Integer ishell=1; ishell<= nbshell && PS.More(); ishell++, PS.Next()) {
|
for (Standard_Integer ishell=1; ishell<= nbshell && aPS.More(); ishell++) {
|
||||||
Handle(IGESSolid_Shell) voidshell= start->VoidShell(ishell);
|
Handle(IGESSolid_Shell) voidshell= start->VoidShell(ishell);
|
||||||
// Standard_Boolean orientation = start->VoidOrientationFlag(ishell);
|
// Standard_Boolean orientation = start->VoidOrientationFlag(ishell);
|
||||||
TopoDS_Shape aSh = TransferShell(voidshell);
|
TopoDS_Shape aSh = TransferShell (voidshell, aPS.Next());
|
||||||
if (!aSh.IsNull()) {
|
if (!aSh.IsNull()) {
|
||||||
if (aSh.ShapeType() == TopAbs_SHELL) {
|
if (aSh.ShapeType() == TopAbs_SHELL) {
|
||||||
TopoDS_Shell Shell = TopoDS::Shell(aSh);
|
TopoDS_Shell Shell = TopoDS::Shell(aSh);
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class IGESToBRep_CurveAndSurface;
|
class IGESToBRep_CurveAndSurface;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
class IGESData_IGESEntity;
|
class IGESData_IGESEntity;
|
||||||
@ -63,7 +65,8 @@ public:
|
|||||||
Standard_EXPORT IGESToBRep_BRepEntity(const Standard_Real eps, const Standard_Real epsGeom, const Standard_Real epsCoeff, const Standard_Boolean mode, const Standard_Boolean modeapprox, const Standard_Boolean optimized);
|
Standard_EXPORT IGESToBRep_BRepEntity(const Standard_Real eps, const Standard_Real epsGeom, const Standard_Real epsCoeff, const Standard_Boolean mode, const Standard_Boolean modeapprox, const Standard_Boolean optimized);
|
||||||
|
|
||||||
//! Transfer the BRepEntity" : Face, Shell or ManifoldSolid.
|
//! Transfer the BRepEntity" : Face, Shell or ManifoldSolid.
|
||||||
Standard_EXPORT TopoDS_Shape TransferBRepEntity (const Handle(IGESData_IGESEntity)& start);
|
Standard_EXPORT TopoDS_Shape TransferBRepEntity (const Handle(IGESData_IGESEntity)& start,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfer the entity number "index" of the VertexList "start"
|
//! Transfer the entity number "index" of the VertexList "start"
|
||||||
Standard_EXPORT TopoDS_Vertex TransferVertex (const Handle(IGESSolid_VertexList)& start, const Standard_Integer index);
|
Standard_EXPORT TopoDS_Vertex TransferVertex (const Handle(IGESSolid_VertexList)& start, const Standard_Integer index);
|
||||||
@ -78,10 +81,12 @@ public:
|
|||||||
Standard_EXPORT TopoDS_Shape TransferFace (const Handle(IGESSolid_Face)& start);
|
Standard_EXPORT TopoDS_Shape TransferFace (const Handle(IGESSolid_Face)& start);
|
||||||
|
|
||||||
//! Transfer the Shell Entity
|
//! Transfer the Shell Entity
|
||||||
Standard_EXPORT TopoDS_Shape TransferShell (const Handle(IGESSolid_Shell)& start);
|
Standard_EXPORT TopoDS_Shape TransferShell (const Handle(IGESSolid_Shell)& start,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfer the ManifoldSolid Entity
|
//! Transfer the ManifoldSolid Entity
|
||||||
Standard_EXPORT TopoDS_Shape TransferManifoldSolid (const Handle(IGESSolid_ManifoldSolid)& start);
|
Standard_EXPORT TopoDS_Shape TransferManifoldSolid (const Handle(IGESSolid_ManifoldSolid)& start,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include <Interface_Static.hxx>
|
#include <Interface_Static.hxx>
|
||||||
#include <Message_Messenger.hxx>
|
#include <Message_Messenger.hxx>
|
||||||
#include <Message_Msg.hxx>
|
#include <Message_Msg.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
@ -178,7 +178,8 @@ void IGESToBRep_CurveAndSurface::SetModel(const Handle(IGESData_IGESModel)& mode
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
TopoDS_Shape IGESToBRep_CurveAndSurface::TransferCurveAndSurface
|
TopoDS_Shape IGESToBRep_CurveAndSurface::TransferCurveAndSurface
|
||||||
(const Handle(IGESData_IGESEntity)& start)
|
(const Handle(IGESData_IGESEntity)& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
TopoDS_Shape res;
|
TopoDS_Shape res;
|
||||||
if (start.IsNull()) {
|
if (start.IsNull()) {
|
||||||
@ -199,7 +200,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferCurveAndSurface
|
|||||||
}
|
}
|
||||||
else if (IGESToBRep::IsBRepEntity(start)) {
|
else if (IGESToBRep::IsBRepEntity(start)) {
|
||||||
IGESToBRep_BRepEntity TS(*this);
|
IGESToBRep_BRepEntity TS(*this);
|
||||||
res = TS.TransferBRepEntity(start);
|
res = TS.TransferBRepEntity(start, theProgress);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Message_Msg msg1015("IGES_1015");
|
Message_Msg msg1015("IGES_1015");
|
||||||
@ -231,7 +232,8 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferCurveAndSurface
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
||||||
(const Handle(IGESData_IGESEntity)& start)
|
(const Handle(IGESData_IGESEntity)& start,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
// Declaration of messages//
|
// Declaration of messages//
|
||||||
// DCE 22/12/98
|
// DCE 22/12/98
|
||||||
@ -263,7 +265,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
return res;
|
return res;
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
res = TransferCurveAndSurface(start);
|
res = TransferCurveAndSurface(start, theProgress);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
Message_Msg msg1015("IGES_1015");
|
Message_Msg msg1015("IGES_1015");
|
||||||
@ -295,7 +297,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
res = TransferGeometry(stsub);
|
res = TransferGeometry(stsub, theProgress);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
res.Nullify();
|
res.Nullify();
|
||||||
@ -319,8 +321,10 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
SendFail( st308, msg210);
|
SendFail( st308, msg210);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
Message_ProgressSentry PS ( myTP->GetProgress(), "Subfigure item", 0, st308->NbEntities(), 1 );
|
Message_ProgressScope PS (theProgress, "Subfigure item", st308->NbEntities());
|
||||||
for (Standard_Integer i=1; i <= st308->NbEntities() && PS.More(); i++, PS.Next()) {
|
for (Standard_Integer i=1; i <= st308->NbEntities() && PS.More(); i++)
|
||||||
|
{
|
||||||
|
Message_ProgressRange aRange = PS.Next();
|
||||||
TopoDS_Shape item;
|
TopoDS_Shape item;
|
||||||
if (st308->AssociatedEntity(i).IsNull()) {
|
if (st308->AssociatedEntity(i).IsNull()) {
|
||||||
Message_Msg msg1020("IGES_1020");
|
Message_Msg msg1020("IGES_1020");
|
||||||
@ -338,7 +342,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
item = TransferGeometry(st308->AssociatedEntity(i));
|
item = TransferGeometry (st308->AssociatedEntity(i), aRange);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
item.Nullify();
|
item.Nullify();
|
||||||
@ -372,9 +376,11 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
SendFail(st402f1, msg202);
|
SendFail(st402f1, msg202);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
Message_ProgressSentry PS ( myTP->GetProgress(), "Group item", 0, st402f1->NbEntities(), 1 );
|
Message_ProgressScope PS (theProgress, "Group item", st402f1->NbEntities());
|
||||||
Standard_Boolean ProblemInGroup = Standard_False;
|
Standard_Boolean ProblemInGroup = Standard_False;
|
||||||
for (Standard_Integer i=1; i <= st402f1->NbEntities() && PS.More(); i++, PS.Next()) {
|
for (Standard_Integer i=1; i <= st402f1->NbEntities() && PS.More(); i++)
|
||||||
|
{
|
||||||
|
Message_ProgressRange aRange = PS.Next();
|
||||||
TopoDS_Shape item;
|
TopoDS_Shape item;
|
||||||
if (st402f1->Entity(i).IsNull()) {
|
if (st402f1->Entity(i).IsNull()) {
|
||||||
Message_Msg msg1020("IGES_1020");
|
Message_Msg msg1020("IGES_1020");
|
||||||
@ -392,7 +398,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
item = TransferGeometry(st402f1->Entity(i));
|
item = TransferGeometry (st402f1->Entity(i), aRange);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
item.Nullify();
|
item.Nullify();
|
||||||
@ -435,9 +441,11 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
SendFail(st402f7, msg202);
|
SendFail(st402f7, msg202);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
Message_ProgressSentry PS ( myTP->GetProgress(), "Group item", 0, st402f7->NbEntities(), 1 );
|
Message_ProgressScope PS (theProgress, "Group item", st402f7->NbEntities());
|
||||||
Standard_Boolean ProblemInGroup = Standard_False;
|
Standard_Boolean ProblemInGroup = Standard_False;
|
||||||
for (Standard_Integer i=1; i <= st402f7->NbEntities() && PS.More(); i++, PS.Next()) {
|
for (Standard_Integer i=1; i <= st402f7->NbEntities() && PS.More(); i++)
|
||||||
|
{
|
||||||
|
Message_ProgressRange aRange = PS.Next();
|
||||||
TopoDS_Shape item;
|
TopoDS_Shape item;
|
||||||
if (st402f7->Entity(i).IsNull()) {
|
if (st402f7->Entity(i).IsNull()) {
|
||||||
Message_Msg msg1020("IGES_1020");
|
Message_Msg msg1020("IGES_1020");
|
||||||
@ -455,7 +463,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry
|
|||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
item = TransferGeometry(st402f7->Entity(i));
|
item = TransferGeometry (st402f7->Entity(i), aRange);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
item.Nullify();
|
item.Nullify();
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class Geom_Surface;
|
class Geom_Surface;
|
||||||
class IGESData_IGESModel;
|
class IGESData_IGESModel;
|
||||||
class Transfer_TransientProcess;
|
class Transfer_TransientProcess;
|
||||||
@ -31,7 +33,6 @@ class TopoDS_Shape;
|
|||||||
class IGESData_IGESEntity;
|
class IGESData_IGESEntity;
|
||||||
class Message_Msg;
|
class Message_Msg;
|
||||||
|
|
||||||
|
|
||||||
//! Provides methods to transfer CurveAndSurface from IGES to CASCADE.
|
//! Provides methods to transfer CurveAndSurface from IGES to CASCADE.
|
||||||
class IGESToBRep_CurveAndSurface
|
class IGESToBRep_CurveAndSurface
|
||||||
{
|
{
|
||||||
@ -142,12 +143,14 @@ public:
|
|||||||
//! Returns the result of the transfert of any IGES Curve
|
//! Returns the result of the transfert of any IGES Curve
|
||||||
//! or Surface Entity. If the transfer has failed, this
|
//! or Surface Entity. If the transfer has failed, this
|
||||||
//! member return a NullEntity.
|
//! member return a NullEntity.
|
||||||
Standard_EXPORT TopoDS_Shape TransferCurveAndSurface (const Handle(IGESData_IGESEntity)& start);
|
Standard_EXPORT TopoDS_Shape TransferCurveAndSurface (const Handle(IGESData_IGESEntity)& start,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Returns the result of the transfert the geometry of
|
//! Returns the result of the transfert the geometry of
|
||||||
//! any IGESEntity. If the transfer has failed, this
|
//! any IGESEntity. If the transfer has failed, this
|
||||||
//! member return a NullEntity.
|
//! member return a NullEntity.
|
||||||
Standard_EXPORT TopoDS_Shape TransferGeometry (const Handle(IGESData_IGESEntity)& start);
|
Standard_EXPORT TopoDS_Shape TransferGeometry (const Handle(IGESData_IGESEntity)& start,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Records a new Fail message
|
//! Records a new Fail message
|
||||||
void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
|
void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg);
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include <Interface_Static.hxx>
|
#include <Interface_Static.hxx>
|
||||||
#include <Message_Messenger.hxx>
|
#include <Message_Messenger.hxx>
|
||||||
#include <Message_Msg.hxx>
|
#include <Message_Msg.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <Message_ProgressScope.hxx>
|
||||||
#include <OSD_Timer.hxx>
|
#include <OSD_Timer.hxx>
|
||||||
#include <ShapeAlgo.hxx>
|
#include <ShapeAlgo.hxx>
|
||||||
#include <ShapeAlgo_AlgoContainer.hxx>
|
#include <ShapeAlgo_AlgoContainer.hxx>
|
||||||
@ -368,7 +368,8 @@ static void TrimTolerances (const TopoDS_Shape& shape,
|
|||||||
//function : TransferRoots
|
//function : TransferRoots
|
||||||
//purpose : Transfers all Roots Entities
|
//purpose : Transfers all Roots Entities
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
|
void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
if (theModel.IsNull() || theProc.IsNull()) return;
|
if (theModel.IsNull() || theProc.IsNull()) return;
|
||||||
|
|
||||||
@ -417,8 +418,10 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
|
|||||||
// sln 11.06.2002 OCC448
|
// sln 11.06.2002 OCC448
|
||||||
Interface_Static::SetIVal("read.iges.onlyvisible",onlyvisible);
|
Interface_Static::SetIVal("read.iges.onlyvisible",onlyvisible);
|
||||||
|
|
||||||
Message_ProgressSentry PS ( theProc->GetProgress(), "Root", 0, nb, 1 );
|
Message_ProgressScope PS (theProgress, "Root", nb);
|
||||||
for (Standard_Integer i = 1; i <= nb && PS.More(); i++, PS.Next()) {
|
for (Standard_Integer i = 1; i <= nb && PS.More(); i++)
|
||||||
|
{
|
||||||
|
Message_ProgressRange aRange = PS.Next();
|
||||||
Handle(IGESData_IGESEntity) ent = theModel->Entity(i);
|
Handle(IGESData_IGESEntity) ent = theModel->Entity(i);
|
||||||
if ( SH.IsShared(ent) || ! theActor->Recognize (ent) ) continue;
|
if ( SH.IsShared(ent) || ! theActor->Recognize (ent) ) continue;
|
||||||
if (level > 0) {
|
if (level > 0) {
|
||||||
@ -433,7 +436,7 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
|
|||||||
theDone = Standard_True;
|
theDone = Standard_True;
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
TP.Transfer(ent);
|
TP.Transfer (ent, aRange);
|
||||||
shape = TransferBRep::ShapeResult (theProc,ent);
|
shape = TransferBRep::ShapeResult (theProc,ent);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
@ -478,7 +481,8 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible)
|
|||||||
//function : Transfer
|
//function : Transfer
|
||||||
//purpose : Transfers an Entity given
|
//purpose : Transfers an Entity given
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
|
Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num,
|
||||||
|
const Message_ProgressRange& theProgress)
|
||||||
{
|
{
|
||||||
Handle(Message_Messenger) TF = theProc->Messenger();
|
Handle(Message_Messenger) TF = theProc->Messenger();
|
||||||
theDone = Standard_False;
|
theDone = Standard_False;
|
||||||
@ -501,7 +505,7 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
|
|||||||
|
|
||||||
Handle(IGESData_IGESEntity) ent = theModel->Entity(num);
|
Handle(IGESData_IGESEntity) ent = theModel->Entity(num);
|
||||||
|
|
||||||
Message_ProgressSentry PS ( theProc->GetProgress(), "OneEnt", 0, 1, 1 ); //skl
|
Message_ProgressScope aPS(theProgress, "OneEnt", 2);
|
||||||
|
|
||||||
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
XSAlgo::AlgoContainer()->PrepareForTransfer();
|
||||||
IGESToBRep_CurveAndSurface CAS;
|
IGESToBRep_CurveAndSurface CAS;
|
||||||
@ -543,7 +547,9 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
shape = CAS.TransferGeometry (ent);
|
shape = CAS.TransferGeometry (ent, aPS.Next());
|
||||||
|
if (aPS.UserBreak())
|
||||||
|
return Standard_False;
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const&) {
|
catch(Standard_Failure const&) {
|
||||||
Message_Msg msg1015("IGES_1015");
|
Message_Msg msg1015("IGES_1015");
|
||||||
@ -559,7 +565,10 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
|
|||||||
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, eps*CAS.GetUnitFactor(), CAS.GetMaxTol(),
|
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, eps*CAS.GetUnitFactor(), CAS.GetMaxTol(),
|
||||||
"read.iges.resource.name",
|
"read.iges.resource.name",
|
||||||
"read.iges.sequence", info,
|
"read.iges.sequence", info,
|
||||||
theProc->GetProgress() );
|
aPS.Next() );
|
||||||
|
if (aPS.UserBreak())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
XSAlgo::AlgoContainer()->MergeTransferInfo(theProc, info, nbTPitems);
|
XSAlgo::AlgoContainer()->MergeTransferInfo(theProc, info, nbTPitems);
|
||||||
|
|
||||||
ShapeExtend_Explorer SBE;
|
ShapeExtend_Explorer SBE;
|
||||||
@ -576,8 +585,6 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PS.Relieve(); //skl
|
|
||||||
|
|
||||||
char t [20];
|
char t [20];
|
||||||
t[0]='\0';
|
t[0]='\0';
|
||||||
Standard_Real second, cpu;
|
Standard_Real second, cpu;
|
||||||
|
@ -26,12 +26,13 @@
|
|||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#include <Standard_CString.hxx>
|
#include <Standard_CString.hxx>
|
||||||
#include <Standard_Real.hxx>
|
#include <Standard_Real.hxx>
|
||||||
|
#include <Message_ProgressRange.hxx>
|
||||||
|
|
||||||
class IGESData_IGESModel;
|
class IGESData_IGESModel;
|
||||||
class IGESToBRep_Actor;
|
class IGESToBRep_Actor;
|
||||||
class Transfer_TransientProcess;
|
class Transfer_TransientProcess;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
|
|
||||||
|
|
||||||
//! A simple way to read geometric IGES data.
|
//! A simple way to read geometric IGES data.
|
||||||
//! Encapsulates reading file and calling transfer tools
|
//! Encapsulates reading file and calling transfer tools
|
||||||
class IGESToBRep_Reader
|
class IGESToBRep_Reader
|
||||||
@ -79,12 +80,14 @@ public:
|
|||||||
//! IGES file. Standard_True is the default value and means that only
|
//! IGES file. Standard_True is the default value and means that only
|
||||||
//! visible root entities are translated. Standard_False
|
//! visible root entities are translated. Standard_False
|
||||||
//! translates all of the roots (visible and invisible).
|
//! translates all of the roots (visible and invisible).
|
||||||
Standard_EXPORT void TransferRoots (const Standard_Boolean onlyvisible = Standard_True);
|
Standard_EXPORT void TransferRoots (const Standard_Boolean onlyvisible = Standard_True,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Transfers an Entity given its rank in the Model (Root or not)
|
//! Transfers an Entity given its rank in the Model (Root or not)
|
||||||
//! Returns True if it is recognized as Geom-Topol.
|
//! Returns True if it is recognized as Geom-Topol.
|
||||||
//! (But it can have failed : see IsDone)
|
//! (But it can have failed : see IsDone)
|
||||||
Standard_EXPORT Standard_Boolean Transfer (const Standard_Integer num);
|
Standard_EXPORT Standard_Boolean Transfer (const Standard_Integer num,
|
||||||
|
const Message_ProgressRange& theProgress = Message_ProgressRange());
|
||||||
|
|
||||||
//! Returns True if the LAST Transfer/TransferRoots was a success
|
//! Returns True if the LAST Transfer/TransferRoots was a success
|
||||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user