1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

...

1 Commits

Author SHA1 Message Date
jgv
92ef2342b0 0032488: Repack toolkit TKDraw to avoid possible cyclic dependency
First version
2021-10-05 01:39:10 +03:00
23 changed files with 709 additions and 7 deletions

View File

@@ -4,4 +4,4 @@ ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffs
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
Draw TKDrawBase TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

@@ -415,6 +415,7 @@ n XSDRAWSTEP
n XSDRAWSTLVRML
r DrawResources
t TKDCAF
t TKDrawBase
t TKDraw
t TKTObjDRAW
t TKTopTest

View File

@@ -50,7 +50,7 @@
#include <stdio.h>
// memory management
#ifdef _WIN32
extern Draw_Viewer dout;
Standard_IMPORT Draw_Viewer dout;
#endif
#define Characters(IArg) (strspn (Arg[IArg], "0123456789.+-eE") != strlen (Arg[IArg]))

View File

@@ -74,7 +74,7 @@ static Standard_Integer PlotCount = 0; // PlotEdge and PlotIso for cases of "
static TopoDS_Shape pickshape;
static Standard_Real upick,vpick;
#ifdef _WIN32
extern Draw_Viewer dout;
Standard_IMPORT Draw_Viewer dout;
#endif
//=======================================================================

View File

@@ -977,3 +977,67 @@ Standard_Boolean Draw::ParseOnOffNoIterator (Standard_Integer theArgsNb,
Standard_Boolean isOn = Draw::ParseOnOffIterator (theArgsNb, theArgVec, theArgIter);
return toReverse ? !isOn : isOn;
}
/*
//=======================================================================
//function : Draw_PointColor
//purpose : Sets new color for rendering of points. Returns the
// previous one to keep possibility to restore the initial
// state
//=======================================================================
Standard_EXPORT Draw_Color Draw_PointColor(const Draw_Color theColor)
{
Draw_PntParams& aParams = Draw::PntParameters();
Draw_Color aLastColor = aParams.PntColor;
aParams.PntColor = theColor;
return aLastColor;
}
//=======================================================================
//function : Draw_PointMarker
//purpose : Sets new marker for rendering of points. Returns the
// previous one to keep possibility to restore the initial
// state
//=======================================================================
Standard_EXPORT Draw_MarkerShape Draw_PointMarker(const Draw_MarkerShape theMarker)
{
Draw_PntParams& aParams = Draw::PntParameters();
Draw_MarkerShape aLastMarker = aParams.PntMarker;
aParams.PntMarker = theMarker;
return aLastMarker;
}
*/
//=======================================================================
//function : Set
//purpose : point
//=======================================================================
void Draw::Set (const Standard_CString theName,
const gp_Pnt& thePoint)
{
Draw_PntParams& aParams = PntParameters();
Handle(Draw_Point) aDrawPoint = new Draw_Point (thePoint, aParams.PntMarker, aParams.PntColor);
Draw::Set (theName, aDrawPoint);
}
//=======================================================================
//function : Set
//purpose : point
//=======================================================================
void Draw::Set (const Standard_CString theName,
const gp_Pnt2d& thePoint)
{
Draw_PntParams& aParams = PntParameters();
Handle(Draw_Point) aDrawPoint = new Draw_Point (thePoint, aParams.PntMarker, aParams.PntColor);
Draw::Set (theName, aDrawPoint);
}
//=======================================================================
//function : PntParameters
//purpose :
//=======================================================================
Draw_PntParams& Draw::PntParameters()
{
static Draw_PntParams aParams;
return aParams;
}

View File

@@ -18,6 +18,8 @@
#define _Draw_HeaderFile
#include <Draw_Interpretor.hxx>
#include <Draw_PntParams.hxx>
#include <Draw_Point.hxx>
#include <NCollection_Map.hxx>
#include <Quantity_ColorRGBA.hxx>
#include <Standard_Handle.hxx>
@@ -58,6 +60,17 @@ public: //! @name Tcl variables management tools
//! Sets a numeric variable.
Standard_EXPORT static void Set (const Standard_CString Name, const Standard_Real val);
//! Sets <G> in the variable <Name>. Overwrite the
//! variable if already set.
Standard_EXPORT static void Set (const Standard_CString Name, const gp_Pnt& G);
//! Sets <G> in the variable <Name>. Overwrite the
//! variable if already set.
Standard_EXPORT static void Set (const Standard_CString Name, const gp_Pnt2d& G);
//! Return global parameters for points.
Standard_EXPORT static Draw_PntParams& PntParameters();
//! Returns main DRAW interpretor.
Standard_EXPORT static Draw_Interpretor& GetInterpretor();

View File

@@ -57,6 +57,107 @@ static char Draw_fontsize[FONTLENGTH]="150";
static char Draw_fontnamedefault[FONTLENGTH]="Helvetica";
static char Draw_fontsizedefault[FONTLENGTH]="150";
//=======================================================================
//function : Draw_PointColor
//purpose : Sets new color for rendering of points. Returns the
// previous one to keep possibility to restore the initial
// state
//=======================================================================
Standard_EXPORT Draw_Color Draw_PointColor(const Draw_Color theColor)
{
Draw_PntParams& aParams = Draw::PntParameters();
Draw_Color aLastColor = aParams.PntColor;
aParams.PntColor = theColor;
return aLastColor;
}
//=======================================================================
//function : Draw_PointMarker
//purpose : Sets new marker for rendering of points. Returns the
// previous one to keep possibility to restore the initial
// state
//=======================================================================
Standard_EXPORT Draw_MarkerShape Draw_PointMarker(const Draw_MarkerShape theMarker)
{
Draw_PntParams& aParams = Draw::PntParameters();
Draw_MarkerShape aLastMarker = aParams.PntMarker;
aParams.PntMarker = theMarker;
return aLastMarker;
}
//=======================================================================
//function : printColor
//purpose :
//=======================================================================
static void printColor(Draw_Interpretor& di, const Draw_Color& theColor)
{
switch ( theColor.ID() )
{
case Draw_blanc: di << "white " << "\n"; break;
case Draw_rouge: di << "red " << "\n"; break;
case Draw_vert: di << "green " << "\n"; break;
case Draw_bleu: di << "blue " << "\n"; break;
case Draw_cyan: di << "cyan " << "\n"; break;
case Draw_or: di << "golden " << "\n"; break;
case Draw_magenta: di << "magenta " << "\n"; break;
case Draw_marron: di << "brown " << "\n"; break;
case Draw_orange: di << "orange " << "\n"; break;
case Draw_rose: di << "pink " << "\n"; break;
case Draw_saumon: di << "salmon " << "\n"; break;
case Draw_violet: di << "violet " << "\n"; break;
case Draw_jaune: di << "yellow " << "\n"; break;
case Draw_kaki: di << "dark-olive green \n"; break;
case Draw_corail: di << "coral " << "\n"; break;
}
}
//=======================================================================
//function : recognizeColor
//purpose :
//=======================================================================
static Draw_Color recognizeColor(const char* theColorStr,
const Draw_Color& theDefaultColor)
{
Draw_Color aResult = theDefaultColor;
if ( !strcasecmp(theColorStr,"white") )
aResult = Draw_blanc;
if ( !strcasecmp(theColorStr, "red") )
aResult = Draw_rouge;
if ( !strcasecmp(theColorStr, "green") )
aResult = Draw_vert;
if ( !strcasecmp(theColorStr, "blue") )
aResult = Draw_bleu;
if ( !strcasecmp(theColorStr, "cyan") )
aResult = Draw_cyan;
if ( !strcasecmp(theColorStr, "golden") )
aResult = Draw_or;
if ( !strcasecmp(theColorStr, "magenta") )
aResult = Draw_magenta;
if ( !strcasecmp(theColorStr, "brown") )
aResult = Draw_marron;
if ( !strcasecmp(theColorStr, "orange") )
aResult = Draw_orange;
if ( !strcasecmp(theColorStr, "pink") )
aResult = Draw_rose;
if ( !strcasecmp(theColorStr, "salmon") )
aResult = Draw_saumon;
if ( !strcasecmp(theColorStr, "violet") )
aResult = Draw_violet;
if ( !strcasecmp(theColorStr, "yellow") )
aResult = Draw_jaune;
if ( !strcasecmp(theColorStr, "darkgreen") )
aResult = Draw_kaki;
if ( !strcasecmp(theColorStr, "coral") )
aResult = Draw_corail;
return aResult;
}
// *******************************************************************
// Graphic commands
// *******************************************************************
@@ -948,6 +1049,58 @@ static Standard_Integer dtext(Draw_Interpretor& di, Standard_Integer n, const ch
return 0;
}
//=======================================================================
//function : drsetpointcolor
//purpose :
//=======================================================================
static Standard_Integer drsetpointcolor(Draw_Interpretor& di,
Standard_Integer n, const char** a)
{
Draw_Color col, savecol;
savecol = Draw_PointColor(Draw_Color(Draw_jaune));
Draw_PointColor(savecol);
if (n < 2)
{
printColor(di, savecol);
}
else {
col = recognizeColor(a[1], savecol);
Draw_PointColor(col);
}
return 0;
}
//=======================================================================
//function : drchangepointcolor
//purpose :
//=======================================================================
static Standard_Integer drchangepointcolor(Draw_Interpretor&,
Standard_Integer n, const char** a)
{
Draw_Color col, savecol;
savecol = Draw_PointColor(Draw_Color(Draw_jaune));
Draw_PointColor(savecol);
if ( n < 3 )
return 1;
col = recognizeColor(a[1], savecol);
Handle(Draw_Point) D = Handle(Draw_Point)::DownCast( Draw::Get(a[2]) );
if ( !D.IsNull() )
{
D->Color(col);
Draw::Repaint();
}
return 0;
}
void Draw::GraphicCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean Done = Standard_False;
@@ -1021,5 +1174,12 @@ void Draw::GraphicCommands(Draw_Interpretor& theCommands)
__FILE__,dtext,g);
theCommands.Add("dfont","dfont [name size] : set name and size of Draw font, or reset to default",
__FILE__,dfont,g);
theCommands.Add("drsetpointcolor",
"drsetpointcolor [color] : set point color",
__FILE__,drsetpointcolor,g);
theCommands.Add("drchangepointcolor",
"drchangepointcolor color point: change color of the point",
__FILE__,drchangepointcolor,g);
}

View File

@@ -0,0 +1,34 @@
// Copyright (c) 2021 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Draw_PntParams_HeaderFile
#define Draw_PntParams_HeaderFile
#include <Draw_Color.hxx>
#include <Draw_MarkerShape.hxx>
//! Draw parameters for points.
struct Draw_PntParams
{
public:
Draw_Color PntColor;
Draw_MarkerShape PntMarker;
Draw_PntParams()
: PntColor (Draw_rouge),
PntMarker (Draw_Plus)
{}
};
#endif

208
src/Draw/Draw_Point.cxx Normal file
View File

@@ -0,0 +1,208 @@
// Created on: 1994-03-28
// Created by: Remi LEQUETTE
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Draw_Point.hxx>
#include <Draw.hxx>
#include <Draw_Color.hxx>
#include <Draw_Display.hxx>
#include <Draw_PntParams.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Draw_Point, Draw_Drawable3D)
//=======================================================================
//function : Draw_Point
//purpose :
//=======================================================================
Draw_Point::Draw_Point (const gp_Pnt& P,
const Draw_MarkerShape Shape,
const Draw_Color& Col)
: myPoint(P),
is3D(Standard_True),
myShape(Shape),
myColor(Col)
{
//
}
//=======================================================================
//function : Draw_Point
//purpose :
//=======================================================================
Draw_Point::Draw_Point (const gp_Pnt2d& P,
const Draw_MarkerShape Shape,
const Draw_Color& Col)
: myPoint(P.X(),P.Y(),0.),
is3D(Standard_False),
myShape(Shape),
myColor(Col)
{
//
}
//=======================================================================
//function : Is3D
//purpose :
//=======================================================================
Standard_Boolean Draw_Point::Is3D() const
{
return is3D;
}
//=======================================================================
//function : DrawOn
//purpose :
//=======================================================================
void Draw_Point::DrawOn (Draw_Display& dis) const
{
dis.SetColor(myColor);
if (is3D)
dis.DrawMarker(myPoint,myShape);
else
dis.DrawMarker(Point2d(),myShape);
}
//=======================================================================
//function : Point
//purpose :
//=======================================================================
void Draw_Point::Point (const gp_Pnt& P)
{
myPoint = P;
is3D = Standard_True;
}
//=======================================================================
//function : Point2d
//purpose :
//=======================================================================
void Draw_Point::Point2d(const gp_Pnt2d& P)
{
myPoint.SetCoord(P.X(),P.Y(),0);
is3D = Standard_False;
}
//=======================================================================
//function : Copy
//purpose :
//=======================================================================
Handle(Draw_Drawable3D) Draw_Point::Copy() const
{
Handle(Draw_Point) P;
if (is3D)
P = new Draw_Point(myPoint,myShape,myColor);
else
P = new Draw_Point(Point2d(),myShape,myColor);
return P;
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
void Draw_Point::Dump (Standard_OStream& S) const
{
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
std::ios::fmtflags F = S.flags();
S.setf(std::ios::scientific,std::ios::floatfield);
S.precision(15);
#else
long form = S.setf(std::ios::scientific);
std::streamsize prec = S.precision(15);
#endif
if (is3D)
S << "Point : " << myPoint.X() << ", " << myPoint.Y() << ", " << myPoint.Z() <<std::endl;
else
S << "Point 2d : " << myPoint.X() << ", " << myPoint.Y() <<std::endl;
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
S.setf(F);
#else
S.setf(form);
S.precision(prec);
#endif
}
//=======================================================================
//function : Save
//purpose :
//=======================================================================
void Draw_Point::Save (Standard_OStream& theStream) const
{
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
std::ios::fmtflags aFlags = theStream.flags();
theStream.setf (std::ios::scientific, std::ios::floatfield);
theStream.precision (15);
#else
long aForm = theStream.setf (std::ios::scientific);
std::streamsize aPrec = theStream.precision (15);
#endif
if (is3D)
{
theStream << "1 " << myPoint.X() << " " << myPoint.Y() << " " << myPoint.Z() << "\n";
}
else
{
theStream << "0 " << myPoint.X() << " " << myPoint.Y() << "\n";
}
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
theStream.setf (aFlags);
#else
theStream.setf (aForm);
theStream.precision (aPrec);
#endif
}
//=======================================================================
//function : Restore
//purpose :
//=======================================================================
Handle(Draw_Drawable3D) Draw_Point::Restore (Standard_IStream& theStream)
{
const Draw_PntParams& aParams = Draw::PntParameters();
Standard_Integer is3d = 0;
theStream >> is3d;
Standard_Real x,y,z = 0.0;
if (is3d)
{
theStream >> x >> y >> z;
}
else
{
theStream >> x >> y;
}
Handle(Draw_Point) aDrawPoint;
if (is3d)
{
aDrawPoint = new Draw_Point (gp_Pnt (x, y, z), aParams.PntMarker, aParams.PntColor);
}
else
{
aDrawPoint = new Draw_Point (gp_Pnt2d (x, y), aParams.PntMarker, aParams.PntColor);
}
return aDrawPoint;
}
//=======================================================================
//function : Whatis
//purpose :
//=======================================================================
void Draw_Point::Whatis (Draw_Interpretor& S) const
{
S << "point";
}

84
src/Draw/Draw_Point.hxx Normal file
View File

@@ -0,0 +1,84 @@
// Created on: 1994-03-28
// Created by: Remi LEQUETTE
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Draw_Point_HeaderFile
#define _Draw_Point_HeaderFile
#include <gp_Pnt.hxx>
#include <Draw_MarkerShape.hxx>
#include <Draw_Color.hxx>
#include <Draw_Drawable3D.hxx>
#include <Draw_Interpretor.hxx>
class Draw_Color;
class gp_Pnt2d;
DEFINE_STANDARD_HANDLE(Draw_Point, Draw_Drawable3D)
//! A drawable point.
class Draw_Point : public Draw_Drawable3D
{
DEFINE_STANDARD_RTTIEXT(Draw_Point, Draw_Drawable3D)
Draw_Drawable3D_FACTORY
public:
Standard_EXPORT Draw_Point (const gp_Pnt& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
Standard_EXPORT Draw_Point (const gp_Pnt2d& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
//! Is a 3D object. (Default True).
Standard_EXPORT virtual Standard_Boolean Is3D() const Standard_OVERRIDE;
gp_Pnt Point() const { return myPoint; }
Standard_EXPORT void Point (const gp_Pnt& P);
gp_Pnt2d Point2d() const { return gp_Pnt2d(myPoint.X(), myPoint.Y()); }
Standard_EXPORT void Point2d (const gp_Pnt2d& P);
void Color (const Draw_Color& theColor) { myColor = theColor; }
Draw_Color Color() const { return myColor; }
void Shape (const Draw_MarkerShape theS) { myShape = theS; }
Draw_MarkerShape Shape() const { return myShape; }
//! For variable copy.
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
//! For variable dump.
Standard_EXPORT virtual void Dump (Standard_OStream& S) const Standard_OVERRIDE;
//! Save drawable into stream.
Standard_EXPORT virtual void Save (Standard_OStream& theStream) const Standard_OVERRIDE;
//! For variable whatis command.
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
private:
gp_Pnt myPoint;
Standard_Boolean is3D;
Draw_MarkerShape myShape;
Draw_Color myColor;
};
#endif // _Draw_Point_HeaderFile

View File

@@ -46,6 +46,9 @@ Draw_Number.hxx
Draw_PInterp.hxx
Draw_PloadCommands.cxx
Draw_PluginMacro.hxx
Draw_PntParams.hxx
Draw_Point.cxx
Draw_Point.hxx
Draw_Printer.cxx
Draw_Printer.hxx
Draw_ProgressIndicator.cxx

View File

@@ -33,7 +33,7 @@
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve, DrawTrSurf_Drawable)
Standard_Real DrawTrSurf_CurveLimit = 400;
extern Standard_Boolean Draw_Bounds;
Standard_IMPORT Standard_Boolean Draw_Bounds;
//=======================================================================
//function : DrawTrSurf_Curve

View File

@@ -35,7 +35,7 @@
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
static Standard_Real DrawTrSurf_CurveLimit = 400;
extern Standard_Boolean Draw_Bounds;
Standard_IMPORT Standard_Boolean Draw_Bounds;
//=======================================================================
//function : DrawTrSurf_Curve2d

View File

@@ -15,6 +15,9 @@
#include <NCollection_IncAllocator.hxx>
#include <NCollection_LocalArray.hxx>
//#ifdef DRAW
#include <Draw.hxx>
//#endif
// modified by NIZHNY-MKK Thu Nov 2 15:07:26 2000.BEGIN
static Standard_Boolean TestPassedSolutionWithNegativeState(const IntWalk_VectorOfWalkingData& wd,
@@ -63,6 +66,10 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
// end of conditions.
{
//#ifdef DRAW
char* name = new char[100];
//#endif
Standard_Integer I = 0, N = 0, SaveN = 0;
Standard_Real aBornInf[2] = {}, aBornSup[2] = {}, aUVap[2] = {};
math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2), UVap(aUVap,1,2);
@@ -125,6 +132,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
previousd3d = Func.Direction3d();
previousd2d = Func.Direction2d();
CurrentLine->AddPoint(previousPoint);
//#ifdef DRAW
Standard_Integer aNbPoints = CurrentLine->NbPoints();
gp_Pnt aPnt = previousPoint.Value();
sprintf(name, "op%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
gp_Pnt2d aPnt2d = previousPoint.ValueOnSurface(false);
sprintf(name, "opp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
// modified by NIZHNY-MKK Fri Oct 27 12:34:32 2000.BEGIN
if(movementdirectioninfo[I] !=0) {
if(movementdirectioninfo[I] < 0) {
@@ -266,6 +284,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
CurrentLine->AddStatusLast(Standard_False);
//if (aStatus != IntWalk_ArretSurPointPrecedent)
CurrentLine->AddPoint(Psol);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = Psol.Value();
sprintf(name, "op%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = Psol.ValueOnSurface(false);
sprintf(name, "opp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
//Remove <SaveN> from <seqAlone>
for (Standard_Integer iseq = 1; iseq <= seqAlone.Length(); iseq++)
if (seqAlone(iseq) == SaveN)
@@ -348,6 +377,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
Tgtend = Standard_True;
MakeWalkingPoint(1, UVap(1), UVap(2), Func, Psol);
CurrentLine->AddPoint(Psol);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = Psol.Value();
sprintf(name, "op%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = Psol.ValueOnSurface(false);
sprintf(name, "opp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
Rajout = Standard_True;
seqAlone.Append(lines.Length() + 1);
seqAjout.Append(lines.Length() + 1);
@@ -357,6 +397,16 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
previousd3d = Func.Direction3d();
previousd2d = Func.Direction2d();
CurrentLine->AddPoint(previousPoint);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = previousPoint.Value();
sprintf(name, "op%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = previousPoint.ValueOnSurface(false);
sprintf(name, "opp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
}
else if (aStatus == IntWalk_PointConfondu)
{

View File

@@ -14,6 +14,10 @@
#include <NCollection_IncAllocator.hxx>
//#ifdef DRAW
#include <Draw.hxx>
//#endif
void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
const TColStd_SequenceOfReal& Vmult,
const ThePOPIterator& Pnts1,
@@ -41,6 +45,10 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
//
// ********************************************************************
{
//#ifdef DRAW
char* name = new char[100];
//#endif
Standard_Integer I = 0, N = 0,SaveN = 0;
Standard_Real aBornInf[2] = {}, aBornSup[2] = {}, aUVap[2] = {};
math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2);
@@ -138,6 +146,17 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
CurrentLine = new IntWalk_TheIWLine (new NCollection_IncAllocator());
CurrentLine->AddPoint(previousPoint);
//#ifdef DRAW
Standard_Integer aNbPoints = CurrentLine->NbPoints();
gp_Pnt aPnt = previousPoint.Value();
sprintf(name, "cp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
gp_Pnt2d aPnt2d = previousPoint.ValueOnSurface(false);
sprintf(name, "cpp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
CurrentLine->SetTangentVector(previousd3d,1);
Tgtbeg = Standard_False;
Tgtend = Standard_False;
@@ -341,6 +360,16 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
//if (aStatus != IntWalk_ArretSurPointPrecedent)
CurrentLine->AddPoint(Psol);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = Psol.Value();
sprintf(name, "cp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = Psol.ValueOnSurface(false);
sprintf(name, "cpp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
//Remove <SaveN> from <seqAlone> and, if it is first found point,
//from <seqAjout> too
if (IsValidEndPoint(I, SaveN))
@@ -391,6 +420,17 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
{
if (aStatus == IntWalk_ArretSurPointPrecedent) {
CurrentLine->AddPoint(Psol);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = Psol.Value();
sprintf(name, "cp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = Psol.ValueOnSurface(false);
sprintf(name, "cpp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
OpenLine(0,Psol,Pnts1,Func,CurrentLine);
}
else {
@@ -495,6 +535,17 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
IntSurf_PntOn2S newP;
newP.SetValue(Func.Point(),reversed,Uvap(1),Uvap(2));
CurrentLine->AddPoint(newP);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = newP.Value();
sprintf(name, "cp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = newP.ValueOnSurface(false);
sprintf(name, "cpp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
Rajout = Standard_True;
seqAlone.Append(lines.Length()+1);
seqAjout.Append(lines.Length()+1);
@@ -507,6 +558,16 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
previousd3d = Func.Direction3d();
previousd2d = Func.Direction2d();
CurrentLine->AddPoint(previousPoint);
//#ifdef DRAW
aNbPoints = CurrentLine->NbPoints();
aPnt = previousPoint.Value();
sprintf(name, "cp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt);
aPnt2d = previousPoint.ValueOnSurface(false);
sprintf(name, "cpp%d_%d", I, aNbPoints);
Draw::Set(name, aPnt2d);
//#endif
}
else if (aStatus == IntWalk_PointConfondu)
{

View File

@@ -13,7 +13,7 @@
;# Return list of toolkits
proc Draw:toolkits { } {
set aResult [list TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
set aResult [list TKDrawBase TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
lappend aResult "TKOpenGlTest"
if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {

View File

@@ -1,4 +1,5 @@
TKernel
TKDrawBase
TKG2d
TKGeomBase
TKG3d

View File

@@ -1,3 +1,2 @@
Draw
DBRep
DrawTrSurf

View File

@@ -0,0 +1,3 @@
project(TKDrawBase)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)

17
src/TKDrawBase/EXTERNLIB Normal file
View File

@@ -0,0 +1,17 @@
TKernel
TKG2d
TKG3d
TKMath
TKService
CSF_TclLibs
CSF_TclTkLibs
CSF_XwLibs
CSF_gdi32
CSF_advapi32
CSF_user32
CSF_shell32
CSF_TBB
CSF_objc
CSF_Appkit
CSF_IOKit
CSF_ThreadLibs

2
src/TKDrawBase/FILES Normal file
View File

@@ -0,0 +1,2 @@
EXTERNLIB
PACKAGES

1
src/TKDrawBase/PACKAGES Normal file
View File

@@ -0,0 +1 @@
Draw

View File

@@ -4,3 +4,4 @@ TKG3d
TKG2d
TKGeomBase
TKBRep
TKDrawBase