mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
5
src/TestTopOpeTools/FILES
Executable file
5
src/TestTopOpeTools/FILES
Executable file
@@ -0,0 +1,5 @@
|
||||
FILES
|
||||
TestTopOpeTools_Trace.hxx
|
||||
TestTopOpeTools_Trace.cxx
|
||||
TestTopOpeTools_TraceCommands.cxx
|
||||
TestTopOpeTools_OtherCommands.cxx
|
100
src/TestTopOpeTools/TestTopOpeTools.cdl
Executable file
100
src/TestTopOpeTools/TestTopOpeTools.cdl
Executable file
@@ -0,0 +1,100 @@
|
||||
-- File: TestTopOpeTools.cdl
|
||||
-- Created: Tue Apr 26 10:35:42 1994
|
||||
-- Author: Jean Yves LEBEY
|
||||
-- <jyl@phobox>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
package TestTopOpeTools
|
||||
|
||||
---Purpose:
|
||||
--
|
||||
-- Provide Trace control on packages involved in
|
||||
-- topological operations kernel, from Draw command interpretor.
|
||||
--
|
||||
-- They may be used by users of topological operation kernel, such as :
|
||||
--
|
||||
-- * topological operation performer,
|
||||
-- * hidden line removal performer,
|
||||
-- * fillet, chamfer performer
|
||||
--
|
||||
-- Trace control consists in management of
|
||||
-- control functions, activating/desactivating execution of
|
||||
-- instructions considered as purely PASSIVE code,
|
||||
-- performing dumps, prints, and drawing of internal objects
|
||||
-- dealed by some topological operation packages.
|
||||
--
|
||||
-- All of the Trace controls in top.ope. kernel
|
||||
-- are enclosed by the C conditional compilation statements :
|
||||
-- #ifdef DEB ... #endif
|
||||
--
|
||||
-- The "Traced" packages of topological operation kernel are :
|
||||
-- - TopBuild
|
||||
-- - TopOpeBRepTool
|
||||
-- - TopOpeBRepDS
|
||||
--
|
||||
-- How to use the Trace :
|
||||
-- ----------------------
|
||||
--
|
||||
-- In a Test.cxx program using the Draw command interpretor, dealing
|
||||
-- a set of commands theCommands (Draw_CommandManager theCommands) :
|
||||
--
|
||||
-- TestTopOpeTools::TraceCommands();
|
||||
--
|
||||
-- Compile your Test.cxx, run and then, under the command manager prompt :
|
||||
--
|
||||
-- Trace : prints the list of the Trace flags available on top.ope. kernel
|
||||
-- Trace <flag> : activates Trace code of <flag>
|
||||
-- Trace <flag> <1 | 0> : activates/desactivates Trace code of <flag>
|
||||
-- Trace <1 | 0> : activates/desactivates all Trace code of top.ope. kernel
|
||||
--
|
||||
-- How to add Traces :
|
||||
-- -------------------
|
||||
--
|
||||
-- It it possible to add your own "Traced" portions of code in your code.
|
||||
-- In your test program, simply add :
|
||||
--
|
||||
-- #include <TestTopOpeTools_AddTrace.hxx>
|
||||
--
|
||||
-- and see the file TestTopOpeTools_Trace.hxx for explanations.
|
||||
|
||||
|
||||
uses
|
||||
|
||||
MMgt,
|
||||
TopoDS,
|
||||
Draw,
|
||||
DrawTrSurf,
|
||||
DBRep,
|
||||
TCollection,
|
||||
Geom,
|
||||
gp,
|
||||
TColgp,
|
||||
Standard,
|
||||
TopTrans,
|
||||
TColStd
|
||||
|
||||
is
|
||||
|
||||
class Mesure;
|
||||
|
||||
pointer PMesure to Mesure from TestTopOpeTools;
|
||||
class Array1OfMesure instantiates Array1 from TCollection
|
||||
(Mesure from TestTopOpeTools);
|
||||
|
||||
class HArray1OfMesure instantiates HArray1 from TCollection
|
||||
(Mesure from TestTopOpeTools, Array1OfMesure from TestTopOpeTools);
|
||||
|
||||
AllCommands(I : in out Interpretor from Draw);
|
||||
---Purpose: Defines all topological operation test commands
|
||||
|
||||
|
||||
TraceCommands(I : in out Interpretor from Draw);
|
||||
---Purpose: Defines the dump commands on
|
||||
-- topological operation packages.
|
||||
|
||||
OtherCommands(I : in out Interpretor from Draw);
|
||||
---Purpose: Defines auxiliary commands
|
||||
|
||||
|
||||
end TestTopOpeTools;
|
17
src/TestTopOpeTools/TestTopOpeTools.cxx
Executable file
17
src/TestTopOpeTools/TestTopOpeTools.cxx
Executable file
@@ -0,0 +1,17 @@
|
||||
// File: TestTopOpeTools.cxx
|
||||
// Created: Mon Oct 24 13:33:04 1994
|
||||
// Author: Jean Yves LEBEY
|
||||
// <jyl@bravox>
|
||||
|
||||
#include <TestTopOpeTools.ixx>
|
||||
|
||||
//=======================================================================
|
||||
//function : AllCommands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TestTopOpeTools::AllCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
TestTopOpeTools::TraceCommands(theCommands);
|
||||
TestTopOpeTools::OtherCommands(theCommands);
|
||||
}
|
49
src/TestTopOpeTools/TestTopOpeTools_Mesure.cdl
Executable file
49
src/TestTopOpeTools/TestTopOpeTools_Mesure.cdl
Executable file
@@ -0,0 +1,49 @@
|
||||
-- File: TestTopOpeTools_Mesure.cdl
|
||||
-- Created: Wed Mar 19 09:07:20 1997
|
||||
-- Author: Prestataire Mary FABIEN
|
||||
-- <fbi@langdox.paris1.matra-dtv.fr>
|
||||
---Copyright: Matra Datavision 1997
|
||||
|
||||
class Mesure from TestTopOpeTools
|
||||
|
||||
uses
|
||||
|
||||
AsciiString from TCollection,
|
||||
Array1OfPnt from TColgp,
|
||||
HArray1OfPnt from TColgp,
|
||||
Pnt from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns Mesure from TestTopOpeTools;
|
||||
|
||||
Create(name : AsciiString from TCollection)
|
||||
returns Mesure from TestTopOpeTools;
|
||||
|
||||
Create(Pnts : HArray1OfPnt from TColgp)
|
||||
returns Mesure from TestTopOpeTools;
|
||||
|
||||
Add(me :in out; n : in Integer from Standard; t : in Real from Standard);
|
||||
|
||||
SetName(me : in out; Name : AsciiString from TCollection);
|
||||
|
||||
Name(me) returns AsciiString from TCollection;
|
||||
---C++: return const&
|
||||
|
||||
Pnts(me) returns Array1OfPnt from TColgp;
|
||||
---C++: return const&
|
||||
|
||||
Pnt(me; I : in Integer) returns Pnt from gp;
|
||||
---C++: return const&
|
||||
|
||||
NPnts(me) returns Integer from Standard;
|
||||
|
||||
Clear(me : in out);
|
||||
|
||||
fields
|
||||
|
||||
myName : AsciiString from TCollection;
|
||||
myPnts : HArray1OfPnt from TColgp;
|
||||
myNPnts : Integer from Standard;
|
||||
|
||||
end Mesure from TestTopOpeTools;
|
128
src/TestTopOpeTools/TestTopOpeTools_Mesure.cxx
Executable file
128
src/TestTopOpeTools/TestTopOpeTools_Mesure.cxx
Executable file
@@ -0,0 +1,128 @@
|
||||
// File: TestTopOpeTools_Mesure.cxx
|
||||
// Created: Mon Mar 17 13:33:03 1997
|
||||
// Author: Prestataire Mary FABIEN
|
||||
// <fbi@langdox.paris1.matra-dtv.fr>
|
||||
|
||||
#include <TestTopOpeTools_Mesure.ixx>
|
||||
#include <TestTopOpeTools_Mesure.hxx>
|
||||
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColgp_HArray1OfPnt.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <Handle_Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TestTopOpeTools_Mesure
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TestTopOpeTools_Mesure::TestTopOpeTools_Mesure()
|
||||
:myPnts(new TColgp_HArray1OfPnt(1,100)),myNPnts(0){}
|
||||
|
||||
//=======================================================================
|
||||
//function : TestTopOpeTools_Mesure
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TestTopOpeTools_Mesure::TestTopOpeTools_Mesure
|
||||
(const TCollection_AsciiString& Name)
|
||||
: myName(Name),myPnts(new TColgp_HArray1OfPnt(1,100)),myNPnts(0)
|
||||
{
|
||||
myNPnts = 1;
|
||||
myPnts->SetValue(myNPnts,gp_Pnt(0.,0.,0.));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TestTopOpeTools_Mesure
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TestTopOpeTools_Mesure::TestTopOpeTools_Mesure
|
||||
(const Handle(TColgp_HArray1OfPnt)& P)
|
||||
: myName(""),myPnts(new TColgp_HArray1OfPnt(1,100)),myNPnts(0)
|
||||
{
|
||||
myPnts = P;
|
||||
myNPnts = myPnts->Length();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TestTopOpeTools_Mesure::Add(const Standard_Integer n,
|
||||
const Standard_Real t)
|
||||
{
|
||||
if (myPnts.IsNull()) return;
|
||||
if (myNPnts+1 > myPnts->Upper()) {
|
||||
Handle(TColgp_HArray1OfPnt) Ploc = new TColgp_HArray1OfPnt(1,10*myNPnts);
|
||||
for(Standard_Integer i = 1;i <= myNPnts;i++)
|
||||
Ploc->SetValue(i,myPnts->Value(i));
|
||||
myPnts->ChangeArray1() = Ploc->Array1();
|
||||
}
|
||||
myNPnts++;
|
||||
myPnts->SetValue(myNPnts,gp_Pnt((Standard_Real)n,t,0.));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Name
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TCollection_AsciiString& TestTopOpeTools_Mesure::Name() const
|
||||
{
|
||||
return myName;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Name
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TestTopOpeTools_Mesure::SetName(const TCollection_AsciiString& Name)
|
||||
{
|
||||
myName = Name;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Pnts
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const TColgp_Array1OfPnt& TestTopOpeTools_Mesure::Pnts() const
|
||||
{
|
||||
return myPnts->Array1();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Pnt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const gp_Pnt& TestTopOpeTools_Mesure::Pnt(const Standard_Integer I) const
|
||||
{
|
||||
return myPnts->Value(I);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NPnts
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer TestTopOpeTools_Mesure::NPnts() const
|
||||
{
|
||||
return myNPnts;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TestTopOpeTools_Mesure::Clear()
|
||||
{
|
||||
myNPnts = 0;
|
||||
}
|
15
src/TestTopOpeTools/TestTopOpeTools_OtherCommands.cxx
Executable file
15
src/TestTopOpeTools/TestTopOpeTools_OtherCommands.cxx
Executable file
@@ -0,0 +1,15 @@
|
||||
// File: TestTopOpeTools_OtherCommands.cxx
|
||||
// Created: Fri Feb 2 15:30:24 1996
|
||||
// Author: Jean Yves LEBEY
|
||||
// <jyl@meteox>
|
||||
|
||||
#include <TestTopOpeTools.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : OtherCommands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TestTopOpeTools::OtherCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
}
|
174
src/TestTopOpeTools/TestTopOpeTools_Trace.cxx
Executable file
174
src/TestTopOpeTools/TestTopOpeTools_Trace.cxx
Executable file
@@ -0,0 +1,174 @@
|
||||
// File: TestTopOpeTools_Trace.cxx
|
||||
// Created: Mon Aug 1 12:13:25 1994
|
||||
// Author: Jean Yves LEBEY
|
||||
// <jyl@meteox>
|
||||
|
||||
#include <TestTopOpeTools_Trace.hxx>
|
||||
|
||||
TestTopOpeTools_Trace::TestTopOpeTools_Trace
|
||||
(const Standard_Integer nbmaxentry,
|
||||
const TCollection_AsciiString& genre) :
|
||||
mygenre(genre),
|
||||
myfirstentry(1),mynbmaxentry(nbmaxentry),mynbentries(0),
|
||||
myflag(myfirstentry,mynbmaxentry),
|
||||
myfunc(myfirstentry,mynbmaxentry),
|
||||
myftyp(myfirstentry,mynbmaxentry),
|
||||
myverbose(Standard_False),
|
||||
myfverbose(myfirstentry,mynbmaxentry)
|
||||
{}
|
||||
|
||||
TestTopOpeTools_Trace::TestTopOpeTools_Trace
|
||||
(const Standard_Integer nbmaxentry) :
|
||||
mygenre("flag"),
|
||||
myfirstentry(1),mynbmaxentry(nbmaxentry),mynbentries(0),
|
||||
myflag(myfirstentry,mynbmaxentry),
|
||||
myfunc(myfirstentry,mynbmaxentry),
|
||||
myftyp(myfirstentry,mynbmaxentry),
|
||||
myverbose(Standard_False),
|
||||
myfverbose(myfirstentry,mynbmaxentry)
|
||||
{}
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::Add
|
||||
(const t_flag flag,tf_value func)
|
||||
{ return Add(flag,(tf_value)func,te_value); }
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::SetVerbose
|
||||
(const Standard_Boolean b)
|
||||
{ myverbose = b; return 0;}
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::SetVerbose
|
||||
(const t_flag flag,const Standard_Boolean b)
|
||||
{
|
||||
Standard_Integer index;
|
||||
if ( !Exist(flag,index) ) return 1;
|
||||
if (b) cout<<"set "<<mygenre<<" "<<flag<<" verbose"<<endl;
|
||||
else cout<<"set "<<mygenre<<" "<<flag<<" not verbose"<<endl;
|
||||
myfverbose.SetValue(index,b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::Set
|
||||
(const Standard_Integer mute,const t_flag flag,const t_value value)
|
||||
{
|
||||
Standard_Integer index;
|
||||
if ( !Exist(flag,index) ) return 1;
|
||||
if (mute==0) {
|
||||
if (value) cout<<"activation de "<<mygenre<<" "<<flag<<endl;
|
||||
else cout<<"desactivation de "<<mygenre<<" "<<flag<<endl;
|
||||
}
|
||||
(*((tf_value)Getfunc(index)))(value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::Add
|
||||
(const t_flag flag,tf_intarg func)
|
||||
{ return Add(flag,(tf_value)func,te_intarg); }
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::Add
|
||||
(const t_flag flag,tf_int_intarg func)
|
||||
{ return Add(flag,(tf_value)func,te_int_intarg); }
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::Set
|
||||
(const Standard_Integer mute,const t_flag flag, const t_value value,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
Standard_Integer index;
|
||||
if ( !Exist(flag,index) ) return 1;
|
||||
if ( Getftyp(index) == te_intarg ) {
|
||||
(*((tf_intarg)Getfunc(index)))(value,n,a);
|
||||
if (mute==0) {
|
||||
cout<<mygenre<<" "<<flag<<" active avec :";
|
||||
cout<<" "<<value;
|
||||
for(Standard_Integer i=0;i<n;i++) cout<<" "<<a[i];
|
||||
cout<<endl;
|
||||
}
|
||||
}
|
||||
else if ( Getftyp(index) == te_int_intarg ) {
|
||||
Standard_Integer err = (*((tf_int_intarg)Getfunc(index)))(value,n,a);
|
||||
if (err) {
|
||||
cout<<"ERREUR activation de "<<mygenre<<" "<<flag<<" "<<value;
|
||||
for(Standard_Integer i=0;i<n;i++) cout<<" "<<a[i];cout<<endl;
|
||||
}
|
||||
else {
|
||||
if (mute==0) {
|
||||
cout<<mygenre<<" "<<flag<<" active avec :";
|
||||
cout<<" "<<value;
|
||||
for(Standard_Integer i=0;i<n;i++) cout<<" "<<a[i];
|
||||
cout<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( Getftyp(index) == te_value ) {
|
||||
return Set(mute,flag,value);
|
||||
}
|
||||
else {
|
||||
cout<<"TestTopOpeTools_Trace::Set : unknown function type"<<endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TestTopOpeTools_Trace::Dump()
|
||||
{
|
||||
for (Standard_Integer i=myfirstentry; i<=mynbentries; i++) {
|
||||
if (i==myfirstentry) cout<<"Defined "<<mygenre<<"s :";
|
||||
cout<<" "<<Getflag(i);
|
||||
if (i==mynbentries) cout<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
void TestTopOpeTools_Trace::Reset(const t_value value)
|
||||
{
|
||||
for (Standard_Integer i=myfirstentry;i<=mynbentries;i++)
|
||||
if (Getftyp(i)==te_value)
|
||||
(*((tf_value)Getfunc(i)))(value);
|
||||
else if (Getftyp(i)==te_intarg)
|
||||
(*((tf_intarg)Getfunc(i)))(value,0,NULL);
|
||||
else if (Getftyp(i)==te_int_intarg)
|
||||
(*((tf_int_intarg)Getfunc(i)))(value,0,NULL);
|
||||
}
|
||||
|
||||
// ==== Private
|
||||
|
||||
Standard_Boolean TestTopOpeTools_Trace::Exist
|
||||
(const t_flag flag, Standard_Integer& index)
|
||||
{
|
||||
for (Standard_Integer i=myfirstentry; i<=mynbentries; i++)
|
||||
if (myflag.Value(i).IsEqual(flag)) { index = i; return Standard_True; }
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Standard_Boolean TestTopOpeTools_Trace::Exist
|
||||
(const tf_value func, Standard_Integer& index)
|
||||
{
|
||||
for (Standard_Integer i=myfirstentry; i<=mynbentries; i++)
|
||||
if (myfunc.Value(i) == ((long)func)) { index = i; return Standard_True; }
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
const t_flag TestTopOpeTools_Trace::Getflag(const Standard_Integer index)
|
||||
{ return (t_flag)myflag.Value(index); }
|
||||
|
||||
const tf_value TestTopOpeTools_Trace::Getfunc(const Standard_Integer index)
|
||||
{ return (tf_value)myfunc.Value(index); }
|
||||
|
||||
const te_ftyp TestTopOpeTools_Trace::Getftyp(const Standard_Integer index)
|
||||
{
|
||||
//JR/Hp :
|
||||
Standard_Integer intenum = myftyp.Value(index);
|
||||
return (te_ftyp) intenum ;
|
||||
// return (te_ftyp) myftyp.Value(index);
|
||||
}
|
||||
|
||||
Standard_Integer TestTopOpeTools_Trace::Add
|
||||
(const t_flag flag, const tf_value func, const te_ftyp ftyp)
|
||||
{
|
||||
Standard_Integer index;
|
||||
if ( Exist(flag,index) || ( mynbentries >= mynbmaxentry) ) return 1;
|
||||
mynbentries++;
|
||||
myflag.SetValue(mynbentries,flag);
|
||||
myfunc.SetValue(mynbentries,(long)func);
|
||||
myftyp.SetValue(mynbentries,(Standard_Integer)ftyp);
|
||||
myfverbose.SetValue(mynbentries,Standard_False);
|
||||
return 0;
|
||||
}
|
123
src/TestTopOpeTools/TestTopOpeTools_Trace.hxx
Executable file
123
src/TestTopOpeTools/TestTopOpeTools_Trace.hxx
Executable file
@@ -0,0 +1,123 @@
|
||||
// File: TestTopOpeTools_Trace.hxx
|
||||
// Created: Mon Aug 1 12:13:25 1994
|
||||
// Author: Jean Yves LEBEY
|
||||
// <jyl@meteox>
|
||||
|
||||
|
||||
#ifndef _TestTopOpeTools_Trace_HeaderFile
|
||||
#define _TestTopOpeTools_Trace_HeaderFile
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_Array1OfAsciiString.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TColStd_Array1OfBoolean.hxx>
|
||||
|
||||
typedef Standard_Boolean t_value;
|
||||
typedef TCollection_AsciiString t_flag;
|
||||
|
||||
typedef void (*tf_value)(const t_value);
|
||||
typedef void (*tf_intarg)(const t_value, Standard_Integer, const char**);
|
||||
typedef Standard_Integer (*tf_int_intarg)(const t_value, Standard_Integer, const char**);
|
||||
|
||||
typedef enum te_ftyp { te_value, te_intarg, te_int_intarg } te_ftyp;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Une fonction de trace FT est une fonction qui value un ensemble
|
||||
// de variables de controle dont la valeur conditionne l execution
|
||||
// d un ensemble d instructions.
|
||||
//
|
||||
// La classe TestTopOpeTools_Trace permet de coupler un nom, ou flag,
|
||||
// a une fonction de trace, et de stocker une ensemble de tels couples.
|
||||
// Un flag est une chaine de caracteres qui identifie la fonction.
|
||||
//
|
||||
// 1/ trace simple
|
||||
// Une fonction de trace simple consiste a valuer une valeur booleenne.
|
||||
// le type t_value est defini comme Standard_Boolean
|
||||
// le type tf_value decrit une fonction de trace a un argument de type t_value.
|
||||
//
|
||||
// Creation de l objet de trace T :
|
||||
// TestTopOpeTools_Trace T;
|
||||
//
|
||||
// Ajouter une fonction de trace FT1 de nom "toto" a l objet de trace T :
|
||||
// Ajout de la fonction de trace FT2 de nom "titi" a l objet de trace T :
|
||||
//
|
||||
// Standard_IMPORT void FT1(const Standard_Boolean);
|
||||
// Standard_IMPORT void FT2(const Standard_Boolean);
|
||||
// T.Add("toto",(tf_value)FT1);
|
||||
// T.Add("titi",(tf_value)FT2);
|
||||
//
|
||||
// Valuation a Standard_True de la variable de controle gouvernee par FT1 :
|
||||
//
|
||||
// T.Set("toto",Standard_True);
|
||||
//
|
||||
// 2/ trace generale
|
||||
// Une fonction de trace generale prend 3 arguments :
|
||||
// - Standard_Boolean b
|
||||
// - Standard_Integer n
|
||||
// - char **a
|
||||
//
|
||||
// le type tf_intarg represente une telle fonction de trace
|
||||
//
|
||||
// Ajouter une fonction de trace FT3 de nom "aaaaaa" a l objet de trace T :
|
||||
//
|
||||
// Standard_IMPORT void FT3(const Standard_Boolean,const Standard_Integer,const char**);
|
||||
// T.Add((tf_intarg)FT3);
|
||||
//
|
||||
// Chargement de la fonction de trace FT3 par b,n,a :
|
||||
// T.Set("aaaaaa",b,n,a);
|
||||
//
|
||||
//
|
||||
// TestTopOpeTools.hxx definit l objet theTrace (classe TestTopOpeTools_Trace)
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class TestTopOpeTools_Trace {
|
||||
|
||||
public:
|
||||
|
||||
TestTopOpeTools_Trace(const Standard_Integer nbmaxentry,
|
||||
const TCollection_AsciiString& genre);
|
||||
TestTopOpeTools_Trace(const Standard_Integer nbmaxentry);
|
||||
|
||||
Standard_Integer Add(const t_flag flag, tf_value func);
|
||||
Standard_Integer SetVerbose(const Standard_Boolean b);
|
||||
Standard_Integer SetVerbose(const t_flag flag, const Standard_Boolean b);
|
||||
Standard_Integer Set(const Standard_Integer mute,
|
||||
const t_flag flag, const t_value value);
|
||||
|
||||
Standard_Integer Add(const t_flag flag, tf_intarg func);
|
||||
Standard_Integer Add(const t_flag flag, tf_int_intarg func);
|
||||
Standard_Integer Set(const Standard_Integer mute,
|
||||
const t_flag flag, const t_value value,
|
||||
Standard_Integer narg, const char** args);
|
||||
|
||||
void Dump();
|
||||
void Reset(const t_value);
|
||||
Standard_Boolean IsEmpty() { return (mynbentries == 0); }
|
||||
const TCollection_AsciiString& Genre() { return mygenre; }
|
||||
|
||||
Standard_Boolean Exist(const t_flag flag, Standard_Integer& index);
|
||||
Standard_Boolean Exist(const tf_value func, Standard_Integer& index);
|
||||
|
||||
private:
|
||||
|
||||
// ==== Methods
|
||||
|
||||
const t_flag Getflag(const Standard_Integer index);
|
||||
const tf_value Getfunc(const Standard_Integer index);
|
||||
const te_ftyp Getftyp(const Standard_Integer index);
|
||||
Standard_Integer Add(const t_flag flag,const tf_value func,const te_ftyp ftyp);
|
||||
|
||||
// ==== Fields
|
||||
|
||||
TCollection_AsciiString mygenre;
|
||||
Standard_Integer myfirstentry,mynbmaxentry,mynbentries;
|
||||
TColStd_Array1OfAsciiString myflag;
|
||||
TColStd_Array1OfInteger myfunc;
|
||||
TColStd_Array1OfInteger myftyp;
|
||||
Standard_Boolean myverbose;
|
||||
TColStd_Array1OfBoolean myfverbose;
|
||||
};
|
||||
|
||||
#endif
|
331
src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx
Executable file
331
src/TestTopOpeTools/TestTopOpeTools_TraceCommands.cxx
Executable file
@@ -0,0 +1,331 @@
|
||||
// File: TestTopOpeTools_TraceCommands.cxx
|
||||
// Created: Mon Oct 24 10:33:16 1994
|
||||
// Author: Jean Yves LEBEY
|
||||
// <jyl@bravox>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <TestTopOpeTools.hxx>
|
||||
#include <TestTopOpeTools_Trace.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <Draw_Appli.hxx>
|
||||
#include <TopOpeBRepTool_define.hxx>
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEB
|
||||
TestTopOpeTools_Trace theTrace(100,"trace");
|
||||
TestTopOpeTools_Trace theContext(100,"context");
|
||||
|
||||
Standard_IMPORT void TopClass_SettraceFC(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceEND(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceKRO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SetcontextNOSEW(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SetcontextNOPNC(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceEDSF(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDSP(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDSF(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDSFK(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDSNC(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDSLT(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDEGEN(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceDSFD(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettracePCI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettracePEI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettracePFI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettracePI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceSTRANGE(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceGAP(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SetcontextNOGAP(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SettraceFITOL(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SettraceBIPS(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SettraceSI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SettraceSIFF(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRep_SettraceSAVFF(const Standard_Boolean);
|
||||
Standard_IMPORT Standard_Integer TopOpeBRep_SettraceNVP(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT Standard_Integer TopOpeBRep_SettraceEEFF(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT Standard_Integer TopOpeBRep_SettraceSHA(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextREST1(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextREST2(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextINL(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextNEWKP(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextTOL0(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextNONOG(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceCHK(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceCHKOK(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceCHKNOK(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceCU(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceCUV(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceSPSX(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceCX(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceSPSXX(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceSPF(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceSPS(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceSHEX(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceSS(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceAREA(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceKPB(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettracePURGE(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceSAVFREGU(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceSAVSREGU(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOSG(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SettraceFE(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextSSCONNEX(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextSF2(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextSPEON(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOPURGE(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOREGUFA(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOREGUSO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextREGUXPU(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOCORRISO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOFUFA(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextNOFE(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextEINTERNAL(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepBuild_SetcontextEEXTERNAL(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceNYI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceVC(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettracePCURV(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceBOXPERSO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceBOX(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCLOV(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCHKBSPL(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceREGUFA(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceREGUSO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceC2D(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCORRISO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SettraceCONIC(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SettracePROEDG(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextNOPROEDG(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextFFOR(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextNOPUNK(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRep_SetcontextNOFEI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCL2DDR(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCL2DPR(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCL3DDR(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepTool_SettraceCL3DPR(const Standard_Boolean, Standard_Integer, char**);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceBUTO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceTRPE(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceEDPR(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceISTO(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SettraceSANTRAN(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SetcontextNOPFI(const Standard_Boolean);
|
||||
Standard_IMPORT void TopOpeBRepDS_SetcontextMKTONREG(const Standard_Boolean);
|
||||
#endif
|
||||
|
||||
#ifdef DEB
|
||||
//----------------------------------------------------------------------------
|
||||
static Standard_Integer InitTraceTopOpeKernel (TestTopOpeTools_Trace& T)
|
||||
//----------------------------------------------------------------------------
|
||||
{
|
||||
if (T.Add("tfc",(tf_value)TopClass_SettraceFC)) return 1;
|
||||
if (T.Add("tend",(tf_value)TopOpeBRepTool_SettraceEND)) return 1;
|
||||
if (T.Add("tkro",(tf_value)TopOpeBRepTool_SettraceKRO)) return 1;
|
||||
if (T.Add("tdsfk",(tf_value)TopOpeBRepDS_SettraceDSFK)) return 1;
|
||||
if (T.Add("tedsf",(tf_value)TopOpeBRepDS_SettraceEDSF)) return 1;
|
||||
if (T.Add("tdsp",(tf_value)TopOpeBRepDS_SettraceDSP)) return 1;
|
||||
if (T.Add("tdsf",(tf_value)TopOpeBRepDS_SettraceDSF)) return 1;
|
||||
if (T.Add("tdsnc",(tf_value)TopOpeBRepDS_SettraceDSNC)) return 1;
|
||||
if (T.Add("tdegen",(tf_value)TopOpeBRepDS_SettraceDEGEN)) return 1;
|
||||
if (T.Add("tdslt",(tf_value)TopOpeBRepDS_SettraceDSLT)) return 1;
|
||||
if (T.Add("tdsfd",(tf_value)TopOpeBRepDS_SettraceDSFD)) return 1;
|
||||
if (T.Add("tpci",(tf_value)TopOpeBRepDS_SettracePCI)) return 1;
|
||||
if (T.Add("tpei",(tf_value)TopOpeBRepDS_SettracePEI)) return 1;
|
||||
if (T.Add("tpfi",(tf_value)TopOpeBRepDS_SettracePFI)) return 1;
|
||||
if (T.Add("tpi",(tf_value)TopOpeBRepDS_SettracePI)) return 1;
|
||||
if (T.Add("tstrange",(tf_value)TopOpeBRepDS_SettraceSTRANGE)) return 1;
|
||||
if (T.Add("tgap",(tf_value)TopOpeBRepDS_SettraceGAP)) return 1;
|
||||
if (T.Add("tfitol",(tf_value)TopOpeBRep_SettraceFITOL)) return 1;
|
||||
if (T.Add("tbips",(tf_value)TopOpeBRep_SettraceBIPS)) return 1;
|
||||
if (T.Add("tsi",(tf_value)TopOpeBRep_SettraceSI)) return 1;
|
||||
if (T.Add("tsiff",(tf_intarg)TopOpeBRep_SettraceSIFF)) return 1; // tsiff 0|[1 s1 s2 name]
|
||||
if (T.Add("tsavff",(tf_value)TopOpeBRep_SettraceSAVFF)) return 1;
|
||||
if (T.Add("tnvp",(tf_int_intarg)TopOpeBRep_SettraceNVP)) return 1; // tnvp 0|1 if1 if2 ili ivp isi
|
||||
if (T.Add("teeff",(tf_int_intarg)TopOpeBRep_SettraceEEFF)) return 1; // teeff 0|1 ie1 ie2 if1 if2
|
||||
if (T.Add("tsha",(tf_int_intarg)TopOpeBRep_SettraceSHA)) return 1; // tsha 0|1 isha
|
||||
if (T.Add("tchk",(tf_value)TopOpeBRepBuild_SettraceCHK)) return 1;
|
||||
if (T.Add("tok",(tf_value)TopOpeBRepBuild_SettraceCHKOK)) return 1;
|
||||
if (T.Add("tnok",(tf_value)TopOpeBRepBuild_SettraceCHKNOK)) return 1;
|
||||
if (T.Add("tcu",(tf_value)TopOpeBRepBuild_SettraceCU)) return 1;
|
||||
if (T.Add("tcuv",(tf_value)TopOpeBRepBuild_SettraceCUV)) return 1;
|
||||
if (T.Add("tcx",(tf_intarg)TopOpeBRepDS_SettraceCX)) return 1; // tcx 0|1 [i1 ...]
|
||||
if (T.Add("tspsx",(tf_intarg)TopOpeBRepDS_SettraceSPSX)) return 1; // tspsx 0|1 [i1 ...]
|
||||
if (T.Add("tspsxx",(tf_intarg)TopOpeBRepDS_SettraceSPSXX)) return 1; // tspsxx 0|1 [i1 i2]
|
||||
if (T.Add("tspf",(tf_value)TopOpeBRepBuild_SettraceSPF)) return 1; // splitface
|
||||
if (T.Add("tsps",(tf_value)TopOpeBRepBuild_SettraceSPS)) return 1; // splitsolid
|
||||
if (T.Add("tshex",(tf_value)TopOpeBRepBuild_SettraceSHEX)) return 1;
|
||||
if (T.Add("tss",(tf_value)TopOpeBRepBuild_SettraceSS)) return 1;
|
||||
if (T.Add("tarea",(tf_value)TopOpeBRepBuild_SettraceAREA)) return 1;
|
||||
if (T.Add("tkpb",(tf_value)TopOpeBRepBuild_SettraceKPB)) return 1;
|
||||
if (T.Add("tpurge",(tf_value)TopOpeBRepBuild_SettracePURGE)) return 1;
|
||||
if (T.Add("tsavfregu",(tf_value)TopOpeBRepBuild_SettraceSAVFREGU)) return 1;
|
||||
if (T.Add("tsavsregu",(tf_value)TopOpeBRepBuild_SettraceSAVSREGU)) return 1;
|
||||
if (T.Add("tfe",(tf_value)TopOpeBRepBuild_SettraceFE)) return 1;
|
||||
if (T.Add("tnyi",(tf_value)TopOpeBRepTool_SettraceNYI)) return 1;
|
||||
if (T.Add("tvc",(tf_value)TopOpeBRepTool_SettraceVC)) return 1;
|
||||
if (T.Add("tpcurv",(tf_value)TopOpeBRepTool_SettracePCURV)) return 1;
|
||||
if (T.Add("tbp",(tf_value)TopOpeBRepTool_SettraceBOXPERSO)) return 1;
|
||||
if (T.Add("tbox",(tf_value)TopOpeBRepTool_SettraceBOX)) return 1;
|
||||
if (T.Add("tclov",(tf_value)TopOpeBRepTool_SettraceCLOV)) return 1;
|
||||
if (T.Add("tchkbspl",(tf_value)TopOpeBRepTool_SettraceCHKBSPL)) return 1;
|
||||
if (T.Add("tregufa",(tf_value)TopOpeBRepTool_SettraceREGUFA)) return 1;
|
||||
if (T.Add("treguso",(tf_value)TopOpeBRepTool_SettraceREGUSO)) return 1;
|
||||
if (T.Add("tc2d",(tf_value)TopOpeBRepTool_SettraceC2D)) return 1;
|
||||
if (T.Add("tcorriso",(tf_value)TopOpeBRepTool_SettraceCORRISO)) return 1;
|
||||
if (T.Add("tcl2ddr",(tf_intarg)TopOpeBRepTool_SettraceCL2DDR)) return 1;
|
||||
if (T.Add("tcl2dpr",(tf_intarg)TopOpeBRepTool_SettraceCL2DPR)) return 1;
|
||||
if (T.Add("tcl3ddr",(tf_intarg)TopOpeBRepTool_SettraceCL3DDR)) return 1;
|
||||
if (T.Add("tcl3dpr",(tf_intarg)TopOpeBRepTool_SettraceCL3DPR)) return 1;
|
||||
if (T.Add("tbuto",(tf_value)TopOpeBRepDS_SettraceBUTO)) return 1;
|
||||
if (T.Add("ttrpe",(tf_value)TopOpeBRepDS_SettraceTRPE)) return 1;
|
||||
if (T.Add("tedpr",(tf_value)TopOpeBRepDS_SettraceEDPR)) return 1;
|
||||
if (T.Add("tisto",(tf_value)TopOpeBRepDS_SettraceISTO)) return 1;
|
||||
if (T.Add("tproedg",(tf_value)TopOpeBRep_SettracePROEDG)) return 1;
|
||||
if (T.Add("tconic",(tf_value)TopOpeBRep_SettraceCONIC)) return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
Standard_Integer InitContextTopOpeKernel (TestTopOpeTools_Trace& T)
|
||||
//----------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef DEB
|
||||
if (T.Add("nosew",(tf_value)TopOpeBRepTool_SetcontextNOSEW)) return 1;
|
||||
if (T.Add("nopnc",(tf_value)TopOpeBRepDS_SetcontextNOPNC)) return 1;
|
||||
if (T.Add("nosg",(tf_value)TopOpeBRepBuild_SetcontextNOSG)) return 1;
|
||||
if (T.Add("ssconnex",(tf_value)TopOpeBRepBuild_SetcontextSSCONNEX)) return 1;
|
||||
if (T.Add("sf2",(tf_value)TopOpeBRepBuild_SetcontextSF2)) return 1;
|
||||
if (T.Add("speon",(tf_value)TopOpeBRepBuild_SetcontextSPEON)) return 1;
|
||||
if (T.Add("nopurge",(tf_value)TopOpeBRepBuild_SetcontextNOPURGE)) return 1;
|
||||
if (T.Add("noregufa",(tf_value)TopOpeBRepBuild_SetcontextNOREGUFA)) return 1;
|
||||
if (T.Add("noreguso",(tf_value)TopOpeBRepBuild_SetcontextNOREGUSO)) return 1;
|
||||
if (T.Add("reguxpu",(tf_value)TopOpeBRepBuild_SetcontextREGUXPU)) return 1;
|
||||
if (T.Add("nocorriso",(tf_value)TopOpeBRepBuild_SetcontextNOCORRISO)) return 1;
|
||||
if (T.Add("nofe",(tf_value)TopOpeBRepBuild_SetcontextNOFE)) return 1;
|
||||
if (T.Add("nofufa",(tf_value)TopOpeBRepBuild_SetcontextNOFUFA)) return 1;
|
||||
if (T.Add("einternal",(tf_value)TopOpeBRepBuild_SetcontextEINTERNAL)) return 1;
|
||||
if (T.Add("eexternal",(tf_value)TopOpeBRepBuild_SetcontextEEXTERNAL)) return 1;
|
||||
if (T.Add("santran",(tf_value)TopOpeBRepDS_SettraceSANTRAN)) return 1;
|
||||
if (T.Add("noproedg",(tf_value)TopOpeBRep_SetcontextNOPROEDG)) return 1;
|
||||
if (T.Add("rest1",(tf_value)TopOpeBRep_SetcontextREST1)) return 1;
|
||||
if (T.Add("rest2",(tf_value)TopOpeBRep_SetcontextREST2)) return 1;
|
||||
if (T.Add("inl",(tf_value)TopOpeBRep_SetcontextINL)) return 1;
|
||||
if (T.Add("newkp",(tf_value)TopOpeBRep_SetcontextNEWKP)) return 1;
|
||||
if (T.Add("tol0",(tf_value)TopOpeBRep_SetcontextTOL0)) return 1;
|
||||
if (T.Add("nonog",(tf_value)TopOpeBRep_SetcontextNONOG)) return 1;
|
||||
if (T.Add("ffor",(tf_value)TopOpeBRep_SetcontextFFOR)) return 1;
|
||||
if (T.Add("nopunk",(tf_value)TopOpeBRep_SetcontextNOPUNK)) return 1;
|
||||
if (T.Add("nofei",(tf_value)TopOpeBRep_SetcontextNOFEI)) return 1;
|
||||
if (T.Add("nopfi",(tf_value)TopOpeBRepDS_SetcontextNOPFI)) return 1;
|
||||
if (T.Add("mktonreg",(tf_value)TopOpeBRepDS_SetcontextMKTONREG)) return 1;
|
||||
if (T.Add("nogap",(tf_value)TopOpeBRepDS_SetcontextNOGAP)) return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Integer TestTopOpeTools_SetFlags
|
||||
(TestTopOpeTools_Trace& theFlags, Standard_Integer mute, Standard_Integer n , const char** a)
|
||||
{
|
||||
if (n == 1) {
|
||||
theFlags.Dump();
|
||||
return 0;
|
||||
}
|
||||
if (n < 2) {
|
||||
return 1;
|
||||
}
|
||||
const char* flag = a[1];
|
||||
t_value value; // new value of flag
|
||||
if (n == 2) value = Standard_True;
|
||||
else value = (atoi(a[2]) ? Standard_True : Standard_False);
|
||||
|
||||
if (mute == 0) {
|
||||
if ( n == 2 ) {
|
||||
if (!strcasecmp(a[1],"0")) {
|
||||
theFlags.Reset(Standard_False);
|
||||
cout<<theFlags.Genre()<<"s desactivated"<<endl;
|
||||
return 0;
|
||||
}
|
||||
else if (!strcasecmp(a[1],"1")) {
|
||||
theFlags.Reset(Standard_True);
|
||||
cout<<theFlags.Genre()<<"s activated"<<endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer res = 1;
|
||||
if (res) res=theFlags.Set(mute,flag,value,(n>3)?(n-3):0,(n>3)?&a[3]:NULL);
|
||||
if (res) res=theFlags.Set(mute,flag,value);
|
||||
return res;
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// a1 = flag (for example tbs) <a2> = value, if omitted flag becomes True
|
||||
//=========================================================================
|
||||
|
||||
Standard_Integer TestTopOpeTools_SetTrace(Draw_Interpretor&, Standard_Integer n , const char** a)
|
||||
{
|
||||
Standard_Integer ok = Standard_True;
|
||||
#ifdef DEB
|
||||
InitTraceTopOpeKernel(theTrace);
|
||||
Standard_Integer mute = 0; if (!strcasecmp(a[0],"trcmute")) mute = 1;
|
||||
ok = TestTopOpeTools_SetFlags(theTrace,mute,n,a);
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// a1 = flag (for example tbs) <a2> = value, if omitted flag becomes True
|
||||
//=========================================================================
|
||||
|
||||
Standard_Integer TestTopOpeTools_SetContext(Draw_Interpretor&, Standard_Integer n , const char** a)
|
||||
{
|
||||
Standard_Integer ok = Standard_True;
|
||||
#ifdef DEB
|
||||
InitContextTopOpeKernel(theContext);
|
||||
Standard_Integer mute = 0; if (!strcasecmp(a[0],"ctxmute")) mute = 1;
|
||||
ok = TestTopOpeTools_SetFlags(theContext,mute,n,a);
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
||||
Standard_Integer dstrace(Draw_Interpretor& di, Standard_Integer n , const char** a) {
|
||||
const char ** pa = NULL; TCollection_AsciiString a1;
|
||||
if (!strcasecmp(a[0],"tsx")) a1 = "tspsx";
|
||||
else if (!strcasecmp(a[0],"tcx")) a1 = "tcx";
|
||||
else return 0;
|
||||
TCollection_AsciiString a0("trc");
|
||||
Standard_Integer npa = n+1;pa = (const char**) malloc((size_t)((npa)*sizeof(char*)));
|
||||
pa[0] = (char *)a0.ToCString();
|
||||
pa[1] = (char *)a1.ToCString();
|
||||
for (Standard_Integer i=1;i<n;i++) pa[i+1] = a[i];
|
||||
TestTopOpeTools_SetTrace(di,npa,pa);
|
||||
if (pa) delete [] pa;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TraceCommands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TestTopOpeTools::TraceCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
static Standard_Boolean done = Standard_False;
|
||||
if (done) return;
|
||||
done = Standard_True;
|
||||
|
||||
const char* g = "trace commands";
|
||||
|
||||
theCommands.Add("tsx","tsx 0|1 [{shape index}]",__FILE__,dstrace,g);
|
||||
theCommands.Add("tsxx","tsxx 0|1 is1 is2",__FILE__,dstrace,g);
|
||||
theCommands.Add("tcx","tcx 0|1 [{curve index}]",__FILE__,dstrace,g);
|
||||
|
||||
theCommands.Add("trc","Trace <flag> <value>",__FILE__,TestTopOpeTools_SetTrace,g);
|
||||
theCommands.Add("trcmute","Trace <flag> <value>",__FILE__,TestTopOpeTools_SetTrace,g);
|
||||
theCommands.Add("ctx","Context <flag> <value>",__FILE__,TestTopOpeTools_SetContext,g);
|
||||
theCommands.Add("ctxmute","Context <flag> <value>",__FILE__,TestTopOpeTools_SetContext,g);
|
||||
}
|
Reference in New Issue
Block a user