mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031990: Coding, Draw Harness - Replace C-like pointers to function in Draw_SaveAndRestore class to virtual function
Save/Restore interface has been moved to Draw_Drawable3D base class. Create a singleton Draw_Params class for DRAW parameters
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -17,46 +17,23 @@
|
||||
#ifndef _DrawTrSurf_HeaderFile
|
||||
#define _DrawTrSurf_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <Geom_Geometry.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
|
||||
class gp_Pnt;
|
||||
class gp_Pnt2d;
|
||||
class Poly_Triangulation;
|
||||
class Poly_Polygon3D;
|
||||
class Poly_Polygon2D;
|
||||
class Geom_Curve;
|
||||
class Geom_BezierCurve;
|
||||
class Geom_BezierSurface;
|
||||
class Geom_BSplineCurve;
|
||||
class Geom_BSplineSurface;
|
||||
class Geom2d_BezierCurve;
|
||||
class Geom2d_BSplineCurve;
|
||||
class Geom_BezierSurface;
|
||||
class Geom_BSplineSurface;
|
||||
class DrawTrSurf_Drawable;
|
||||
class DrawTrSurf_Point;
|
||||
class DrawTrSurf_Curve;
|
||||
class DrawTrSurf_BSplineCurve;
|
||||
class DrawTrSurf_BezierCurve;
|
||||
class DrawTrSurf_Curve2d;
|
||||
class DrawTrSurf_BSplineCurve2d;
|
||||
class DrawTrSurf_BezierCurve2d;
|
||||
class DrawTrSurf_Triangulation2D;
|
||||
class DrawTrSurf_Surface;
|
||||
class DrawTrSurf_BSplineSurface;
|
||||
class DrawTrSurf_BezierSurface;
|
||||
class DrawTrSurf_Triangulation;
|
||||
class DrawTrSurf_Polygon3D;
|
||||
class DrawTrSurf_Polygon2D;
|
||||
class Poly_Polygon2D;
|
||||
class Poly_Polygon3D;
|
||||
class Poly_Triangulation;
|
||||
struct DrawTrSurf_Params;
|
||||
|
||||
|
||||
//! This package supports the display of parametric
|
||||
//! curves and surfaces.
|
||||
//! This package supports the display of parametric curves and surfaces.
|
||||
//!
|
||||
//! The Drawable deferred classes is inherited from
|
||||
//! the Drawable3D class from the package Draw, it
|
||||
@@ -67,15 +44,13 @@ class DrawTrSurf_Polygon2D;
|
||||
//! and can be used to draw a single curve from
|
||||
//! packages Geom or Geom2d or a surface from Geom.
|
||||
//!
|
||||
//! The Triangulation and Polygon from the package
|
||||
//! Poly are also supported.
|
||||
//! The Triangulation and Polygon from the package Poly are also supported.
|
||||
class DrawTrSurf
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! 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);
|
||||
@@ -169,46 +144,13 @@ template <class T> static void Set (const Standard_CString Name, const Handle(T)
|
||||
//! Get the variable <S>. Returns a null handle if
|
||||
//! none, and print a warning message.
|
||||
Standard_EXPORT static Handle(Poly_Polygon2D) GetPolygon2D (Standard_CString& Name);
|
||||
|
||||
|
||||
//! Return package global parameters.
|
||||
Standard_EXPORT static DrawTrSurf_Params& Parameters();
|
||||
|
||||
//! defines display commands.
|
||||
Standard_EXPORT static void BasicCommands (Draw_Interpretor& I);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class DrawTrSurf_Drawable;
|
||||
friend class DrawTrSurf_Point;
|
||||
friend class DrawTrSurf_Curve;
|
||||
friend class DrawTrSurf_BSplineCurve;
|
||||
friend class DrawTrSurf_BezierCurve;
|
||||
friend class DrawTrSurf_Curve2d;
|
||||
friend class DrawTrSurf_BSplineCurve2d;
|
||||
friend class DrawTrSurf_BezierCurve2d;
|
||||
friend class DrawTrSurf_Triangulation2D;
|
||||
friend class DrawTrSurf_Surface;
|
||||
friend class DrawTrSurf_BSplineSurface;
|
||||
friend class DrawTrSurf_BezierSurface;
|
||||
friend class DrawTrSurf_Triangulation;
|
||||
friend class DrawTrSurf_Polygon3D;
|
||||
friend class DrawTrSurf_Polygon2D;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_HeaderFile
|
||||
|
@@ -12,319 +12,323 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_BSplineCurve.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <DrawTrSurf_BSplineCurve.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <GeomTools_CurveSet.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve,DrawTrSurf_Curve)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
|
||||
|
||||
DrawTrSurf_BSplineCurve::DrawTrSurf_BSplineCurve (
|
||||
const Handle(Geom_BSplineCurve)& C) :
|
||||
DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1) {
|
||||
DrawTrSurf_BSplineCurve::DrawTrSurf_BSplineCurve (const Handle(Geom_BSplineCurve)& C)
|
||||
: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1)
|
||||
{
|
||||
|
||||
drawKnots = Standard_True;
|
||||
knotsForm = Draw_Losange;
|
||||
knotsLook = Draw_violet;
|
||||
knotsDim = 5;
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
drawKnots = Standard_True;
|
||||
knotsForm = Draw_Losange;
|
||||
knotsLook = Draw_violet;
|
||||
knotsDim = 5;
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
DrawTrSurf_BSplineCurve::DrawTrSurf_BSplineCurve (const Handle(Geom_BSplineCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Draw_Color& KnotsColor,
|
||||
const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode)
|
||||
{
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DrawTrSurf_BSplineCurve::DrawTrSurf_BSplineCurve (
|
||||
const Handle(Geom_BSplineCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Draw_Color& KnotsColor,
|
||||
const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Curve (C , CurvColor, Discret, Deflection, DrawMode) {
|
||||
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis) const {
|
||||
|
||||
|
||||
Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
if (drawPoles) {
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++) {
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
if (C->IsPeriodic())
|
||||
dis.DrawTo(CPoles(1));
|
||||
void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
if (drawPoles)
|
||||
{
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++)
|
||||
{
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve::DrawOn(dis);
|
||||
|
||||
if (drawKnots) {
|
||||
Standard_Integer NbKnots = C->NbKnots();
|
||||
TColStd_Array1OfReal CKnots (1, NbKnots);
|
||||
C->Knots (CKnots);
|
||||
dis.SetColor(knotsLook);
|
||||
Standard_Integer first = C->FirstUKnotIndex();
|
||||
Standard_Integer last = C->LastUKnotIndex();
|
||||
for (Standard_Integer i = first; i <= last; i++) {
|
||||
dis.DrawMarker (C->Value (CKnots (i)), knotsForm, knotsDim);
|
||||
}
|
||||
if (C->IsPeriodic())
|
||||
{
|
||||
dis.DrawTo(CPoles(1));
|
||||
}
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve::DrawOn (dis);
|
||||
if (drawKnots)
|
||||
{
|
||||
Standard_Integer NbKnots = C->NbKnots();
|
||||
TColStd_Array1OfReal CKnots (1, NbKnots);
|
||||
C->Knots (CKnots);
|
||||
dis.SetColor(knotsLook);
|
||||
Standard_Integer first = C->FirstUKnotIndex();
|
||||
Standard_Integer last = C->LastUKnotIndex();
|
||||
for (Standard_Integer i = first; i <= last; i++)
|
||||
{
|
||||
dis.DrawMarker (C->Value (CKnots (i)), knotsForm, knotsDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis,
|
||||
const Standard_Boolean ShowPoles,
|
||||
const Standard_Boolean ShowKnots) const
|
||||
{
|
||||
Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
if (drawPoles && ShowPoles)
|
||||
{
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++)
|
||||
{
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve::DrawOn(dis);
|
||||
|
||||
void DrawTrSurf_BSplineCurve::DrawOn (
|
||||
|
||||
Draw_Display& dis,
|
||||
const Standard_Boolean ShowPoles,
|
||||
const Standard_Boolean ShowKnots
|
||||
) const {
|
||||
if (drawKnots && ShowKnots)
|
||||
{
|
||||
Standard_Integer NbKnots = C->NbKnots();
|
||||
TColStd_Array1OfReal CKnots (1, NbKnots);
|
||||
C->Knots (CKnots);
|
||||
dis.SetColor(knotsLook);
|
||||
for (Standard_Integer i = 1; i <= NbKnots; i++)
|
||||
{
|
||||
dis.DrawMarker (C->Value (CKnots (i)), knotsForm, knotsDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineCurve::DrawOn (Draw_Display& dis,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Integer Pindex,
|
||||
const Standard_Boolean ShowPoles,
|
||||
const Standard_Boolean ShowKnots) const
|
||||
{
|
||||
Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
Standard_Real Eps1 = Abs(Epsilon (U1));
|
||||
Standard_Real Eps2 = Abs(Epsilon (U2));
|
||||
Standard_Integer I1, J1, I2, J2;
|
||||
C->LocateU (U1, Eps1, I1, J1);
|
||||
C->LocateU (U2, Eps2, I2, J2);
|
||||
Standard_Integer ka = C->FirstUKnotIndex ();
|
||||
Standard_Integer kb = C->LastUKnotIndex ();
|
||||
|
||||
Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
if (drawPoles && ShowPoles) {
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
if (drawPoles && ShowPoles)
|
||||
{
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
if (Pindex == 0)
|
||||
{
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++) {
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++)
|
||||
{
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve::DrawOn(dis);
|
||||
|
||||
if (drawKnots && ShowKnots) {
|
||||
Standard_Integer NbKnots = C->NbKnots();
|
||||
TColStd_Array1OfReal CKnots (1, NbKnots);
|
||||
C->Knots (CKnots);
|
||||
dis.SetColor(knotsLook);
|
||||
for (Standard_Integer i = 1; i <= NbKnots; i++) {
|
||||
dis.DrawMarker (C->Value (CKnots (i)), knotsForm, knotsDim);
|
||||
}
|
||||
else if (Pindex == 1)
|
||||
{
|
||||
dis.MoveTo(CPoles(1));
|
||||
dis.DrawTo(CPoles(2));
|
||||
}
|
||||
else if (Pindex == NbPoles)
|
||||
{
|
||||
dis.MoveTo(CPoles(NbPoles-1));
|
||||
dis.DrawTo(CPoles(NbPoles));
|
||||
}
|
||||
else
|
||||
{
|
||||
dis.MoveTo(CPoles(Pindex-1));
|
||||
dis.DrawTo(CPoles(Pindex));
|
||||
dis.DrawTo(CPoles(Pindex+1));
|
||||
}
|
||||
}
|
||||
|
||||
dis.SetColor(look);
|
||||
Standard_Integer Degree = C->Degree();
|
||||
if (Degree == 1)
|
||||
{
|
||||
dis.MoveTo(C->Value(U1));
|
||||
dis.DrawTo(C->Value(U2));
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Integer NbPoints;
|
||||
Standard_Integer Discret = GetDiscretisation();
|
||||
Standard_Real Ustart = C->Knot (ka);
|
||||
Standard_Real Uend = C->Knot (kb);
|
||||
Standard_Real Du, U, Ua, Ub, Uk1, Uk2;
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::DrawOn (
|
||||
|
||||
Draw_Display& dis,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real U2,
|
||||
const Standard_Integer Pindex,
|
||||
const Standard_Boolean ShowPoles,
|
||||
const Standard_Boolean ShowKnots
|
||||
) const {
|
||||
|
||||
|
||||
Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
Standard_Real Eps1 = Abs(Epsilon (U1));
|
||||
Standard_Real Eps2 = Abs(Epsilon (U2));
|
||||
Standard_Integer I1, J1, I2, J2;
|
||||
C->LocateU (U1, Eps1, I1, J1);
|
||||
C->LocateU (U2, Eps2, I2, J2);
|
||||
Standard_Integer ka = C->FirstUKnotIndex ();
|
||||
Standard_Integer kb = C->LastUKnotIndex ();
|
||||
|
||||
|
||||
if (drawPoles && ShowPoles) {
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
if (Pindex == 0) {
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++) {
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
if (I1 > ka) { ka = I1; Uk1 = U1; }
|
||||
else
|
||||
{
|
||||
U = U1;
|
||||
NbPoints = (Standard_Integer) Abs (Discret * (U1 - Ustart) / (Ustart - Uend));
|
||||
NbPoints = Max (NbPoints, 30);
|
||||
Du = (Ustart - U1) / NbPoints;
|
||||
dis.MoveTo(C->Value (U));
|
||||
for (Standard_Integer i = 1; i <= NbPoints - 2; i++) {
|
||||
U+= Du;
|
||||
dis.DrawTo(C->Value (U));
|
||||
}
|
||||
else if (Pindex == 1) {
|
||||
dis.MoveTo(CPoles(1));
|
||||
dis.DrawTo(CPoles(2));
|
||||
}
|
||||
else if (Pindex == NbPoles) {
|
||||
dis.MoveTo(CPoles(NbPoles-1));
|
||||
dis.DrawTo(CPoles(NbPoles));
|
||||
}
|
||||
else {
|
||||
dis.MoveTo(CPoles(Pindex-1));
|
||||
dis.DrawTo(CPoles(Pindex));
|
||||
dis.DrawTo(CPoles(Pindex+1));
|
||||
dis.DrawTo(C->Value (Ustart));
|
||||
Uk1 = Ustart;
|
||||
}
|
||||
|
||||
if (J2 < kb) { kb = J2; Uk2 = U2; }
|
||||
else
|
||||
{
|
||||
Uk2 = Uend;
|
||||
U = Uend;
|
||||
NbPoints = (Standard_Integer) Abs (Discret * (U2 - Uend) / (Ustart - Uend));
|
||||
NbPoints = Max (NbPoints, 30);
|
||||
Du = (U2 - Uend) / NbPoints;
|
||||
dis.MoveTo(C->Value (U));
|
||||
for (Standard_Integer i = 1; i <= NbPoints - 2; i++)
|
||||
{
|
||||
U+= Du;
|
||||
dis.DrawTo(C->Value (U));
|
||||
}
|
||||
dis.DrawTo(C->Value (U2));
|
||||
}
|
||||
|
||||
|
||||
|
||||
dis.SetColor(look);
|
||||
Standard_Integer Degree = C->Degree();
|
||||
|
||||
if (Degree == 1) {
|
||||
dis.MoveTo(C->Value(U1));
|
||||
dis.DrawTo(C->Value(U2));
|
||||
for (Standard_Integer k = ka; k < kb; k++)
|
||||
{
|
||||
if (k == ka)
|
||||
{
|
||||
Ua = Uk1;
|
||||
Ub = C->Knot (k+1);
|
||||
}
|
||||
else if (k == kb-1)
|
||||
{
|
||||
Ua = C->Knot (k);
|
||||
Ub = Uk2;
|
||||
}
|
||||
else
|
||||
{
|
||||
Ua = C->Knot (k);
|
||||
Ub = C->Knot (k+1);
|
||||
}
|
||||
U = Ua;
|
||||
NbPoints = (Standard_Integer) Abs (Discret * (Ua - Ub) / (Ustart - Uend));
|
||||
NbPoints = Max (NbPoints, 30);
|
||||
Du = (Ub - Ua) / NbPoints;
|
||||
dis.MoveTo(C->Value (U));
|
||||
for (Standard_Integer i = 1; i <= NbPoints - 2; i++)
|
||||
{
|
||||
U+= Du;
|
||||
dis.DrawTo(C->Value (U));
|
||||
}
|
||||
dis.DrawTo(C->Value (Ub));
|
||||
}
|
||||
else {
|
||||
Standard_Integer NbPoints;
|
||||
Standard_Integer Discret = GetDiscretisation();
|
||||
Standard_Real Ustart = C->Knot (ka);
|
||||
Standard_Real Uend = C->Knot (kb);
|
||||
Standard_Real Du, U, Ua, Ub, Uk1, Uk2;
|
||||
}
|
||||
|
||||
if (I1 > ka) { ka = I1; Uk1 = U1; }
|
||||
else {
|
||||
U = U1;
|
||||
NbPoints = (Standard_Integer) Abs (Discret * (U1 - Ustart) / (Ustart - Uend));
|
||||
NbPoints = Max (NbPoints, 30);
|
||||
Du = (Ustart - U1) / NbPoints;
|
||||
dis.MoveTo(C->Value (U));
|
||||
for (Standard_Integer i = 1; i <= NbPoints - 2; i++) {
|
||||
U+= Du;
|
||||
dis.DrawTo(C->Value (U));
|
||||
}
|
||||
dis.DrawTo(C->Value (Ustart));
|
||||
Uk1 = Ustart;
|
||||
}
|
||||
|
||||
if (J2 < kb) { kb = J2; Uk2 = U2; }
|
||||
else {
|
||||
Uk2 = Uend;
|
||||
U = Uend;
|
||||
NbPoints = (Standard_Integer) Abs (Discret * (U2 - Uend) / (Ustart - Uend));
|
||||
NbPoints = Max (NbPoints, 30);
|
||||
Du = (U2 - Uend) / NbPoints;
|
||||
dis.MoveTo(C->Value (U));
|
||||
for (Standard_Integer i = 1; i <= NbPoints - 2; i++) {
|
||||
U+= Du;
|
||||
dis.DrawTo(C->Value (U));
|
||||
}
|
||||
dis.DrawTo(C->Value (U2));
|
||||
}
|
||||
|
||||
|
||||
for (Standard_Integer k = ka; k < kb; k++) {
|
||||
if (k == ka) {
|
||||
Ua = Uk1;
|
||||
Ub = C->Knot (k+1);
|
||||
}
|
||||
else if (k == kb-1) {
|
||||
Ua = C->Knot (k);
|
||||
Ub = Uk2;
|
||||
}
|
||||
else {
|
||||
Ua = C->Knot (k);
|
||||
Ub = C->Knot (k+1);
|
||||
}
|
||||
U = Ua;
|
||||
NbPoints = (Standard_Integer) Abs (Discret * (Ua - Ub) / (Ustart - Uend));
|
||||
NbPoints = Max (NbPoints, 30);
|
||||
Du = (Ub - Ua) / NbPoints;
|
||||
dis.MoveTo(C->Value (U));
|
||||
for (Standard_Integer i = 1; i <= NbPoints - 2; i++) {
|
||||
U+= Du;
|
||||
dis.DrawTo(C->Value (U));
|
||||
}
|
||||
dis.DrawTo(C->Value (Ub));
|
||||
}
|
||||
if (drawKnots && ShowKnots)
|
||||
{
|
||||
Standard_Integer NbKnots = C->NbKnots();
|
||||
TColStd_Array1OfReal CKnots (1, NbKnots);
|
||||
C->Knots (CKnots);
|
||||
dis.SetColor(knotsLook);
|
||||
for (Standard_Integer i = J1; i <= I2; i++)
|
||||
{
|
||||
dis.DrawMarker (C->Value (CKnots (i)), knotsForm, knotsDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (drawKnots && ShowKnots) {
|
||||
Standard_Integer NbKnots = C->NbKnots();
|
||||
TColStd_Array1OfReal CKnots (1, NbKnots);
|
||||
C->Knots (CKnots);
|
||||
dis.SetColor(knotsLook);
|
||||
for (Standard_Integer i = J1; i <= I2; i++) {
|
||||
dis.DrawMarker (C->Value (CKnots (i)), knotsForm, knotsDim);
|
||||
}
|
||||
void DrawTrSurf_BSplineCurve::FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real XPrec,
|
||||
Standard_Integer& Index) const
|
||||
{
|
||||
Handle(Geom_BSplineCurve) bc = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Index++;
|
||||
Standard_Integer NbPoles = bc->NbPoles();
|
||||
while (Index <= NbPoles)
|
||||
{
|
||||
if (D.Project(bc->Pole(Index)).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::ShowPoles () { drawPoles = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::ShowKnots () { drawKnots = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::ClearPoles () { drawPoles = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::ClearKnots () { drawKnots = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::FindPole (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real XPrec,
|
||||
Standard_Integer& Index) const {
|
||||
|
||||
Handle(Geom_BSplineCurve) bc = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Index++;
|
||||
Standard_Integer NbPoles = bc->NbPoles();
|
||||
while (Index <= NbPoles) {
|
||||
if (D.Project(bc->Pole(Index)).Distance(p1) <= Prec)
|
||||
return;
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve::FindKnot (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& Index) const {
|
||||
|
||||
Handle(Geom_BSplineCurve) bc = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
gp_Pnt2d p1(X,Y);
|
||||
Index++;
|
||||
Standard_Integer NbKnots = bc->NbKnots();
|
||||
while (Index <= NbKnots) {
|
||||
if (D.Project(bc->Value(bc->Knot(Index))).Distance(p1) <= Prec)
|
||||
return;
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineCurve::FindKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& Index) const
|
||||
{
|
||||
Handle(Geom_BSplineCurve) bc = Handle(Geom_BSplineCurve)::DownCast(curv);
|
||||
gp_Pnt2d p1(X,Y);
|
||||
Index++;
|
||||
Standard_Integer NbKnots = bc->NbKnots();
|
||||
while (Index <= NbKnots)
|
||||
{
|
||||
if (D.Project(bc->Value(bc->Knot(Index))).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineCurve::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineCurve::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_BSplineCurve) DC = new DrawTrSurf_BSplineCurve
|
||||
(Handle(Geom_BSplineCurve)::DownCast(curv->Copy()),
|
||||
look,polesLook,knotsLook,knotsForm,knotsDim,
|
||||
drawPoles,drawKnots,
|
||||
GetDiscretisation(),GetDeflection(),GetDrawMode());
|
||||
|
||||
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineCurve::Restore (std::istream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom_BSplineCurve) aGeomCurve = Handle(Geom_BSplineCurve)::DownCast (GeomTools_CurveSet::ReadCurve (theStream));
|
||||
Handle(DrawTrSurf_BSplineCurve) aDrawCurve = new DrawTrSurf_BSplineCurve (aGeomCurve,
|
||||
aParams.CurvColor, aParams.PolesColor, aParams.KnotsColor,
|
||||
aParams.KnotsMarker, aParams.KnotsSize,
|
||||
aParams.IsShowPoles, aParams.IsShowKnots,
|
||||
aParams.Discret, aParams.Deflection, aParams.DrawMode);
|
||||
return aDrawCurve;
|
||||
}
|
||||
|
@@ -17,55 +17,46 @@
|
||||
#ifndef _DrawTrSurf_BSplineCurve_HeaderFile
|
||||
#define _DrawTrSurf_BSplineCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <DrawTrSurf_Curve.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom_BSplineCurve;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_BSplineCurve;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
|
||||
|
||||
|
||||
class DrawTrSurf_BSplineCurve : public DrawTrSurf_Curve
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve, DrawTrSurf_Curve)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve (const Handle(Geom_BSplineCurve)& C);
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of
|
||||
//! package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve(const Handle(Geom_BSplineCurve)& C);
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve (const Handle(Geom_BSplineCurve)& C,
|
||||
const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape,
|
||||
const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of
|
||||
//! package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve(const Handle(Geom_BSplineCurve)& C, const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots) const;
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis, const Standard_Real U1, const Standard_Real U2, const Standard_Integer Pindex, const Standard_Boolean ShowPoles = Standard_True, const Standard_Boolean ShowKnots = Standard_True) const;
|
||||
|
||||
Standard_EXPORT void ShowPoles();
|
||||
|
||||
Standard_EXPORT void ShowKnots();
|
||||
|
||||
Standard_EXPORT void ClearPoles();
|
||||
|
||||
Standard_EXPORT void ClearKnots();
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots) const;
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis,
|
||||
const Standard_Real U1, const Standard_Real U2, const Standard_Integer Pindex,
|
||||
const Standard_Boolean ShowPoles = Standard_True, const Standard_Boolean ShowKnots = Standard_True) const;
|
||||
|
||||
void ShowPoles() { drawPoles = Standard_True; }
|
||||
|
||||
void ShowKnots() { drawKnots = Standard_True; }
|
||||
|
||||
void ClearPoles() { drawPoles = Standard_False; }
|
||||
|
||||
void ClearKnots() { drawKnots = Standard_False; }
|
||||
|
||||
//! Returns in <Index> the index of the first pole of the
|
||||
//! curve projected by the Display <D> at a distance lower
|
||||
@@ -73,37 +64,26 @@ public:
|
||||
//! set to 0, else index is always greater than the input
|
||||
//! value of index.
|
||||
Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
|
||||
|
||||
|
||||
Standard_EXPORT void FindKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
|
||||
|
||||
void SetPolesColor (const Draw_Color& aColor);
|
||||
|
||||
void SetKnotsColor (const Draw_Color& aColor);
|
||||
|
||||
void SetKnotsShape (const Draw_MarkerShape Shape);
|
||||
|
||||
Draw_MarkerShape KnotsShape() const;
|
||||
|
||||
Draw_Color KnotsColor() const;
|
||||
|
||||
Draw_Color PolesColor() const;
|
||||
|
||||
|
||||
void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
|
||||
|
||||
void SetKnotsColor (const Draw_Color& theColor) { knotsLook = theColor; }
|
||||
|
||||
void SetKnotsShape (const Draw_MarkerShape theShape) { knotsForm = theShape; }
|
||||
|
||||
Draw_MarkerShape KnotsShape() const { return knotsForm; }
|
||||
|
||||
Draw_Color KnotsColor() const { return knotsLook; }
|
||||
|
||||
Draw_Color PolesColor() const { return polesLook; }
|
||||
|
||||
//! For variable copy.
|
||||
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve,DrawTrSurf_Curve)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean drawPoles;
|
||||
Standard_Boolean drawKnots;
|
||||
Draw_MarkerShape knotsForm;
|
||||
@@ -111,14 +91,6 @@ private:
|
||||
Standard_Integer knotsDim;
|
||||
Draw_Color polesLook;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_BSplineCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_BSplineCurve_HeaderFile
|
||||
|
@@ -1,51 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline void DrawTrSurf_BSplineCurve::SetPolesColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
polesLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BSplineCurve::SetKnotsColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
knotsLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BSplineCurve::SetKnotsShape (
|
||||
const Draw_MarkerShape Shape) {
|
||||
|
||||
knotsForm = Shape;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_MarkerShape DrawTrSurf_BSplineCurve::KnotsShape () const {
|
||||
|
||||
return knotsForm;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BSplineCurve::KnotsColor () const {
|
||||
|
||||
return knotsLook;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BSplineCurve::PolesColor () const {
|
||||
|
||||
return polesLook;
|
||||
}
|
@@ -12,54 +12,48 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_BSplineCurve2d.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <DrawTrSurf_BSplineCurve2d.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <GeomTools_Curve2dSet.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve2d,DrawTrSurf_Curve2d)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
DrawTrSurf_BSplineCurve2d::DrawTrSurf_BSplineCurve2d (
|
||||
const Handle(Geom2d_BSplineCurve)& C)
|
||||
: DrawTrSurf_Curve2d (C, Draw_vert, 100) {
|
||||
|
||||
drawKnots = Standard_True;
|
||||
knotsForm = Draw_Losange;
|
||||
knotsLook = Draw_violet;
|
||||
knotsDim = 5;
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DrawTrSurf_BSplineCurve2d::DrawTrSurf_BSplineCurve2d (
|
||||
const Handle(Geom2d_BSplineCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Draw_Color& KnotsColor,
|
||||
const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret)
|
||||
: DrawTrSurf_Curve2d (C, CurvColor, Discret) {
|
||||
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::DrawOn (Draw_Display& dis) const
|
||||
DrawTrSurf_BSplineCurve2d::DrawTrSurf_BSplineCurve2d (const Handle(Geom2d_BSplineCurve)& C)
|
||||
: DrawTrSurf_Curve2d (C, Draw_vert, 100)
|
||||
{
|
||||
drawKnots = Standard_True;
|
||||
knotsForm = Draw_Losange;
|
||||
knotsLook = Draw_violet;
|
||||
knotsDim = 5;
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
DrawTrSurf_BSplineCurve2d::DrawTrSurf_BSplineCurve2d (const Handle(Geom2d_BSplineCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Draw_Color& KnotsColor,
|
||||
const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret)
|
||||
: DrawTrSurf_Curve2d (C, CurvColor, Discret)
|
||||
{
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
Handle(Geom2d_BSplineCurve) C = Handle(Geom2d_BSplineCurve)::DownCast(curv);
|
||||
|
||||
if (drawPoles) {
|
||||
@@ -89,74 +83,78 @@ void DrawTrSurf_BSplineCurve2d::DrawOn (Draw_Display& dis) const
|
||||
}
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real XPrec,
|
||||
Standard_Integer& Index) const
|
||||
{
|
||||
Handle(Geom2d_BSplineCurve) bc = Handle(Geom2d_BSplineCurve)::DownCast(curv);
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Index++;
|
||||
Standard_Integer NbPoles = bc->NbPoles();
|
||||
gp_Pnt P;
|
||||
gp_Pnt2d P2d;
|
||||
while (Index <= NbPoles)
|
||||
{
|
||||
P2d = bc->Pole(Index);
|
||||
P.SetCoord (P2d.X(), P2d.Y(), 0.0);
|
||||
if (D.Project(P).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::ShowPoles () { drawPoles = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::ShowKnots () { drawKnots = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::ClearPoles () { drawPoles = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::ClearKnots () { drawKnots = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::FindPole (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real XPrec,
|
||||
Standard_Integer& Index) const {
|
||||
|
||||
Handle(Geom2d_BSplineCurve) bc = Handle(Geom2d_BSplineCurve)::DownCast(curv);
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Index++;
|
||||
Standard_Integer NbPoles = bc->NbPoles();
|
||||
gp_Pnt P;
|
||||
gp_Pnt2d P2d;
|
||||
while (Index <= NbPoles) {
|
||||
P2d = bc->Pole(Index);
|
||||
P.SetCoord (P2d.X(), P2d.Y(), 0.0);
|
||||
if (D.Project(P).Distance(p1) <= Prec)
|
||||
return;
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineCurve2d::FindKnot (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& Index) const {
|
||||
|
||||
Handle(Geom2d_BSplineCurve) bc = Handle(Geom2d_BSplineCurve)::DownCast(curv);
|
||||
gp_Pnt2d P2d;
|
||||
gp_Pnt P;
|
||||
gp_Pnt2d p1(X,Y);
|
||||
Index++;
|
||||
Standard_Integer NbKnots = bc->NbKnots();
|
||||
while (Index <= NbKnots) {
|
||||
P2d = bc->Value(bc->Knot(Index));
|
||||
P.SetCoord (P2d.X(), P2d.Y(), 0.0);
|
||||
if (D.Project(P).Distance(p1) <= Prec)
|
||||
return;
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
void DrawTrSurf_BSplineCurve2d::FindKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& Index) const
|
||||
{
|
||||
Handle(Geom2d_BSplineCurve) bc = Handle(Geom2d_BSplineCurve)::DownCast(curv);
|
||||
gp_Pnt2d P2d;
|
||||
gp_Pnt P;
|
||||
gp_Pnt2d p1(X,Y);
|
||||
Index++;
|
||||
Standard_Integer NbKnots = bc->NbKnots();
|
||||
while (Index <= NbKnots)
|
||||
{
|
||||
P2d = bc->Value(bc->Knot(Index));
|
||||
P.SetCoord (P2d.X(), P2d.Y(), 0.0);
|
||||
if (D.Project(P).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineCurve2d::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineCurve2d::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_BSplineCurve2d) DC = new DrawTrSurf_BSplineCurve2d
|
||||
(Handle(Geom2d_BSplineCurve)::DownCast(curv->Copy()),
|
||||
look,polesLook,knotsLook,knotsForm,knotsDim,
|
||||
drawPoles,drawKnots,
|
||||
GetDiscretisation());
|
||||
|
||||
|
||||
return DC;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineCurve2d::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom2d_BSplineCurve) aGeomCurve = Handle(Geom2d_BSplineCurve)::DownCast (GeomTools_Curve2dSet::ReadCurve2d (theStream));
|
||||
Handle(DrawTrSurf_BSplineCurve2d) aDrawCurve = new DrawTrSurf_BSplineCurve2d (aGeomCurve,
|
||||
aParams.CurvColor, aParams.PolesColor, aParams.KnotsColor,
|
||||
aParams.KnotsMarker, aParams.KnotsSize,
|
||||
aParams.IsShowPoles, aParams.IsShowKnots,
|
||||
aParams.Discret);
|
||||
return aDrawCurve;
|
||||
}
|
||||
|
@@ -17,85 +17,65 @@
|
||||
#ifndef _DrawTrSurf_BSplineCurve2d_HeaderFile
|
||||
#define _DrawTrSurf_BSplineCurve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <DrawTrSurf_Curve2d.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom2d_BSplineCurve;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_BSplineCurve2d;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
|
||||
class DrawTrSurf_BSplineCurve2d : public DrawTrSurf_Curve2d
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve2d, DrawTrSurf_Curve2d)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of package Geom2d.
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve2d (const Handle(Geom2d_BSplineCurve)& C);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve2d (const Handle(Geom2d_BSplineCurve)& C,
|
||||
const Draw_Color& CurvColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
void ShowPoles() { drawPoles = Standard_True; }
|
||||
|
||||
void ShowKnots() { drawKnots = Standard_True; }
|
||||
|
||||
void ClearPoles() { drawPoles = Standard_False; }
|
||||
|
||||
void ClearKnots() { drawKnots = Standard_False; }
|
||||
|
||||
//! creates a drawable BSpline curve from a BSpline curve of
|
||||
//! package Geom2d.
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve2d(const Handle(Geom2d_BSplineCurve)& C);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BSplineCurve2d(const Handle(Geom2d_BSplineCurve)& C, const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ShowPoles();
|
||||
|
||||
Standard_EXPORT void ShowKnots();
|
||||
|
||||
Standard_EXPORT void ClearPoles();
|
||||
|
||||
Standard_EXPORT void ClearKnots();
|
||||
|
||||
//! Returns in <Index> the index of the first pole of the
|
||||
//! curve projected by the Display <D> at a distance lower
|
||||
//! than <Prec> from <X,Y>. If no pole is found index is
|
||||
//! set to 0, else index is always greater than the input
|
||||
//! value of index.
|
||||
Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
|
||||
|
||||
|
||||
Standard_EXPORT void FindKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
|
||||
|
||||
void SetPolesColor (const Draw_Color& aColor);
|
||||
|
||||
void SetKnotsColor (const Draw_Color& aColor);
|
||||
|
||||
void SetKnotsShape (const Draw_MarkerShape Shape);
|
||||
|
||||
Draw_MarkerShape KnotsShape() const;
|
||||
|
||||
Draw_Color KnotsColor() const;
|
||||
|
||||
Draw_Color PolesColor() const;
|
||||
|
||||
|
||||
void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
|
||||
|
||||
void SetKnotsColor (const Draw_Color& theColor) { knotsLook = theColor; }
|
||||
|
||||
void SetKnotsShape (const Draw_MarkerShape theShape) { knotsForm = theShape; }
|
||||
|
||||
Draw_MarkerShape KnotsShape() const { return knotsForm; }
|
||||
|
||||
Draw_Color KnotsColor() const { return knotsLook; }
|
||||
|
||||
Draw_Color PolesColor() const { return polesLook; }
|
||||
|
||||
//! For variable copy.
|
||||
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineCurve2d,DrawTrSurf_Curve2d)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean drawPoles;
|
||||
Standard_Boolean drawKnots;
|
||||
Draw_MarkerShape knotsForm;
|
||||
@@ -103,14 +83,6 @@ private:
|
||||
Standard_Integer knotsDim;
|
||||
Draw_Color polesLook;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_BSplineCurve2d.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_BSplineCurve2d_HeaderFile
|
||||
|
@@ -1,52 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline void DrawTrSurf_BSplineCurve2d::SetPolesColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
polesLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BSplineCurve2d::SetKnotsColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
knotsLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BSplineCurve2d::SetKnotsShape (
|
||||
const Draw_MarkerShape Shape) {
|
||||
|
||||
knotsForm = Shape;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_MarkerShape DrawTrSurf_BSplineCurve2d::KnotsShape () const {
|
||||
|
||||
return knotsForm;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BSplineCurve2d::KnotsColor () const {
|
||||
|
||||
return knotsLook;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BSplineCurve2d::PolesColor () const {
|
||||
|
||||
return polesLook;
|
||||
}
|
||||
|
@@ -12,117 +12,115 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_BSplineSurface.hxx>
|
||||
|
||||
#include <Adaptor3d_IsoCurve.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_BSplineCurve.hxx>
|
||||
#include <DrawTrSurf_BSplineSurface.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomTools_SurfaceSet.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface,DrawTrSurf_Surface)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
|
||||
DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (
|
||||
const Handle(Geom_BSplineSurface)& S)
|
||||
: DrawTrSurf_Surface (S, S->NbUKnots()-2, S->NbVKnots()-2,
|
||||
Draw_jaune, Draw_bleu, 30, 0.05, 0){
|
||||
DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S)
|
||||
: DrawTrSurf_Surface (S, S->NbUKnots()-2, S->NbVKnots()-2,
|
||||
Draw_jaune, Draw_bleu, 30, 0.05, 0)
|
||||
{
|
||||
drawPoles = Standard_True;
|
||||
drawKnots = Standard_True;
|
||||
knotsIsos = Standard_True;
|
||||
knotsForm = Draw_Losange;
|
||||
knotsLook = Draw_violet;
|
||||
knotsDim = 5;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
drawPoles = Standard_True;
|
||||
drawKnots = Standard_True;
|
||||
knotsIsos = Standard_True;
|
||||
knotsForm = Draw_Losange;
|
||||
knotsLook = Draw_violet;
|
||||
knotsDim = 5;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S, const Draw_Color& BoundsColor,
|
||||
const Draw_Color& IsosColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape,
|
||||
const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Surface (S, S->NbUKnots()-2, S->NbVKnots()-2, BoundsColor,
|
||||
IsosColor, Discret, Deflection, DrawMode)
|
||||
{
|
||||
knotsIsos = Standard_True;
|
||||
drawPoles = ShowPoles;
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S, const Standard_Integer NbUIsos,
|
||||
const Standard_Integer NbVIsos, const Draw_Color& BoundsColor,
|
||||
const Draw_Color& IsosColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape,
|
||||
const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Surface (S, Abs(NbUIsos), Abs(NbVIsos), BoundsColor,
|
||||
IsosColor, Discret, Deflection, DrawMode)
|
||||
{
|
||||
knotsIsos = Standard_False;
|
||||
drawPoles = ShowPoles;
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (
|
||||
const Handle(Geom_BSplineSurface)& S, const Draw_Color& BoundsColor,
|
||||
const Draw_Color& IsosColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape,
|
||||
const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Surface (S, S->NbUKnots()-2, S->NbVKnots()-2, BoundsColor,
|
||||
IsosColor, Discret, Deflection, DrawMode){
|
||||
|
||||
knotsIsos = Standard_True;
|
||||
drawPoles = ShowPoles;
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface (
|
||||
const Handle(Geom_BSplineSurface)& S, const Standard_Integer NbUIsos,
|
||||
const Standard_Integer NbVIsos, const Draw_Color& BoundsColor,
|
||||
const Draw_Color& IsosColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape,
|
||||
const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Surface (S, Abs(NbUIsos), Abs(NbVIsos), BoundsColor,
|
||||
IsosColor, Discret, Deflection, DrawMode){
|
||||
|
||||
knotsIsos = Standard_False;
|
||||
drawPoles = ShowPoles;
|
||||
drawKnots = ShowKnots;
|
||||
knotsForm = KnotsShape;
|
||||
knotsLook = KnotsColor;
|
||||
knotsDim = KnotsSize;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const {
|
||||
|
||||
void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
Handle(Geom_BSplineSurface) S = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
Standard_Integer i, j;
|
||||
|
||||
Standard_Real Ua,Ub,Va,Vb;
|
||||
S->Bounds(Ua,Ub,Va,Vb);
|
||||
|
||||
if (drawPoles) {
|
||||
if (drawPoles)
|
||||
{
|
||||
Standard_Integer NbUPoles = S->NbUPoles();
|
||||
Standard_Integer NbVPoles = S->NbVPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array2OfPnt SPoles (1, NbUPoles, 1, NbVPoles);
|
||||
S->Poles (SPoles);
|
||||
for (j = 1; j <= NbVPoles; j++) {
|
||||
for (j = 1; j <= NbVPoles; j++)
|
||||
{
|
||||
dis.MoveTo(SPoles(1, j));
|
||||
for (i = 2; i <= NbUPoles; i++) {
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
for (i = 2; i <= NbUPoles; i++)
|
||||
{
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
}
|
||||
if (S->IsUPeriodic())
|
||||
dis.DrawTo(SPoles(1,j));
|
||||
{
|
||||
dis.DrawTo(SPoles(1,j));
|
||||
}
|
||||
}
|
||||
for (i = 1; i <= NbUPoles; i++) {
|
||||
for (i = 1; i <= NbUPoles; i++)
|
||||
{
|
||||
dis.MoveTo(SPoles(i, 1));
|
||||
for (j = 2; j <= NbVPoles; j++) {
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
for (j = 2; j <= NbVPoles; j++)
|
||||
{
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
}
|
||||
if (S->IsVPeriodic())
|
||||
dis.DrawTo(SPoles(i,1));
|
||||
{
|
||||
dis.DrawTo(SPoles(i,1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (knotsIsos) {
|
||||
if (knotsIsos)
|
||||
{
|
||||
Standard_Integer first, last;
|
||||
Handle(GeomAdaptor_Surface) HS = new GeomAdaptor_Surface();
|
||||
HS->Load(surf);
|
||||
@@ -132,19 +130,22 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const {
|
||||
dis.SetColor(isosLook);
|
||||
first = S->FirstUKnotIndex() + 1;
|
||||
last = S->LastUKnotIndex() - 1;
|
||||
for (i = first; i <= last; i++) {
|
||||
for (i = first; i <= last; i++)
|
||||
{
|
||||
DrawIsoCurveOn(C,GeomAbs_IsoU,S->UKnot(i),Va,Vb,dis);
|
||||
}
|
||||
first = S->FirstVKnotIndex() + 1;
|
||||
last = S->LastVKnotIndex() - 1;
|
||||
for (j = first; j <= last; j++) {
|
||||
for (j = first; j <= last; j++)
|
||||
{
|
||||
DrawIsoCurveOn(C,GeomAbs_IsoV,S->VKnot(j),Ua,Ub,dis);
|
||||
}
|
||||
}
|
||||
|
||||
DrawTrSurf_Surface::DrawOn(dis,!knotsIsos);
|
||||
|
||||
if (drawKnots) {
|
||||
if (drawKnots)
|
||||
{
|
||||
Standard_Integer first, last;
|
||||
Standard_Integer NbUKnots = S->NbUKnots();
|
||||
TColStd_Array1OfReal SUKnots (1, NbUKnots);
|
||||
@@ -152,7 +153,8 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const {
|
||||
dis.SetColor(knotsLook);
|
||||
first = S->FirstUKnotIndex();
|
||||
last = S->LastUKnotIndex();
|
||||
for (i = first; i <= last; i++) {
|
||||
for (i = first; i <= last; i++)
|
||||
{
|
||||
dis.DrawMarker (S->Value (SUKnots(i), Va), knotsForm, knotsDim);
|
||||
}
|
||||
Standard_Integer NbVKnots = S->NbVKnots();
|
||||
@@ -161,145 +163,155 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const {
|
||||
dis.SetColor(knotsLook);
|
||||
first = S->FirstVKnotIndex();
|
||||
last = S->LastVKnotIndex();
|
||||
for (j = first; j <= last; j++) {
|
||||
for (j = first; j <= last; j++)
|
||||
{
|
||||
dis.DrawMarker (S->Value (Ua, SVKnots(j)), knotsForm, knotsDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ShowKnotsIsos()
|
||||
{
|
||||
knotsIsos = Standard_True;
|
||||
Handle(Geom_BSplineSurface) S = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
nbUIsos = S->NbUKnots()-2;
|
||||
nbVIsos = S->NbVKnots()-2;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ClearIsos()
|
||||
{
|
||||
knotsIsos = Standard_False;
|
||||
nbUIsos = 0;
|
||||
nbVIsos = 0;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ShowIsos (const Standard_Integer Nu, const Standard_Integer Nv)
|
||||
{
|
||||
knotsIsos = Standard_False;
|
||||
nbUIsos = Abs(Nu);
|
||||
nbVIsos = Abs(Nv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ShowPoles () { drawPoles = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ShowKnots () { drawKnots = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ClearPoles () { drawPoles = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ShowKnotsIsos () {
|
||||
knotsIsos = Standard_True;
|
||||
Handle(Geom_BSplineSurface) S = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
nbUIsos = S->NbUKnots()-2;
|
||||
nbVIsos = S->NbVKnots()-2;
|
||||
void DrawTrSurf_BSplineSurface::FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real XPrec,
|
||||
Standard_Integer& UIndex, Standard_Integer& VIndex) const
|
||||
{
|
||||
Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
UIndex++;
|
||||
VIndex++;
|
||||
Standard_Integer NbUPoles = bs->NbUPoles();
|
||||
Standard_Integer NbVPoles = bs->NbVPoles();
|
||||
while (VIndex <= NbVPoles)
|
||||
{
|
||||
while (UIndex <= NbUPoles)
|
||||
{
|
||||
if (D.Project(bs->Pole(UIndex, VIndex)).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
UIndex++;
|
||||
}
|
||||
UIndex = 1;
|
||||
VIndex++;
|
||||
}
|
||||
UIndex = VIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ClearIsos () {
|
||||
|
||||
knotsIsos = Standard_False;
|
||||
nbUIsos = 0;
|
||||
nbVIsos = 0;
|
||||
void DrawTrSurf_BSplineSurface::FindUKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& UIndex) const
|
||||
{
|
||||
Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X,Y);
|
||||
UIndex++;
|
||||
Standard_Integer NbUKnots = bs->NbUKnots();
|
||||
Standard_Real U1, U2, V1, V2;
|
||||
surf->Bounds (U1, U2, V1, V2);
|
||||
while (UIndex <= NbUKnots)
|
||||
{
|
||||
if (D.Project(bs->Value(bs->UKnot(UIndex), V1)).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
UIndex++;
|
||||
}
|
||||
UIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ShowIsos (
|
||||
const Standard_Integer Nu, const Standard_Integer Nv) {
|
||||
|
||||
knotsIsos = Standard_False;
|
||||
nbUIsos = Abs(Nu);
|
||||
nbVIsos = Abs(Nv);
|
||||
void DrawTrSurf_BSplineSurface::FindVKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& VIndex) const
|
||||
{
|
||||
Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X,Y);
|
||||
VIndex++;
|
||||
Standard_Integer NbVKnots = bs->NbVKnots();
|
||||
Standard_Real U1, U2, V1, V2;
|
||||
surf->Bounds (U1, U2, V1, V2);
|
||||
while (VIndex <= NbVKnots)
|
||||
{
|
||||
if (D.Project(bs->Value(U1, bs->VKnot(VIndex))).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
VIndex++;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::ClearKnots () { drawKnots = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::FindPole (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real XPrec,
|
||||
Standard_Integer& UIndex, Standard_Integer& VIndex) const {
|
||||
|
||||
Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
UIndex++;
|
||||
VIndex++;
|
||||
Standard_Integer NbUPoles = bs->NbUPoles();
|
||||
Standard_Integer NbVPoles = bs->NbVPoles();
|
||||
while (VIndex <= NbVPoles) {
|
||||
while (UIndex <= NbUPoles) {
|
||||
if (D.Project(bs->Pole(UIndex, VIndex)).Distance(p1) <= Prec)
|
||||
return;
|
||||
UIndex++;
|
||||
}
|
||||
UIndex = 1;
|
||||
VIndex++;
|
||||
}
|
||||
UIndex = VIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::FindUKnot (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& UIndex) const {
|
||||
|
||||
Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X,Y);
|
||||
UIndex++;
|
||||
Standard_Integer NbUKnots = bs->NbUKnots();
|
||||
Standard_Real U1, U2, V1, V2;
|
||||
surf->Bounds (U1, U2, V1, V2);
|
||||
while (UIndex <= NbUKnots) {
|
||||
if (D.Project(bs->Value(bs->UKnot(UIndex), V1)).Distance(p1) <= Prec)
|
||||
return;
|
||||
UIndex++;
|
||||
}
|
||||
UIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BSplineSurface::FindVKnot (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec,
|
||||
Standard_Integer& VIndex) const {
|
||||
|
||||
|
||||
Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X,Y);
|
||||
VIndex++;
|
||||
Standard_Integer NbVKnots = bs->NbVKnots();
|
||||
Standard_Real U1, U2, V1, V2;
|
||||
surf->Bounds (U1, U2, V1, V2);
|
||||
while (VIndex <= NbVKnots) {
|
||||
if (D.Project(bs->Value(U1, bs->VKnot(VIndex))).Distance(p1) <= Prec)
|
||||
return;
|
||||
VIndex++;
|
||||
}
|
||||
VIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
VIndex = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineSurface::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineSurface::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_BSplineSurface) DS;
|
||||
if (!knotsIsos)
|
||||
{
|
||||
DS = new DrawTrSurf_BSplineSurface
|
||||
(Handle(Geom_BSplineSurface)::DownCast(surf->Copy()),
|
||||
nbUIsos,nbVIsos,
|
||||
boundsLook,isosLook,polesLook,knotsLook,
|
||||
knotsForm,knotsDim,drawPoles,drawKnots,
|
||||
GetDiscretisation(),GetDeflection(),GetDrawMode());
|
||||
}
|
||||
else
|
||||
{
|
||||
DS = new DrawTrSurf_BSplineSurface
|
||||
(Handle(Geom_BSplineSurface)::DownCast(surf->Copy()),
|
||||
boundsLook,isosLook,polesLook,knotsLook,
|
||||
knotsForm,knotsDim,drawPoles,drawKnots,
|
||||
GetDiscretisation(),GetDeflection(),GetDrawMode());
|
||||
|
||||
}
|
||||
return DS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BSplineSurface::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom_BSplineSurface) aGeomSurface = Handle(Geom_BSplineSurface)::DownCast (GeomTools_SurfaceSet::ReadSurface (theStream));
|
||||
Handle(DrawTrSurf_BSplineSurface) aDrawSurface;
|
||||
if (!aParams.NeedKnotsIsos)
|
||||
{
|
||||
aDrawSurface = new DrawTrSurf_BSplineSurface (aGeomSurface,
|
||||
aParams.NbUIsos, aParams.NbVIsos,
|
||||
aParams.BoundsColor, aParams.IsosColor,
|
||||
aParams.PolesColor, aParams.KnotsColor,
|
||||
aParams.KnotsMarker, aParams.KnotsSize,
|
||||
aParams.IsShowPoles, aParams.IsShowKnots,
|
||||
aParams.Discret, aParams.Deflection, aParams.DrawMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
aDrawSurface = new DrawTrSurf_BSplineSurface (aGeomSurface,
|
||||
aParams.BoundsColor, aParams.IsosColor,
|
||||
aParams.PolesColor, aParams.KnotsColor,
|
||||
aParams.KnotsMarker, aParams.KnotsSize,
|
||||
aParams.IsShowPoles, aParams.IsShowKnots,
|
||||
aParams.Discret, aParams.Deflection, aParams.DrawMode);
|
||||
}
|
||||
return aDrawSurface;
|
||||
}
|
||||
|
@@ -17,25 +17,15 @@
|
||||
#ifndef _DrawTrSurf_BSplineSurface_HeaderFile
|
||||
#define _DrawTrSurf_BSplineSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <DrawTrSurf_Surface.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom_BSplineSurface;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_BSplineSurface;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
|
||||
|
||||
//! This class defines a drawable BSplineSurface.
|
||||
//! With this class you can draw the control points and the knots
|
||||
//! of the surface.
|
||||
@@ -43,80 +33,74 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
//! if you just want to sea boundaries and isoparametric curves.
|
||||
class DrawTrSurf_BSplineSurface : public DrawTrSurf_Surface
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface, DrawTrSurf_Surface)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! default drawing mode.
|
||||
//! The isoparametric curves corresponding to the knots values are
|
||||
//! drawn.
|
||||
//! The isoparametric curves corresponding to the knots values are drawn.
|
||||
//! The control points and the knots points are drawn.
|
||||
//! The boundaries are yellow, the isoparametric curves are blues.
|
||||
//! For the discretisation 50 points are computed in each parametric
|
||||
//! direction.
|
||||
Standard_EXPORT DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSurface)& S);
|
||||
|
||||
//! For the discretisation 50 points are computed in each parametric direction.
|
||||
Standard_EXPORT DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S);
|
||||
|
||||
//! The isoparametric curves corresponding to the knots values are drawn.
|
||||
Standard_EXPORT DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S,
|
||||
const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
//! The isoparametric curves corresponding to the knots values are
|
||||
//! drawn.
|
||||
Standard_EXPORT DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSurface)& S, const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
//! Parametric equidistant iso curves are drawn.
|
||||
Standard_EXPORT DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSurface)& S, const Standard_Integer NbUIsos, const Standard_Integer NbVIsos, const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor, const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize, const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ShowPoles();
|
||||
|
||||
Standard_EXPORT void ShowKnots();
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BSplineSurface (const Handle(Geom_BSplineSurface)& S,
|
||||
const Standard_Integer NbUIsos, const Standard_Integer NbVIsos,
|
||||
const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor,
|
||||
const Draw_Color& KnotsColor, const Draw_MarkerShape KnotsShape, const Standard_Integer KnotsSize,
|
||||
const Standard_Boolean ShowPoles, const Standard_Boolean ShowKnots,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
void ShowPoles() { drawPoles = Standard_True; }
|
||||
|
||||
void ShowKnots() { drawKnots = Standard_True; }
|
||||
|
||||
//! change the number of isoparametric curves to be drawn.
|
||||
Standard_EXPORT virtual void ShowIsos (const Standard_Integer Nu, const Standard_Integer Nv) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! change the number of isoparametric curves to be drawn.
|
||||
Standard_EXPORT void ShowKnotsIsos();
|
||||
|
||||
|
||||
//! rub out all the isoparametric curves.
|
||||
Standard_EXPORT virtual void ClearIsos() Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ClearPoles();
|
||||
|
||||
Standard_EXPORT void ClearKnots();
|
||||
|
||||
void ClearPoles() { drawPoles = Standard_False; }
|
||||
|
||||
void ClearKnots() { drawKnots = Standard_False; }
|
||||
|
||||
Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& UIndex, Standard_Integer& VIndex) const;
|
||||
|
||||
Standard_EXPORT void FindUKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& UIndex) const;
|
||||
|
||||
Standard_EXPORT void FindVKnot (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& VIndex) const;
|
||||
|
||||
void SetPolesColor (const Draw_Color& aColor);
|
||||
|
||||
void SetKnotsColor (const Draw_Color& aColor);
|
||||
|
||||
void SetKnotsShape (const Draw_MarkerShape Shape);
|
||||
|
||||
Draw_MarkerShape KnotsShape() const;
|
||||
|
||||
Draw_Color KnotsColor() const;
|
||||
|
||||
Draw_Color PolesColor() const;
|
||||
|
||||
|
||||
void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
|
||||
|
||||
void SetKnotsColor (const Draw_Color& theColor) { knotsLook = theColor; }
|
||||
|
||||
void SetKnotsShape (const Draw_MarkerShape theShape) { knotsForm = theShape; }
|
||||
|
||||
Draw_MarkerShape KnotsShape() const { return knotsForm; }
|
||||
|
||||
Draw_Color KnotsColor() const { return knotsLook; }
|
||||
|
||||
Draw_Color PolesColor() const { return polesLook; }
|
||||
|
||||
//! For variable copy.
|
||||
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BSplineSurface,DrawTrSurf_Surface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean drawPoles;
|
||||
Standard_Boolean drawKnots;
|
||||
Standard_Boolean knotsIsos;
|
||||
@@ -125,14 +109,6 @@ private:
|
||||
Standard_Integer knotsDim;
|
||||
Draw_Color polesLook;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_BSplineSurface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_BSplineSurface_HeaderFile
|
||||
|
@@ -1,51 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline void DrawTrSurf_BSplineSurface::SetKnotsColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
knotsLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BSplineSurface::SetKnotsShape (
|
||||
const Draw_MarkerShape Shape) {
|
||||
|
||||
knotsForm = Shape;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BSplineSurface::SetPolesColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
polesLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_MarkerShape DrawTrSurf_BSplineSurface::KnotsShape () const {
|
||||
|
||||
return knotsForm;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BSplineSurface::KnotsColor () const {
|
||||
|
||||
return knotsLook;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BSplineSurface::PolesColor () const {
|
||||
|
||||
return polesLook;
|
||||
}
|
@@ -12,103 +12,99 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_BezierCurve.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_BezierCurve.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom_BezierCurve.hxx>
|
||||
#include <GeomTools_CurveSet.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve,DrawTrSurf_Curve)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve, DrawTrSurf_Curve)
|
||||
|
||||
DrawTrSurf_BezierCurve::DrawTrSurf_BezierCurve (const Handle(Geom_BezierCurve)& C)
|
||||
: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1)
|
||||
{
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
DrawTrSurf_BezierCurve::DrawTrSurf_BezierCurve (
|
||||
const Handle(Geom_BezierCurve)& C)
|
||||
: DrawTrSurf_Curve (C, Draw_vert, 16, 0.05, 1) {
|
||||
const Handle(Geom_BezierCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret,const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode )
|
||||
: DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode)
|
||||
{
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DrawTrSurf_BezierCurve::DrawTrSurf_BezierCurve (
|
||||
const Handle(Geom_BezierCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret,const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode ) :
|
||||
DrawTrSurf_Curve (C, CurvColor, Discret, Deflection, DrawMode) {
|
||||
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve::DrawOn (Draw_Display& dis) const {
|
||||
|
||||
|
||||
Handle(Geom_BezierCurve) C = Handle(Geom_BezierCurve)::DownCast(curv);
|
||||
|
||||
if (drawPoles) {
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++) {
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
void DrawTrSurf_BezierCurve::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
Handle(Geom_BezierCurve) C = Handle(Geom_BezierCurve)::DownCast(curv);
|
||||
if (drawPoles)
|
||||
{
|
||||
Standard_Integer NbPoles = C->NbPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt CPoles (1, NbPoles);
|
||||
C->Poles (CPoles);
|
||||
dis.MoveTo(CPoles(1));
|
||||
for (Standard_Integer i = 2; i <= NbPoles; i++)
|
||||
{
|
||||
dis.DrawTo(CPoles(i));
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve::DrawOn(dis);
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve::DrawOn(dis);
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve::ShowPoles () { drawPoles = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve::ClearPoles () { drawPoles = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve::FindPole (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D,
|
||||
const Standard_Real XPrec, Standard_Integer& Index) const {
|
||||
|
||||
Handle(Geom_BezierCurve) bz = Handle(Geom_BezierCurve)::DownCast(curv);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
Index++;
|
||||
Standard_Integer NbPoles = bz->NbPoles();
|
||||
while (Index <= NbPoles) {
|
||||
if (D.Project(bz->Pole(Index)).Distance(p1) <= Prec)
|
||||
return;
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BezierCurve::FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D,
|
||||
const Standard_Real XPrec, Standard_Integer& Index) const
|
||||
{
|
||||
Handle(Geom_BezierCurve) bz = Handle(Geom_BezierCurve)::DownCast(curv);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
Index++;
|
||||
Standard_Integer NbPoles = bz->NbPoles();
|
||||
while (Index <= NbPoles)
|
||||
{
|
||||
if (D.Project(bz->Pole(Index)).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
Index = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierCurve::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierCurve::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_BezierCurve) DC = new DrawTrSurf_BezierCurve
|
||||
(Handle(Geom_BezierCurve)::DownCast(curv->Copy()),
|
||||
look,polesLook,
|
||||
Handle(DrawTrSurf_BezierCurve) DC = new DrawTrSurf_BezierCurve (Handle(Geom_BezierCurve)::DownCast(curv->Copy()),
|
||||
look, polesLook,
|
||||
drawPoles,
|
||||
GetDiscretisation(),GetDeflection(),GetDrawMode());
|
||||
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierCurve::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom_BezierCurve) aGeomCurve = Handle(Geom_BezierCurve)::DownCast (GeomTools_CurveSet::ReadCurve (theStream));
|
||||
Handle(DrawTrSurf_BezierCurve) aDrawCurve = new DrawTrSurf_BezierCurve (aGeomCurve,
|
||||
aParams.CurvColor, aParams.PolesColor, aParams.IsShowPoles,
|
||||
aParams.Discret, aParams.Deflection, aParams.DrawMode);
|
||||
return aDrawCurve;
|
||||
}
|
||||
|
@@ -17,43 +17,32 @@
|
||||
#ifndef _DrawTrSurf_BezierCurve_HeaderFile
|
||||
#define _DrawTrSurf_BezierCurve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <DrawTrSurf_Curve.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom_BezierCurve;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_BezierCurve;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierCurve, DrawTrSurf_Curve)
|
||||
|
||||
|
||||
class DrawTrSurf_BezierCurve : public DrawTrSurf_Curve
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve, DrawTrSurf_Curve)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve (const Handle(Geom_BezierCurve)& C);
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of
|
||||
//! package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve(const Handle(Geom_BezierCurve)& C);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve(const Handle(Geom_BezierCurve)& C, const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ShowPoles();
|
||||
|
||||
Standard_EXPORT void ClearPoles();
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve (const Handle(Geom_BezierCurve)& C,
|
||||
const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
void ShowPoles() { drawPoles = Standard_True; }
|
||||
|
||||
void ClearPoles() { drawPoles = Standard_False; }
|
||||
|
||||
//! Returns in <Index> the index of the first pole of the
|
||||
//! curve projected by the Display <D> at a distance lower
|
||||
@@ -61,38 +50,19 @@ public:
|
||||
//! set to 0, else index is always greater than the input
|
||||
//! value of index.
|
||||
Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
|
||||
|
||||
void SetPolesColor (const Draw_Color& aColor);
|
||||
|
||||
Draw_Color PolesColor() const;
|
||||
|
||||
|
||||
void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
|
||||
|
||||
Draw_Color PolesColor() const { return polesLook; }
|
||||
|
||||
//! For variable copy.
|
||||
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve,DrawTrSurf_Curve)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean drawPoles;
|
||||
Draw_Color polesLook;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_BezierCurve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_BezierCurve_HeaderFile
|
||||
|
@@ -1,32 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline void DrawTrSurf_BezierCurve::SetPolesColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
polesLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BezierCurve::PolesColor () const {
|
||||
|
||||
return polesLook;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -12,44 +12,41 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_BezierCurve2d.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_BezierCurve2d.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom2d_BezierCurve.hxx>
|
||||
#include <GeomTools_Curve2dSet.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d,DrawTrSurf_Curve2d)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
DrawTrSurf_BezierCurve2d::DrawTrSurf_BezierCurve2d (
|
||||
const Handle(Geom2d_BezierCurve)& C) :
|
||||
DrawTrSurf_Curve2d (C, Draw_vert, 50) {
|
||||
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
|
||||
DrawTrSurf_BezierCurve2d::DrawTrSurf_BezierCurve2d (
|
||||
const Handle(Geom2d_BezierCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret) : DrawTrSurf_Curve2d (C, CurvColor, Discret) {
|
||||
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve2d::DrawOn (Draw_Display& dis) const
|
||||
DrawTrSurf_BezierCurve2d::DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C)
|
||||
: DrawTrSurf_Curve2d (C, Draw_vert, 50)
|
||||
{
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
DrawTrSurf_BezierCurve2d::DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C, const Draw_Color& CurvColor,
|
||||
const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret)
|
||||
: DrawTrSurf_Curve2d (C, CurvColor, Discret)
|
||||
{
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BezierCurve2d::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
|
||||
Handle(Geom2d_BezierCurve) C = Handle(Geom2d_BezierCurve)::DownCast(curv);
|
||||
|
||||
if (drawPoles) {
|
||||
if (drawPoles)
|
||||
{
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array1OfPnt2d CPoles (1, C->NbPoles());
|
||||
C->Poles (CPoles);
|
||||
@@ -60,31 +57,13 @@ void DrawTrSurf_BezierCurve2d::DrawOn (Draw_Display& dis) const
|
||||
}
|
||||
|
||||
DrawTrSurf_Curve2d::DrawOn(dis);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve2d::ShowPoles ()
|
||||
void DrawTrSurf_BezierCurve2d::FindPole (const Standard_Real X, const Standard_Real Y,
|
||||
const Draw_Display& D,
|
||||
const Standard_Real XPrec,
|
||||
Standard_Integer& Index) const
|
||||
{
|
||||
drawPoles = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve2d::ClearPoles ()
|
||||
{
|
||||
drawPoles = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BezierCurve2d::FindPole (
|
||||
const Standard_Real X,
|
||||
const Standard_Real Y,
|
||||
const Draw_Display& D,
|
||||
const Standard_Real XPrec,
|
||||
Standard_Integer& Index) const
|
||||
{
|
||||
|
||||
Handle(Geom2d_BezierCurve) bz = Handle(Geom2d_BezierCurve)::DownCast(curv);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
@@ -104,16 +83,29 @@ void DrawTrSurf_BezierCurve2d::FindPole (
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierCurve2d::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierCurve2d::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_BezierCurve2d) DC = new DrawTrSurf_BezierCurve2d
|
||||
(Handle(Geom2d_BezierCurve)::DownCast(curv->Copy()),
|
||||
look,polesLook,
|
||||
drawPoles,
|
||||
GetDiscretisation());
|
||||
|
||||
|
||||
return DC;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierCurve2d::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom2d_BezierCurve) aGeomCurve = Handle(Geom2d_BezierCurve)::DownCast(GeomTools_Curve2dSet::ReadCurve2d (theStream));
|
||||
Handle(DrawTrSurf_BezierCurve2d) aDrawCurve = new DrawTrSurf_BezierCurve2d (aGeomCurve,
|
||||
aParams.CurvColor, aParams.PolesColor,
|
||||
aParams.IsShowPoles, aParams.Discret);
|
||||
return aDrawCurve;
|
||||
}
|
||||
|
@@ -17,43 +17,31 @@
|
||||
#ifndef _DrawTrSurf_BezierCurve2d_HeaderFile
|
||||
#define _DrawTrSurf_BezierCurve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <DrawTrSurf_Curve2d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom2d_BezierCurve;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_BezierCurve2d;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
|
||||
class DrawTrSurf_BezierCurve2d : public DrawTrSurf_Curve2d
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d, DrawTrSurf_Curve2d)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of package Geom2d.
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C);
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of
|
||||
//! package Geom2d.
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve2d(const Handle(Geom2d_BezierCurve)& C);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve2d(const Handle(Geom2d_BezierCurve)& C, const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ShowPoles();
|
||||
|
||||
Standard_EXPORT void ClearPoles();
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BezierCurve2d (const Handle(Geom2d_BezierCurve)& C,
|
||||
const Draw_Color& CurvColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
void ShowPoles() { drawPoles = Standard_True; }
|
||||
|
||||
void ClearPoles() { drawPoles = Standard_False; }
|
||||
|
||||
//! Returns in <Index> the index of the first pole of the
|
||||
//! curve projected by the Display <D> at a distance lower
|
||||
@@ -61,38 +49,19 @@ public:
|
||||
//! set to 0, else index is always greater than the input
|
||||
//! value of index.
|
||||
Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& Index) const;
|
||||
|
||||
void SetPolesColor (const Draw_Color& aColor);
|
||||
|
||||
Draw_Color PolesColor() const;
|
||||
|
||||
|
||||
void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
|
||||
|
||||
Draw_Color PolesColor() const { return polesLook; }
|
||||
|
||||
//! For variable copy.
|
||||
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierCurve2d,DrawTrSurf_Curve2d)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean drawPoles;
|
||||
Draw_Color polesLook;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_BezierCurve2d.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_BezierCurve2d_HeaderFile
|
||||
|
@@ -1,32 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline void DrawTrSurf_BezierCurve2d::SetPolesColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
polesLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_BezierCurve2d::PolesColor () const {
|
||||
|
||||
return polesLook;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -12,112 +12,103 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_BezierSurface.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_BezierCurve.hxx>
|
||||
#include <DrawTrSurf_BezierSurface.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <GeomTools_SurfaceSet.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierSurface,DrawTrSurf_Surface)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_BezierSurface, DrawTrSurf_Surface)
|
||||
|
||||
DrawTrSurf_BezierSurface::DrawTrSurf_BezierSurface (
|
||||
const Handle(Geom_BezierSurface)& S)
|
||||
: DrawTrSurf_Surface (S, 1, 1, Draw_jaune, Draw_bleu, 30, 0.05, 0) {
|
||||
DrawTrSurf_BezierSurface::DrawTrSurf_BezierSurface (const Handle(Geom_BezierSurface)& S)
|
||||
: DrawTrSurf_Surface (S, 1, 1, Draw_jaune, Draw_bleu, 30, 0.05, 0)
|
||||
{
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
|
||||
drawPoles = Standard_True;
|
||||
polesLook = Draw_rouge;
|
||||
}
|
||||
DrawTrSurf_BezierSurface::DrawTrSurf_BezierSurface (const Handle(Geom_BezierSurface)& S,
|
||||
const Standard_Integer NbUIsos, const Standard_Integer NbVIsos,
|
||||
const Draw_Color& BoundsColor, const Draw_Color& IsosColor,
|
||||
const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret,const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Surface (S, NbUIsos, NbVIsos, BoundsColor, IsosColor,
|
||||
Discret, Deflection, DrawMode)
|
||||
{
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DrawTrSurf_BezierSurface::DrawTrSurf_BezierSurface (
|
||||
const Handle(Geom_BezierSurface)& S,
|
||||
const Standard_Integer NbUIsos, const Standard_Integer NbVIsos,
|
||||
const Draw_Color& BoundsColor, const Draw_Color& IsosColor,
|
||||
const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret,const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode)
|
||||
: DrawTrSurf_Surface (S, NbUIsos, NbVIsos, BoundsColor, IsosColor,
|
||||
Discret, Deflection, DrawMode){
|
||||
|
||||
drawPoles = ShowPoles;
|
||||
polesLook = PolesColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawTrSurf_BezierSurface::DrawOn (Draw_Display& dis) const {
|
||||
|
||||
Standard_Integer i,j;
|
||||
Handle(Geom_BezierSurface) S = Handle(Geom_BezierSurface)::DownCast(surf);
|
||||
|
||||
if (drawPoles) {
|
||||
Standard_Integer NbUPoles = S->NbUPoles();
|
||||
Standard_Integer NbVPoles = S->NbVPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array2OfPnt SPoles (1, NbUPoles, 1, NbVPoles);
|
||||
S->Poles (SPoles);
|
||||
for (j = 1; j <= NbVPoles; j++) {
|
||||
dis.MoveTo(SPoles(1, j));
|
||||
for (i = 2; i <= NbUPoles; i++) {
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
}
|
||||
}
|
||||
for (i = 1; i <= NbUPoles; i++) {
|
||||
dis.MoveTo(SPoles(i, 1));
|
||||
for (j = 2; j <= NbVPoles; j++) {
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
}
|
||||
void DrawTrSurf_BezierSurface::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
Standard_Integer i,j;
|
||||
Handle(Geom_BezierSurface) S = Handle(Geom_BezierSurface)::DownCast(surf);
|
||||
if (drawPoles)
|
||||
{
|
||||
Standard_Integer NbUPoles = S->NbUPoles();
|
||||
Standard_Integer NbVPoles = S->NbVPoles();
|
||||
dis.SetColor(polesLook);
|
||||
TColgp_Array2OfPnt SPoles (1, NbUPoles, 1, NbVPoles);
|
||||
S->Poles (SPoles);
|
||||
for (j = 1; j <= NbVPoles; j++)
|
||||
{
|
||||
dis.MoveTo(SPoles(1, j));
|
||||
for (i = 2; i <= NbUPoles; i++)
|
||||
{
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
}
|
||||
}
|
||||
for (i = 1; i <= NbUPoles; i++)
|
||||
{
|
||||
dis.MoveTo(SPoles(i, 1));
|
||||
for (j = 2; j <= NbVPoles; j++)
|
||||
{
|
||||
dis.DrawTo(SPoles(i, j));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DrawTrSurf_Surface::DrawOn(dis);
|
||||
}
|
||||
DrawTrSurf_Surface::DrawOn (dis);
|
||||
}
|
||||
|
||||
|
||||
void DrawTrSurf_BezierSurface::ShowPoles () { drawPoles = Standard_True; }
|
||||
|
||||
|
||||
void DrawTrSurf_BezierSurface::ClearPoles () { drawPoles = Standard_False; }
|
||||
|
||||
|
||||
void DrawTrSurf_BezierSurface::FindPole (
|
||||
const Standard_Real X, const Standard_Real Y, const Draw_Display& D,
|
||||
const Standard_Real XPrec, Standard_Integer& UIndex, Standard_Integer& VIndex) const {
|
||||
|
||||
Handle(Geom_BezierSurface) bs = Handle(Geom_BezierSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
UIndex++;
|
||||
VIndex++;
|
||||
Standard_Integer NbUPoles = bs->NbUPoles();
|
||||
Standard_Integer NbVPoles = bs->NbVPoles();
|
||||
while (VIndex <= NbVPoles) {
|
||||
while (UIndex <= NbUPoles) {
|
||||
if (D.Project(bs->Pole(UIndex, VIndex)).Distance(p1) <= Prec)
|
||||
return;
|
||||
UIndex++;
|
||||
}
|
||||
UIndex = 1;
|
||||
VIndex++;
|
||||
}
|
||||
UIndex = VIndex = 0;
|
||||
}
|
||||
|
||||
void DrawTrSurf_BezierSurface::FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D,
|
||||
const Standard_Real XPrec, Standard_Integer& UIndex, Standard_Integer& VIndex) const
|
||||
{
|
||||
Handle(Geom_BezierSurface) bs = Handle(Geom_BezierSurface)::DownCast(surf);
|
||||
gp_Pnt2d p1(X/D.Zoom(),Y/D.Zoom());
|
||||
Standard_Real Prec = XPrec / D.Zoom();
|
||||
UIndex++;
|
||||
VIndex++;
|
||||
Standard_Integer NbUPoles = bs->NbUPoles();
|
||||
Standard_Integer NbVPoles = bs->NbVPoles();
|
||||
while (VIndex <= NbVPoles)
|
||||
{
|
||||
while (UIndex <= NbUPoles)
|
||||
{
|
||||
if (D.Project(bs->Pole(UIndex, VIndex)).Distance(p1) <= Prec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
UIndex++;
|
||||
}
|
||||
UIndex = 1;
|
||||
VIndex++;
|
||||
}
|
||||
UIndex = VIndex = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierSurface::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierSurface::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_BezierSurface) DS = new DrawTrSurf_BezierSurface
|
||||
(Handle(Geom_BezierSurface)::DownCast(surf->Copy()),
|
||||
@@ -128,9 +119,18 @@ Handle(Draw_Drawable3D) DrawTrSurf_BezierSurface::Copy()const
|
||||
return DS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_BezierSurface::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom_BezierSurface) aGeomSurface = Handle(Geom_BezierSurface)::DownCast (GeomTools_SurfaceSet::ReadSurface (theStream));
|
||||
Handle(DrawTrSurf_BezierSurface) aDrawSurface = new DrawTrSurf_BezierSurface (aGeomSurface,
|
||||
aParams.NbUIsos, aParams.NbVIsos,
|
||||
aParams.BoundsColor, aParams.IsosColor, aParams.PolesColor,
|
||||
aParams.IsShowPoles, aParams.Discret,
|
||||
aParams.Deflection, aParams.DrawMode);
|
||||
return aDrawSurface;
|
||||
}
|
||||
|
@@ -17,76 +17,48 @@
|
||||
#ifndef _DrawTrSurf_BezierSurface_HeaderFile
|
||||
#define _DrawTrSurf_BezierSurface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <DrawTrSurf_Surface.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom_BezierSurface;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_BezierSurface;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_BezierSurface, DrawTrSurf_Surface)
|
||||
|
||||
|
||||
class DrawTrSurf_BezierSurface : public DrawTrSurf_Surface
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierSurface, DrawTrSurf_Surface)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BezierSurface (const Handle(Geom_BezierSurface)& S);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BezierSurface (const Handle(Geom_BezierSurface)& S,
|
||||
const Standard_Integer NbUIsos, const Standard_Integer NbVIsos, const Draw_Color& BoundsColor,
|
||||
const Draw_Color& IsosColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
void ShowPoles() { drawPoles = Standard_True; }
|
||||
|
||||
void ClearPoles() { drawPoles = Standard_False; }
|
||||
|
||||
//! creates a drawable Bezier curve from a Bezier curve of
|
||||
//! package Geom.
|
||||
Standard_EXPORT DrawTrSurf_BezierSurface(const Handle(Geom_BezierSurface)& S);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_BezierSurface(const Handle(Geom_BezierSurface)& S, const Standard_Integer NbUIsos, const Standard_Integer NbVIsos, const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Draw_Color& PolesColor, const Standard_Boolean ShowPoles, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void ShowPoles();
|
||||
|
||||
Standard_EXPORT void ClearPoles();
|
||||
|
||||
Standard_EXPORT void FindPole (const Standard_Real X, const Standard_Real Y, const Draw_Display& D, const Standard_Real Prec, Standard_Integer& UIndex, Standard_Integer& VIndex) const;
|
||||
|
||||
void SetPolesColor (const Draw_Color& aColor);
|
||||
|
||||
Draw_Color PolesColor() const;
|
||||
|
||||
|
||||
void SetPolesColor (const Draw_Color& theColor) { polesLook = theColor; }
|
||||
|
||||
Draw_Color PolesColor() const { return polesLook; }
|
||||
|
||||
//! For variable copy.
|
||||
Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_BezierSurface,DrawTrSurf_Surface)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean drawPoles;
|
||||
Draw_Color polesLook;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_BezierSurface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_BezierSurface_HeaderFile
|
||||
|
@@ -1,25 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline Draw_Color DrawTrSurf_BezierSurface::PolesColor () const {
|
||||
|
||||
return polesLook;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_BezierSurface::SetPolesColor (
|
||||
const Draw_Color& aColor) {
|
||||
|
||||
polesLook = aColor;
|
||||
}
|
@@ -12,11 +12,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Curve.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomLProp_CLProps.hxx>
|
||||
@@ -26,65 +25,61 @@
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve,DrawTrSurf_Drawable)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve, DrawTrSurf_Drawable)
|
||||
|
||||
Standard_Real DrawTrSurf_CurveLimit = 400;
|
||||
extern Standard_Boolean Draw_Bounds;
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Curve
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Curve::DrawTrSurf_Curve (const Handle(Geom_Curve)& C,
|
||||
const Standard_Boolean DispOrigin) :
|
||||
DrawTrSurf_Drawable (16, 0.01, 1),
|
||||
curv(C),
|
||||
look(Draw_vert),
|
||||
disporigin(DispOrigin),
|
||||
dispcurvradius(Standard_False),
|
||||
radiusmax(1.0e3),
|
||||
radiusratio(0.1)
|
||||
const Standard_Boolean DispOrigin)
|
||||
: DrawTrSurf_Drawable (16, 0.01, 1),
|
||||
curv (C),
|
||||
look (Draw_vert),
|
||||
disporigin (DispOrigin),
|
||||
dispcurvradius (Standard_False),
|
||||
radiusmax (1.0e3),
|
||||
radiusratio (0.1)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Curve
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Curve::DrawTrSurf_Curve (const Handle(Geom_Curve)& C,
|
||||
const Draw_Color& aColor,
|
||||
const Standard_Integer Discret,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode,
|
||||
const Standard_Boolean DispOrigin,
|
||||
const Standard_Boolean DispCurvRadius,
|
||||
const Standard_Real RadiusMax,
|
||||
const Standard_Real RadiusRatio) :
|
||||
DrawTrSurf_Drawable (Discret,Deflection, DrawMode),
|
||||
curv(C),
|
||||
look(aColor),
|
||||
disporigin(DispOrigin),
|
||||
dispcurvradius(DispCurvRadius),
|
||||
radiusmax(RadiusMax),
|
||||
radiusratio(RadiusRatio)
|
||||
DrawTrSurf_Curve::DrawTrSurf_Curve (const Handle(Geom_Curve)& C,
|
||||
const Draw_Color& aColor,
|
||||
const Standard_Integer Discret,
|
||||
const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode,
|
||||
const Standard_Boolean DispOrigin,
|
||||
const Standard_Boolean DispCurvRadius,
|
||||
const Standard_Real RadiusMax,
|
||||
const Standard_Real RadiusRatio)
|
||||
: DrawTrSurf_Drawable (Discret,Deflection, DrawMode),
|
||||
curv(C),
|
||||
look(aColor),
|
||||
disporigin(DispOrigin),
|
||||
dispcurvradius(DispCurvRadius),
|
||||
radiusmax(RadiusMax),
|
||||
radiusratio(RadiusRatio)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Curve::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
Standard_Real First = curv->FirstParameter();
|
||||
@@ -184,13 +179,11 @@ void DrawTrSurf_Curve::DrawOn (Draw_Display& dis) const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Curve::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Curve::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_Curve) DC = new DrawTrSurf_Curve
|
||||
(Handle(Geom_Curve)::DownCast(curv->Copy()),
|
||||
@@ -200,24 +193,41 @@ Handle(Draw_Drawable3D) DrawTrSurf_Curve::Copy()const
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Curve::Dump(Standard_OStream& S)const
|
||||
void DrawTrSurf_Curve::Dump (Standard_OStream& S) const
|
||||
{
|
||||
GeomTools_CurveSet::PrintCurve(curv,S);
|
||||
GeomTools_CurveSet::PrintCurve (curv, S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Curve::Save (Standard_OStream& theOs) const
|
||||
{
|
||||
GeomTools_CurveSet::PrintCurve (GetCurve(), theOs, true);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Curve::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom_Curve) aGeomCurve = GeomTools_CurveSet::ReadCurve (theStream);
|
||||
Handle(DrawTrSurf_Curve) aDrawCurve = new DrawTrSurf_Curve (aGeomCurve, aParams.CurvColor, aParams.Discret, aParams.Deflection, aParams.DrawMode);
|
||||
return aDrawCurve;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Curve::Whatis(Draw_Interpretor& S)const
|
||||
void DrawTrSurf_Curve::Whatis (Draw_Interpretor& S) const
|
||||
{
|
||||
S << " a 3d curve";
|
||||
}
|
||||
|
@@ -17,81 +17,70 @@
|
||||
#ifndef _DrawTrSurf_Curve_HeaderFile
|
||||
#define _DrawTrSurf_Curve_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <DrawTrSurf_Drawable.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class Geom_Curve;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Curve;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Curve, DrawTrSurf_Drawable)
|
||||
|
||||
|
||||
//! This class defines a drawable curve in 3d space.
|
||||
class DrawTrSurf_Curve : public DrawTrSurf_Drawable
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve, DrawTrSurf_Drawable)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! creates a drawable curve from a curve of package Geom.
|
||||
Standard_EXPORT DrawTrSurf_Curve(const Handle(Geom_Curve)& C, const Standard_Boolean DispOrigin = Standard_True);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Curve(const Handle(Geom_Curve)& C, const Draw_Color& aColor, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode, const Standard_Boolean DispOrigin = Standard_True, const Standard_Boolean DispCurvRadius = Standard_False, const Standard_Real RadiusMax = 1.0e3, const Standard_Real RatioOfRadius = 0.1);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Handle(Geom_Curve) GetCurve() const;
|
||||
|
||||
void SetColor (const Draw_Color& aColor);
|
||||
|
||||
Standard_Boolean DisplayOrigin() const;
|
||||
|
||||
void DisplayOrigin (const Standard_Boolean V);
|
||||
|
||||
void ShowCurvature();
|
||||
|
||||
void ClearCurvature();
|
||||
|
||||
void SetRadiusMax (const Standard_Real Radius);
|
||||
|
||||
void SetRadiusRatio (const Standard_Real Ratio);
|
||||
|
||||
Draw_Color Color() const;
|
||||
|
||||
Standard_Real RadiusMax() const;
|
||||
|
||||
Standard_Real RadiusRatio() const;
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Curve (const Handle(Geom_Curve)& C, const Standard_Boolean DispOrigin = Standard_True);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Curve (const Handle(Geom_Curve)& C,
|
||||
const Draw_Color& aColor, const Standard_Integer Discret, const Standard_Real Deflection,
|
||||
const Standard_Integer DrawMode,
|
||||
const Standard_Boolean DispOrigin = Standard_True, const Standard_Boolean DispCurvRadius = Standard_False,
|
||||
const Standard_Real RadiusMax = 1.0e3, const Standard_Real RatioOfRadius = 0.1);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Handle(Geom_Curve) GetCurve() const { return curv; }
|
||||
|
||||
void SetColor (const Draw_Color& theColor) { look = theColor; }
|
||||
|
||||
Standard_Boolean DisplayOrigin() const { return disporigin; }
|
||||
|
||||
void DisplayOrigin (const Standard_Boolean V) { disporigin = V; }
|
||||
|
||||
void ShowCurvature() { dispcurvradius = Standard_True; }
|
||||
|
||||
void ClearCurvature() { dispcurvradius = Standard_False; }
|
||||
|
||||
void SetRadiusMax (const Standard_Real theRadius) { radiusmax = theRadius; }
|
||||
|
||||
void SetRadiusRatio (const Standard_Real theRatio) { radiusratio = theRatio; }
|
||||
|
||||
Draw_Color Color() const { return look; }
|
||||
|
||||
Standard_Real RadiusMax() const { return radiusmax; }
|
||||
|
||||
Standard_Real RadiusRatio() const { return radiusratio; }
|
||||
|
||||
//! 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;
|
||||
|
||||
//! For variable whatis command. Set as a result the
|
||||
//! type of the variable.
|
||||
|
||||
//! Save drawable into stream.
|
||||
Standard_EXPORT virtual void Save (Standard_OStream& theStream) const Standard_OVERRIDE;
|
||||
|
||||
//! For variable whatis command. Set as a result the type of the variable.
|
||||
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve,DrawTrSurf_Drawable)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Handle(Geom_Curve) curv;
|
||||
Draw_Color look;
|
||||
Standard_Boolean disporigin;
|
||||
@@ -99,19 +88,6 @@ protected:
|
||||
Standard_Real radiusmax;
|
||||
Standard_Real radiusratio;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_Curve.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Curve_HeaderFile
|
||||
|
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline Handle(Geom_Curve) DrawTrSurf_Curve::GetCurve () const
|
||||
{ return curv; }
|
||||
|
||||
inline Draw_Color DrawTrSurf_Curve::Color () const
|
||||
{ return look; }
|
||||
|
||||
inline Standard_Boolean DrawTrSurf_Curve::DisplayOrigin () const
|
||||
{ return disporigin; }
|
||||
|
||||
inline void DrawTrSurf_Curve::DisplayOrigin (const Standard_Boolean V)
|
||||
{ disporigin = V; }
|
||||
|
||||
inline void DrawTrSurf_Curve::SetColor (const Draw_Color& aColor)
|
||||
{ look = aColor; }
|
||||
|
||||
inline void DrawTrSurf_Curve::ShowCurvature()
|
||||
{ dispcurvradius = Standard_True;}
|
||||
|
||||
inline void DrawTrSurf_Curve::ClearCurvature()
|
||||
{ dispcurvradius = Standard_False;}
|
||||
|
||||
inline Standard_Real DrawTrSurf_Curve::RadiusMax () const
|
||||
{ return radiusmax; }
|
||||
|
||||
inline Standard_Real DrawTrSurf_Curve::RadiusRatio () const
|
||||
{ return radiusratio; }
|
||||
|
||||
inline void DrawTrSurf_Curve::SetRadiusMax (const Standard_Real Radius)
|
||||
{ radiusmax = Radius; }
|
||||
|
||||
inline void DrawTrSurf_Curve::SetRadiusRatio (const Standard_Real Ratio)
|
||||
{ radiusratio = Ratio; }
|
@@ -12,11 +12,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Curve2d.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_Curve2d.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
@@ -28,22 +30,20 @@
|
||||
#include <GeomTools_Curve2dSet.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve2d,DrawTrSurf_Drawable)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
|
||||
|
||||
static Standard_Real DrawTrSurf_CurveLimit = 400;
|
||||
extern Standard_Boolean Draw_Bounds;
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Curve2d
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Curve2d::DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C,
|
||||
const Standard_Boolean DispOrigin) :
|
||||
DrawTrSurf_Drawable (50)
|
||||
const Standard_Boolean DispOrigin)
|
||||
: DrawTrSurf_Drawable (50)
|
||||
{
|
||||
curv = C;
|
||||
look = Draw_vert;
|
||||
@@ -53,12 +53,10 @@ DrawTrSurf_Curve2d::DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C,
|
||||
radiusratio = 0.1;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Curve2d
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Curve2d::DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C,
|
||||
const Draw_Color& aColor,
|
||||
const Standard_Integer Discret,
|
||||
@@ -76,13 +74,11 @@ DrawTrSurf_Curve2d::DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C,
|
||||
radiusratio = RadiusRatio;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Curve2d::DrawOn (Draw_Display& dis) const
|
||||
void DrawTrSurf_Curve2d::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
|
||||
Standard_Real First = curv->FirstParameter();
|
||||
@@ -179,13 +175,11 @@ void DrawTrSurf_Curve2d::DrawOn (Draw_Display& dis) const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Curve2d::Copy()const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Curve2d::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_Curve2d) DC = new DrawTrSurf_Curve2d
|
||||
(Handle(Geom2d_Curve)::DownCast(curv->Copy()),
|
||||
@@ -195,34 +189,49 @@ Handle(Draw_Drawable3D) DrawTrSurf_Curve2d::Copy()const
|
||||
return DC;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Curve2d::Dump(Standard_OStream& S) const
|
||||
void DrawTrSurf_Curve2d::Dump (Standard_OStream& S) const
|
||||
{
|
||||
GeomTools_Curve2dSet::PrintCurve2d(curv,S);
|
||||
GeomTools_Curve2dSet::PrintCurve2d (curv, S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Curve2d::Save (Standard_OStream& theStream) const
|
||||
{
|
||||
GeomTools_Curve2dSet::PrintCurve2d (GetCurve(), theStream, true);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Curve2d::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom2d_Curve) aGeomCurve = GeomTools_Curve2dSet::ReadCurve2d (theStream);
|
||||
Handle(DrawTrSurf_Curve2d) aDrawCurve = new DrawTrSurf_Curve2d (aGeomCurve, aParams.CurvColor, aParams.Discret);
|
||||
return aDrawCurve;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Curve2d::Whatis(Draw_Interpretor& S)const
|
||||
void DrawTrSurf_Curve2d::Whatis (Draw_Interpretor& S) const
|
||||
{
|
||||
S << "2d curve";
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Is3D
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean DrawTrSurf_Curve2d::Is3D() const
|
||||
{
|
||||
return Standard_False;
|
||||
|
@@ -17,80 +17,68 @@
|
||||
#ifndef _DrawTrSurf_Curve2d_HeaderFile
|
||||
#define _DrawTrSurf_Curve2d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <DrawTrSurf_Drawable.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class Geom2d_Curve;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Curve2d;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
|
||||
|
||||
//! This class defines a drawable curve in 2d space.
|
||||
//! The curve is drawned in the plane XOY.
|
||||
//! The curve is drawn in the plane XOY.
|
||||
class DrawTrSurf_Curve2d : public DrawTrSurf_Drawable
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! creates a drawable curve from a curve of package Geom2d.
|
||||
Standard_EXPORT DrawTrSurf_Curve2d(const Handle(Geom2d_Curve)& C, const Standard_Boolean DispOrigin = Standard_True);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Curve2d(const Handle(Geom2d_Curve)& C, const Draw_Color& aColor, const Standard_Integer Discret, const Standard_Boolean DispOrigin = Standard_True, const Standard_Boolean DispCurvRadius = Standard_False, const Standard_Real RadiusMax = 1.0e3, const Standard_Real RatioOfRadius = 0.1);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Handle(Geom2d_Curve) GetCurve() const;
|
||||
|
||||
void SetColor (const Draw_Color& aColor);
|
||||
|
||||
void ShowCurvature();
|
||||
|
||||
void ClearCurvature();
|
||||
|
||||
void SetRadiusMax (const Standard_Real Radius);
|
||||
|
||||
void SetRadiusRatio (const Standard_Real Ratio);
|
||||
|
||||
Draw_Color Color() const;
|
||||
|
||||
Standard_Real RadiusMax() const;
|
||||
|
||||
Standard_Real RadiusRatio() const;
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C, const Standard_Boolean DispOrigin = Standard_True);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Curve2d (const Handle(Geom2d_Curve)& C,
|
||||
const Draw_Color& aColor, const Standard_Integer Discret,
|
||||
const Standard_Boolean DispOrigin = Standard_True, const Standard_Boolean DispCurvRadius = Standard_False,
|
||||
const Standard_Real RadiusMax = 1.0e3, const Standard_Real RatioOfRadius = 0.1);
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Handle(Geom2d_Curve) GetCurve() const { return curv; }
|
||||
|
||||
void SetColor (const Draw_Color& theColor) { look = theColor; }
|
||||
|
||||
void ShowCurvature() { dispcurvradius = Standard_True; }
|
||||
|
||||
void ClearCurvature() { dispcurvradius = Standard_False; }
|
||||
|
||||
void SetRadiusMax (const Standard_Real theRadius) { radiusmax = theRadius; }
|
||||
|
||||
void SetRadiusRatio (const Standard_Real theRatio) { radiusratio = theRatio; }
|
||||
|
||||
Draw_Color Color() const { return look; }
|
||||
|
||||
Standard_Real RadiusMax() const { return radiusmax; }
|
||||
|
||||
Standard_Real RadiusRatio() const { return radiusratio; }
|
||||
|
||||
//! 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;
|
||||
|
||||
//! Returns False.
|
||||
Standard_EXPORT virtual Standard_Boolean Is3D() const Standard_OVERRIDE;
|
||||
|
||||
//! For variable whatis command. Set as a result the
|
||||
//! type of the variable.
|
||||
|
||||
//! For variable whatis command. Set as a result the type of the variable.
|
||||
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Curve2d,DrawTrSurf_Drawable)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Handle(Geom2d_Curve) curv;
|
||||
Draw_Color look;
|
||||
Standard_Boolean disporigin;
|
||||
@@ -98,19 +86,6 @@ protected:
|
||||
Standard_Real radiusmax;
|
||||
Standard_Real radiusratio;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_Curve2d.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Curve2d_HeaderFile
|
||||
|
@@ -1,41 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline Handle(Geom2d_Curve) DrawTrSurf_Curve2d::GetCurve () const {
|
||||
return curv;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_Curve2d::Color () const { return look; }
|
||||
|
||||
inline void DrawTrSurf_Curve2d::ShowCurvature()
|
||||
{ dispcurvradius = Standard_True;}
|
||||
|
||||
inline void DrawTrSurf_Curve2d::ClearCurvature()
|
||||
{ dispcurvradius = Standard_False;}
|
||||
|
||||
inline Standard_Real DrawTrSurf_Curve2d::RadiusMax () const { return radiusmax; }
|
||||
|
||||
inline Standard_Real DrawTrSurf_Curve2d::RadiusRatio () const { return radiusratio; }
|
||||
|
||||
inline void DrawTrSurf_Curve2d::SetColor (const Draw_Color& aColor)
|
||||
{ look = aColor; }
|
||||
|
||||
inline void DrawTrSurf_Curve2d::SetRadiusMax (const Standard_Real Radius)
|
||||
{ radiusmax = Radius; }
|
||||
|
||||
inline void DrawTrSurf_Curve2d::SetRadiusRatio (const Standard_Real Ratio)
|
||||
{ radiusratio = Ratio; }
|
||||
|
||||
|
@@ -17,20 +17,13 @@
|
||||
#ifndef _DrawTrSurf_Drawable_HeaderFile
|
||||
#define _DrawTrSurf_Drawable_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <GeomAbs_IsoType.hxx>
|
||||
|
||||
class Adaptor2d_Curve2d;
|
||||
class Draw_Display;
|
||||
class Adaptor3d_Curve;
|
||||
class Adaptor3d_IsoCurve;
|
||||
|
||||
|
||||
class DrawTrSurf_Drawable;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Drawable, Draw_Drawable3D)
|
||||
|
||||
//! this class adds to the Drawable3D methods to
|
||||
@@ -40,10 +33,9 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Drawable, Draw_Drawable3D)
|
||||
//! is stored in this class.
|
||||
class DrawTrSurf_Drawable : public Draw_Drawable3D
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Drawable, Draw_Drawable3D)
|
||||
public:
|
||||
|
||||
|
||||
//! Draw a polygon of the curve on the Display
|
||||
Standard_EXPORT void DrawCurve2dOn (Adaptor2d_Curve2d& C, Draw_Display& D) const;
|
||||
|
||||
@@ -57,47 +49,30 @@ public:
|
||||
//! this is defined only to tell C++ not to complain
|
||||
//! about inheriting a pure virtual method.
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE = 0;
|
||||
|
||||
void SetDiscretisation (const Standard_Integer Discret);
|
||||
|
||||
Standard_Integer GetDiscretisation() const;
|
||||
|
||||
void SetDeflection (const Standard_Real Deflection);
|
||||
|
||||
Standard_Real GetDeflection() const;
|
||||
|
||||
void SetDrawMode (const Standard_Integer DrawMode);
|
||||
|
||||
Standard_Integer GetDrawMode() const;
|
||||
|
||||
void SetDiscretisation (const Standard_Integer theDiscret) { myDiscret = theDiscret; }
|
||||
|
||||
Standard_Integer GetDiscretisation() const { return myDiscret; }
|
||||
|
||||
void SetDeflection (const Standard_Real theDeflection) { myDeflection = theDeflection; }
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Drawable,Draw_Drawable3D)
|
||||
Standard_Real GetDeflection() const { return myDeflection; }
|
||||
|
||||
void SetDrawMode (const Standard_Integer theDrawMode) { myDrawMode = theDrawMode; }
|
||||
|
||||
Standard_Integer GetDrawMode() const { return myDrawMode; }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! set the number of points on a curve at creation.
|
||||
Standard_EXPORT DrawTrSurf_Drawable(const Standard_Integer discret, const Standard_Real deflection = 0.01, const Standard_Integer DrawMode = 0);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Integer myDrawMode;
|
||||
Standard_Integer myDiscret;
|
||||
Standard_Real myDeflection;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_Drawable.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Drawable_HeaderFile
|
||||
|
@@ -1,58 +0,0 @@
|
||||
// Created on: 1991-07-16
|
||||
// Created by: Christophe MARION
|
||||
// Copyright (c) 1991-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.
|
||||
|
||||
inline void DrawTrSurf_Drawable::SetDrawMode (
|
||||
const Standard_Integer DrawMode) {
|
||||
|
||||
myDrawMode = DrawMode;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_Drawable::SetDiscretisation (
|
||||
const Standard_Integer Discret) {
|
||||
|
||||
myDiscret = Discret;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_Drawable::SetDeflection (
|
||||
const Standard_Real Deflection) {
|
||||
|
||||
myDeflection = Deflection;
|
||||
}
|
||||
|
||||
|
||||
inline Standard_Integer DrawTrSurf_Drawable::GetDiscretisation () const {
|
||||
|
||||
return myDiscret;
|
||||
}
|
||||
|
||||
inline Standard_Integer DrawTrSurf_Drawable::GetDrawMode () const {
|
||||
|
||||
return myDrawMode;
|
||||
}
|
||||
|
||||
inline Standard_Real DrawTrSurf_Drawable::GetDeflection () const {
|
||||
|
||||
return myDeflection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
65
src/DrawTrSurf/DrawTrSurf_Params.hxx
Normal file
65
src/DrawTrSurf/DrawTrSurf_Params.hxx
Normal file
@@ -0,0 +1,65 @@
|
||||
// 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 DrawTrSurf_Params_HeaderFile
|
||||
#define DrawTrSurf_Params_HeaderFile
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
|
||||
//! DrawTrSurf parameters.
|
||||
struct DrawTrSurf_Params
|
||||
{
|
||||
public:
|
||||
Draw_Color PntColor;
|
||||
Draw_Color CurvColor;
|
||||
Draw_Color BoundsColor;
|
||||
Draw_Color IsosColor;
|
||||
Draw_Color PolesColor;
|
||||
Draw_Color KnotsColor;
|
||||
|
||||
Draw_MarkerShape PntMarker;
|
||||
Draw_MarkerShape KnotsMarker;
|
||||
Standard_Boolean IsShowPoles;
|
||||
Standard_Boolean IsShowKnots;
|
||||
Standard_Boolean NeedKnotsIsos;
|
||||
Standard_Real Deflection;
|
||||
Standard_Integer KnotsSize;
|
||||
Standard_Integer Discret;
|
||||
Standard_Integer DrawMode;
|
||||
Standard_Integer NbUIsos;
|
||||
Standard_Integer NbVIsos;
|
||||
|
||||
DrawTrSurf_Params()
|
||||
: PntColor (Draw_rouge),
|
||||
CurvColor (Draw_jaune),
|
||||
BoundsColor(Draw_vert),
|
||||
IsosColor (Draw_bleu),
|
||||
PolesColor (Draw_rouge),
|
||||
KnotsColor (Draw_violet),
|
||||
PntMarker (Draw_Plus),
|
||||
KnotsMarker(Draw_Losange),
|
||||
IsShowPoles (true),
|
||||
IsShowKnots (true),
|
||||
NeedKnotsIsos (true),
|
||||
Deflection (0.01),
|
||||
KnotsSize (5),
|
||||
Discret (30),
|
||||
DrawMode(0),
|
||||
NbUIsos (10),
|
||||
NbVIsos (10)
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -14,52 +14,51 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Point.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_Point.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Stream.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Point,Draw_Drawable3D)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Point, Draw_Drawable3D)
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Point
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
DrawTrSurf_Point::DrawTrSurf_Point(const gp_Pnt& P,
|
||||
const Draw_MarkerShape Shape,
|
||||
const Draw_Color& Col) :
|
||||
myPoint(P),
|
||||
is3D(Standard_True),
|
||||
myShape(Shape),
|
||||
myColor(Col)
|
||||
DrawTrSurf_Point::DrawTrSurf_Point (const gp_Pnt& P,
|
||||
const Draw_MarkerShape Shape,
|
||||
const Draw_Color& Col)
|
||||
: myPoint(P),
|
||||
is3D(Standard_True),
|
||||
myShape(Shape),
|
||||
myColor(Col)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Point
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Point::DrawTrSurf_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)
|
||||
DrawTrSurf_Point::DrawTrSurf_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 :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean DrawTrSurf_Point::Is3D() const
|
||||
{
|
||||
return is3D;
|
||||
@@ -67,10 +66,9 @@ Standard_Boolean DrawTrSurf_Point::Is3D() const
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::DrawOn(Draw_Display& dis) const
|
||||
void DrawTrSurf_Point::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
dis.SetColor(myColor);
|
||||
if (is3D)
|
||||
@@ -81,20 +79,9 @@ void DrawTrSurf_Point::DrawOn(Draw_Display& dis) const
|
||||
|
||||
//=======================================================================
|
||||
//function : Point
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt DrawTrSurf_Point::Point() const
|
||||
{
|
||||
return myPoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Point
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::Point(const gp_Pnt& P)
|
||||
void DrawTrSurf_Point::Point (const gp_Pnt& P)
|
||||
{
|
||||
myPoint = P;
|
||||
is3D = Standard_True;
|
||||
@@ -102,70 +89,18 @@ void DrawTrSurf_Point::Point(const gp_Pnt& P)
|
||||
|
||||
//=======================================================================
|
||||
//function : Point2d
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt2d DrawTrSurf_Point::Point2d() const
|
||||
{
|
||||
return gp_Pnt2d(myPoint.X(),myPoint.Y());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Point2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::Point2d(const gp_Pnt2d& P)
|
||||
{
|
||||
myPoint.SetCoord(P.X(),P.Y(),0);
|
||||
is3D = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Color
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::Color(const Draw_Color& aColor)
|
||||
{
|
||||
myColor = aColor;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Color
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Draw_Color DrawTrSurf_Point::Color() const
|
||||
{
|
||||
return myColor;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::Shape(const Draw_MarkerShape S)
|
||||
{
|
||||
myShape = S;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Draw_MarkerShape DrawTrSurf_Point::Shape() const
|
||||
{
|
||||
return myShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Point::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_Point) P;
|
||||
@@ -179,10 +114,9 @@ Handle(Draw_Drawable3D) DrawTrSurf_Point::Copy() const
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::Dump(Standard_OStream& S) const
|
||||
void DrawTrSurf_Point::Dump (Standard_OStream& S) const
|
||||
{
|
||||
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
|
||||
std::ios::fmtflags F = S.flags();
|
||||
@@ -205,11 +139,70 @@ void DrawTrSurf_Point::Dump(Standard_OStream& S) const
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Point::Whatis(Draw_Interpretor& S) const
|
||||
void DrawTrSurf_Point::Save (Standard_OStream& theStream) const
|
||||
{
|
||||
S << "point";
|
||||
#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) DrawTrSurf_Point::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Standard_Integer is3d = 0;
|
||||
theStream >> is3d;
|
||||
Standard_Real x,y,z = 0.0;
|
||||
if (is3d)
|
||||
{
|
||||
theStream >> x >> y >> z;
|
||||
}
|
||||
else
|
||||
{
|
||||
theStream >> x >> y;
|
||||
}
|
||||
Handle(DrawTrSurf_Point) aDrawPoint;
|
||||
if (is3d)
|
||||
{
|
||||
aDrawPoint = new DrawTrSurf_Point (gp_Pnt (x, y, z), aParams.PntMarker, aParams.PntColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
aDrawPoint = new DrawTrSurf_Point (gp_Pnt2d (x, y), aParams.PntMarker, aParams.PntColor);
|
||||
}
|
||||
return aDrawPoint;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Point::Whatis (Draw_Interpretor& S) const
|
||||
{
|
||||
S << "point";
|
||||
}
|
||||
|
@@ -17,92 +17,68 @@
|
||||
#ifndef _DrawTrSurf_Point_HeaderFile
|
||||
#define _DrawTrSurf_Point_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
class gp_Pnt;
|
||||
|
||||
class Draw_Color;
|
||||
class gp_Pnt2d;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Point;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Point, Draw_Drawable3D)
|
||||
|
||||
//! A drawable point.
|
||||
class DrawTrSurf_Point : public Draw_Drawable3D
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Point, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Point(const gp_Pnt& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Point(const gp_Pnt2d& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Point (const gp_Pnt& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_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;
|
||||
|
||||
Standard_EXPORT gp_Pnt Point() const;
|
||||
|
||||
|
||||
gp_Pnt Point() const { return myPoint; }
|
||||
|
||||
Standard_EXPORT void Point (const gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT gp_Pnt2d Point2d() const;
|
||||
|
||||
|
||||
gp_Pnt2d Point2d() const { return gp_Pnt2d(myPoint.X(), myPoint.Y()); }
|
||||
|
||||
Standard_EXPORT void Point2d (const gp_Pnt2d& P);
|
||||
|
||||
Standard_EXPORT void Color (const Draw_Color& aColor);
|
||||
|
||||
Standard_EXPORT Draw_Color Color() const;
|
||||
|
||||
Standard_EXPORT void Shape (const Draw_MarkerShape S);
|
||||
|
||||
Standard_EXPORT Draw_MarkerShape Shape() const;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Point,Draw_Drawable3D)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
gp_Pnt myPoint;
|
||||
Standard_Boolean is3D;
|
||||
Draw_MarkerShape myShape;
|
||||
Draw_Color myColor;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Point_HeaderFile
|
||||
|
@@ -14,110 +14,104 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Polygon2D.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <DrawTrSurf_Polygon2D.hxx>
|
||||
#include <Poly.hxx>
|
||||
#include <Poly_Polygon2D.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Polygon2D,Draw_Drawable2D)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Polygon2D, Draw_Drawable2D)
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Polygon2D
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
DrawTrSurf_Polygon2D::DrawTrSurf_Polygon2D(const Handle(Poly_Polygon2D)& P):
|
||||
myPolygon2D(P),
|
||||
myNodes(Standard_False)
|
||||
DrawTrSurf_Polygon2D::DrawTrSurf_Polygon2D(const Handle(Poly_Polygon2D)& P)
|
||||
: myPolygon2D(P),
|
||||
myNodes(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Polygon2D
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_Polygon2D) DrawTrSurf_Polygon2D::Polygon2D() const
|
||||
{
|
||||
return myPolygon2D;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Polygon2D::ShowNodes(const Standard_Boolean B)
|
||||
{
|
||||
myNodes = B;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean DrawTrSurf_Polygon2D::ShowNodes() const
|
||||
{
|
||||
return myNodes;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Polygon2D::DrawOn(Draw_Display& dis) const
|
||||
{
|
||||
dis.SetColor(Draw_jaune);
|
||||
|
||||
|
||||
const TColgp_Array1OfPnt2d& Points = myPolygon2D->Nodes();
|
||||
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper()-1; i++) {
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper()-1; i++)
|
||||
{
|
||||
dis.Draw(Points(i), Points(i+1));
|
||||
}
|
||||
|
||||
|
||||
if (myNodes) {
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper(); i++) {
|
||||
if (myNodes)
|
||||
{
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper(); i++)
|
||||
{
|
||||
dis.DrawMarker(Points(i), Draw_X);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Polygon2D::Copy() const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Polygon2D::Copy() const
|
||||
{
|
||||
return new DrawTrSurf_Polygon2D(myPolygon2D);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Polygon2D::Dump(Standard_OStream& S) const
|
||||
void DrawTrSurf_Polygon2D::Dump (Standard_OStream& S) const
|
||||
{
|
||||
Poly::Dump(myPolygon2D, S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Polygon2D::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
|
||||
Poly::Write (myPolygon2D, theStream);
|
||||
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
|
||||
theStream.setf (aFlags);
|
||||
#else
|
||||
theStream.setf (aForm);
|
||||
theStream.precision (aPrec);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DrawTrSurf_Polygon2D::Whatis(Draw_Interpretor& I) const
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Polygon2D::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
return new DrawTrSurf_Polygon2D (Poly::ReadPolygon2D (theStream));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Polygon2D::Whatis (Draw_Interpretor& I) const
|
||||
{
|
||||
I << "polygon2D";
|
||||
}
|
||||
|
||||
|
@@ -17,73 +17,48 @@
|
||||
#ifndef _DrawTrSurf_Polygon2D_HeaderFile
|
||||
#define _DrawTrSurf_Polygon2D_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_Drawable2D.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class Poly_Polygon2D;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Polygon2D;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Polygon2D, Draw_Drawable2D)
|
||||
|
||||
//! Used to display a 2d polygon.
|
||||
//!
|
||||
//! Optional display of nodes.
|
||||
class DrawTrSurf_Polygon2D : public Draw_Drawable2D
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Polygon2D, Draw_Drawable2D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Polygon2D(const Handle(Poly_Polygon2D)& P);
|
||||
|
||||
Standard_EXPORT Handle(Poly_Polygon2D) Polygon2D() const;
|
||||
|
||||
Standard_EXPORT void ShowNodes (const Standard_Boolean B);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ShowNodes() const;
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Polygon2D (const Handle(Poly_Polygon2D)& P);
|
||||
|
||||
Handle(Poly_Polygon2D) Polygon2D() const { return myPolygon2D; }
|
||||
|
||||
void ShowNodes (const Standard_Boolean theB) { myNodes = theB; }
|
||||
|
||||
Standard_Boolean ShowNodes() const { return myNodes; }
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
//! 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;
|
||||
|
||||
//! For variable whatis command. Set as a result the
|
||||
//! type of the variable.
|
||||
|
||||
//! Save drawable into stream.
|
||||
Standard_EXPORT virtual void Save (Standard_OStream& theStream) const Standard_OVERRIDE;
|
||||
|
||||
//! For variable whatis command. Set as a result the type of the variable.
|
||||
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Polygon2D,Draw_Drawable2D)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Poly_Polygon2D) myPolygon2D;
|
||||
Standard_Boolean myNodes;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Polygon2D_HeaderFile
|
||||
|
@@ -14,110 +14,105 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Polygon3D.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Draw_MarkerShape.hxx>
|
||||
#include <DrawTrSurf_Polygon3D.hxx>
|
||||
#include <Poly.hxx>
|
||||
#include <Poly_Polygon3D.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Polygon3D,Draw_Drawable3D)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Polygon3D, Draw_Drawable3D)
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Polygon3D
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
DrawTrSurf_Polygon3D::DrawTrSurf_Polygon3D(const Handle(Poly_Polygon3D)& P):
|
||||
myPolygon3D(P),
|
||||
myNodes(Standard_False)
|
||||
DrawTrSurf_Polygon3D::DrawTrSurf_Polygon3D (const Handle(Poly_Polygon3D)& P)
|
||||
: myPolygon3D(P),
|
||||
myNodes(Standard_False)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Polygon3D
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_Polygon3D) DrawTrSurf_Polygon3D::Polygon3D() const
|
||||
{
|
||||
return myPolygon3D;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Polygon3D::ShowNodes(const Standard_Boolean B)
|
||||
{
|
||||
myNodes = B;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean DrawTrSurf_Polygon3D::ShowNodes() const
|
||||
{
|
||||
return myNodes;
|
||||
//
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Polygon3D::DrawOn(Draw_Display& dis) const
|
||||
{
|
||||
dis.SetColor(Draw_jaune);
|
||||
|
||||
const TColgp_Array1OfPnt& Points = myPolygon3D->Nodes();
|
||||
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper()-1; i++) {
|
||||
const TColgp_Array1OfPnt& Points = myPolygon3D->Nodes();
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper()-1; i++)
|
||||
{
|
||||
dis.Draw(Points(i), Points(i+1));
|
||||
}
|
||||
|
||||
|
||||
if (myNodes) {
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper(); i++) {
|
||||
if (myNodes)
|
||||
{
|
||||
for (Standard_Integer i = Points.Lower(); i <= Points.Upper(); i++)
|
||||
{
|
||||
dis.DrawMarker(Points(i), Draw_X);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Polygon3D::Copy() const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Polygon3D::Copy() const
|
||||
{
|
||||
return new DrawTrSurf_Polygon3D(myPolygon3D);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Polygon3D::Dump(Standard_OStream& S) const
|
||||
void DrawTrSurf_Polygon3D::Dump (Standard_OStream& S) const
|
||||
{
|
||||
Poly::Dump(myPolygon3D, S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Polygon3D::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
|
||||
Poly::Write (myPolygon3D, theStream);
|
||||
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
|
||||
theStream.setf (aFlags);
|
||||
#else
|
||||
theStream.setf (aForm);
|
||||
theStream.precision (aPrec);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DrawTrSurf_Polygon3D::Whatis(Draw_Interpretor& I) const
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Polygon3D::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
return new DrawTrSurf_Polygon3D (Poly::ReadPolygon3D (theStream));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Polygon3D::Whatis (Draw_Interpretor& I) const
|
||||
{
|
||||
I << "polygon3D";
|
||||
}
|
||||
|
||||
|
@@ -17,38 +17,29 @@
|
||||
#ifndef _DrawTrSurf_Polygon3D_HeaderFile
|
||||
#define _DrawTrSurf_Polygon3D_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class Poly_Polygon3D;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Polygon3D;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Polygon3D, Draw_Drawable3D)
|
||||
|
||||
//! Used to display a 3d polygon.
|
||||
//!
|
||||
//! Optional display of nodes.
|
||||
class DrawTrSurf_Polygon3D : public Draw_Drawable3D
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Polygon3D, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Polygon3D(const Handle(Poly_Polygon3D)& P);
|
||||
|
||||
Standard_EXPORT Handle(Poly_Polygon3D) Polygon3D() const;
|
||||
|
||||
Standard_EXPORT void ShowNodes (const Standard_Boolean B);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ShowNodes() const;
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Polygon3D (const Handle(Poly_Polygon3D)& P);
|
||||
|
||||
Handle(Poly_Polygon3D) Polygon3D() const { return myPolygon3D; }
|
||||
|
||||
void ShowNodes (const Standard_Boolean theB) { myNodes = theB; }
|
||||
|
||||
Standard_Boolean ShowNodes() const { return myNodes; }
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
//! For variable copy.
|
||||
@@ -56,34 +47,19 @@ public:
|
||||
|
||||
//! 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. Set as a result the
|
||||
//! type of the variable.
|
||||
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Polygon3D,Draw_Drawable3D)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Poly_Polygon3D) myPolygon3D;
|
||||
Standard_Boolean myNodes;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Polygon3D_HeaderFile
|
||||
|
@@ -12,28 +12,26 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Surface.hxx>
|
||||
|
||||
#include <Adaptor3d_IsoCurve.hxx>
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_Surface.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <DrawTrSurf_Params.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomTools_SurfaceSet.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Surface,DrawTrSurf_Drawable)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Surface, DrawTrSurf_Drawable)
|
||||
|
||||
Standard_Real DrawTrSurf_SurfaceLimit = 400;
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Surface
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Surface::DrawTrSurf_Surface (const Handle(Geom_Surface)& S)
|
||||
: DrawTrSurf_Drawable (16, 0.01, 1)
|
||||
{
|
||||
@@ -44,14 +42,10 @@ DrawTrSurf_Surface::DrawTrSurf_Surface (const Handle(Geom_Surface)& S)
|
||||
nbVIsos = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Surface
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
DrawTrSurf_Surface::DrawTrSurf_Surface
|
||||
(const Handle(Geom_Surface)& S, const Standard_Integer Nu,
|
||||
const Standard_Integer Nv,
|
||||
@@ -67,13 +61,10 @@ DrawTrSurf_Surface::DrawTrSurf_Surface
|
||||
nbVIsos = Abs(Nv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Surface::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
DrawOn(dis,Standard_True);
|
||||
@@ -81,11 +72,9 @@ void DrawTrSurf_Surface::DrawOn (Draw_Display& dis) const
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Surface::DrawOn (Draw_Display& dis,
|
||||
const Standard_Boolean Iso) const
|
||||
void DrawTrSurf_Surface::DrawOn (Draw_Display& dis, const Standard_Boolean Iso) const
|
||||
{
|
||||
Standard_Real UFirst, ULast, VFirst, VLast;
|
||||
surf->Bounds (UFirst, ULast, VFirst, VLast);
|
||||
@@ -208,39 +197,21 @@ void DrawTrSurf_Surface::DrawOn (Draw_Display& dis,
|
||||
dis);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowIsos
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Surface::ShowIsos ( const Standard_Integer Nu,
|
||||
const Standard_Integer Nv)
|
||||
{
|
||||
nbUIsos = Abs(Nu);
|
||||
nbVIsos = Abs(Nv);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearIsos
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Surface::ClearIsos ()
|
||||
{
|
||||
nbUIsos = 0;
|
||||
nbVIsos = 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Surface::Copy() const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Surface::Copy() const
|
||||
{
|
||||
Handle(DrawTrSurf_Surface) DS = new DrawTrSurf_Surface
|
||||
(Handle(Geom_Surface)::DownCast(surf->Copy()),
|
||||
@@ -250,24 +221,44 @@ Handle(Draw_Drawable3D) DrawTrSurf_Surface::Copy() const
|
||||
return DS;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Surface::Dump(Standard_OStream& S)const
|
||||
void DrawTrSurf_Surface::Dump (Standard_OStream& S) const
|
||||
{
|
||||
GeomTools_SurfaceSet::PrintSurface(surf,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Surface::Save (Standard_OStream& theStream) const
|
||||
{
|
||||
GeomTools_SurfaceSet::PrintSurface (surf, theStream, true);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Surface::Restore (std::istream& theStream)
|
||||
{
|
||||
const DrawTrSurf_Params& aParams = DrawTrSurf::Parameters();
|
||||
Handle(Geom_Surface) aGeomSurface = GeomTools_SurfaceSet::ReadSurface (theStream);
|
||||
Handle(DrawTrSurf_Surface) aDrawSurface = new DrawTrSurf_Surface (aGeomSurface,
|
||||
aParams.NbUIsos, aParams.NbVIsos,
|
||||
aParams.BoundsColor, aParams.IsosColor,
|
||||
aParams.Discret, aParams.Deflection, aParams.DrawMode);
|
||||
return aDrawSurface;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Surface::Whatis(Draw_Interpretor& S)const
|
||||
void DrawTrSurf_Surface::Whatis (Draw_Interpretor& S) const
|
||||
{
|
||||
S << "a surface";
|
||||
}
|
||||
|
@@ -17,103 +17,86 @@
|
||||
#ifndef _DrawTrSurf_Surface_HeaderFile
|
||||
#define _DrawTrSurf_Surface_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <DrawTrSurf_Drawable.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class Geom_Surface;
|
||||
class Draw_Color;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Surface;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Surface, DrawTrSurf_Drawable)
|
||||
|
||||
//! This class defines a drawable surface.
|
||||
//! With this class you can draw a general surface from
|
||||
//! package Geom.
|
||||
//! With this class you can draw a general surface from package Geom.
|
||||
class DrawTrSurf_Surface : public DrawTrSurf_Drawable
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Surface, DrawTrSurf_Drawable)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
|
||||
//! default drawing mode
|
||||
//! Just the middle isoparametric curves are drawn.
|
||||
//! The boundaries are yellow, the isoparametric curves are blues.
|
||||
//! For the discretisation 50 points are computed in each parametric
|
||||
//! direction.
|
||||
Standard_EXPORT DrawTrSurf_Surface(const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Surface(const Handle(Geom_Surface)& S, const Standard_Integer Nu, const Standard_Integer Nv, const Draw_Color& BoundsColor, const Draw_Color& IsosColor, const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Draw_Color BoundsColor() const;
|
||||
|
||||
//! For the discretisation 50 points are computed in each parametric direction.
|
||||
Standard_EXPORT DrawTrSurf_Surface (const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Surface (const Handle(Geom_Surface)& S,
|
||||
const Standard_Integer Nu, const Standard_Integer Nv,
|
||||
const Draw_Color& BoundsColor, const Draw_Color& IsosColor,
|
||||
const Standard_Integer Discret, const Standard_Real Deflection, const Standard_Integer DrawMode);
|
||||
|
||||
Draw_Color BoundsColor() const { return boundsLook; }
|
||||
|
||||
//! rub out all the isoparametric curves.
|
||||
Standard_EXPORT virtual void ClearIsos();
|
||||
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
//! Iso = True : Draw the isos, the boundaries, the UVMarker.
|
||||
//! Iso = False: Only Draw the boundary and the UVMarker.
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis, const Standard_Boolean Iso) const;
|
||||
|
||||
Handle(Geom_Surface) GetSurface() const;
|
||||
|
||||
Draw_Color IsosColor() const;
|
||||
|
||||
void NbIsos (Standard_Integer& Nu, Standard_Integer& Nb) const;
|
||||
|
||||
void SetBoundsColor (const Draw_Color& aColor);
|
||||
|
||||
void SetIsosColor (const Draw_Color& aColor);
|
||||
|
||||
Handle(Geom_Surface) GetSurface() const { return surf; }
|
||||
|
||||
Draw_Color IsosColor() const { return isosLook; }
|
||||
|
||||
void NbIsos (Standard_Integer& theNU, Standard_Integer& theNV) const
|
||||
{
|
||||
theNU = nbUIsos;
|
||||
theNV = nbVIsos;
|
||||
}
|
||||
|
||||
void SetBoundsColor (const Draw_Color& theColor) { boundsLook = theColor; }
|
||||
|
||||
void SetIsosColor (const Draw_Color& theColor) { isosLook = theColor; }
|
||||
|
||||
//! change the number of isoparametric curves to be drawn.
|
||||
Standard_EXPORT virtual void ShowIsos (const Standard_Integer Nu, const Standard_Integer Nv);
|
||||
|
||||
virtual void ShowIsos (const Standard_Integer theNu, const Standard_Integer theNv)
|
||||
{
|
||||
nbUIsos = Abs(theNu);
|
||||
nbVIsos = Abs(theNv);
|
||||
}
|
||||
|
||||
//! 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;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Surface,DrawTrSurf_Drawable)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Handle(Geom_Surface) surf;
|
||||
Draw_Color boundsLook;
|
||||
Draw_Color isosLook;
|
||||
Standard_Integer nbUIsos;
|
||||
Standard_Integer nbVIsos;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <DrawTrSurf_Surface.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Surface_HeaderFile
|
||||
|
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 1995-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.
|
||||
|
||||
inline Handle(Geom_Surface) DrawTrSurf_Surface::GetSurface () const {
|
||||
return surf;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_Surface::BoundsColor () const {
|
||||
return boundsLook;
|
||||
}
|
||||
|
||||
|
||||
inline Draw_Color DrawTrSurf_Surface::IsosColor () const {
|
||||
return isosLook;
|
||||
}
|
||||
|
||||
|
||||
inline void DrawTrSurf_Surface::SetIsosColor (const Draw_Color& aColor) {
|
||||
|
||||
isosLook = aColor;
|
||||
}
|
||||
|
||||
inline void DrawTrSurf_Surface::SetBoundsColor (const Draw_Color& aColor) {
|
||||
|
||||
boundsLook = aColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline void DrawTrSurf_Surface::NbIsos (Standard_Integer& Nu, Standard_Integer& Nv) const {
|
||||
|
||||
Nu = nbUIsos;
|
||||
Nv = nbVIsos;
|
||||
}
|
@@ -14,32 +14,30 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <DrawTrSurf_Triangulation.hxx>
|
||||
|
||||
#include <Draw_Color.hxx>
|
||||
#include <Draw_Display.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <DrawTrSurf_Triangulation.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Poly.hxx>
|
||||
#include <Poly_Array1OfTriangle.hxx>
|
||||
#include <Poly_Connect.hxx>
|
||||
#include <Poly_Triangle.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Triangulation,Draw_Drawable3D)
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawTrSurf_Triangulation
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
DrawTrSurf_Triangulation::DrawTrSurf_Triangulation
|
||||
(const Handle(Poly_Triangulation)& T):
|
||||
myTriangulation(T),
|
||||
myNodes(Standard_False),
|
||||
myTriangles(Standard_False)
|
||||
DrawTrSurf_Triangulation::DrawTrSurf_Triangulation (const Handle(Poly_Triangulation)& T)
|
||||
: myTriangulation(T),
|
||||
myNodes(Standard_False),
|
||||
myTriangles(Standard_False)
|
||||
{
|
||||
// Build the connect tool
|
||||
Poly_Connect pc(T);
|
||||
@@ -85,62 +83,11 @@ DrawTrSurf_Triangulation::DrawTrSurf_Triangulation
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Triangulation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_Triangulation) DrawTrSurf_Triangulation::Triangulation() const
|
||||
{
|
||||
return myTriangulation;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Triangulation::ShowNodes(const Standard_Boolean B)
|
||||
{
|
||||
myNodes = B;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowNodes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean DrawTrSurf_Triangulation::ShowNodes() const
|
||||
{
|
||||
return myNodes;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowTriangles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Triangulation::ShowTriangles(const Standard_Boolean B)
|
||||
{
|
||||
myTriangles = B;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShowTriangles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean DrawTrSurf_Triangulation::ShowTriangles() const
|
||||
{
|
||||
return myTriangles;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Triangulation::DrawOn(Draw_Display& dis) const
|
||||
void DrawTrSurf_Triangulation::DrawOn (Draw_Display& dis) const
|
||||
{
|
||||
// Display the edges
|
||||
Standard_Integer i,n;
|
||||
@@ -196,31 +143,59 @@ void DrawTrSurf_Triangulation::DrawOn(Draw_Display& dis) const
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Triangulation::Copy() const
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Triangulation::Copy() const
|
||||
{
|
||||
return new DrawTrSurf_Triangulation(myTriangulation);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void DrawTrSurf_Triangulation::Dump(Standard_OStream& S) const
|
||||
void DrawTrSurf_Triangulation::Dump (Standard_OStream& S) const
|
||||
{
|
||||
Poly::Dump(myTriangulation,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//function : Save
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Triangulation::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
|
||||
Poly::Write (myTriangulation, theStream);
|
||||
#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
|
||||
theStream.setf (aFlags);
|
||||
#else
|
||||
theStream.setf (aForm);
|
||||
theStream.precision (aPrec);
|
||||
#endif
|
||||
}
|
||||
|
||||
void DrawTrSurf_Triangulation::Whatis(Draw_Interpretor& I) const
|
||||
//=======================================================================
|
||||
//function : Restore
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Draw_Drawable3D) DrawTrSurf_Triangulation::Restore (Standard_IStream& theStream)
|
||||
{
|
||||
return new DrawTrSurf_Triangulation (Poly::ReadTriangulation (theStream));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void DrawTrSurf_Triangulation::Whatis (Draw_Interpretor& I) const
|
||||
{
|
||||
I << "triangulation";
|
||||
}
|
||||
|
||||
|
@@ -17,20 +17,12 @@
|
||||
#ifndef _DrawTrSurf_Triangulation_HeaderFile
|
||||
#define _DrawTrSurf_Triangulation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
class Poly_Triangulation;
|
||||
class Draw_Display;
|
||||
class Draw_Drawable3D;
|
||||
|
||||
|
||||
class DrawTrSurf_Triangulation;
|
||||
DEFINE_STANDARD_HANDLE(DrawTrSurf_Triangulation, Draw_Drawable3D)
|
||||
|
||||
//! Used to display a triangulation.
|
||||
@@ -40,60 +32,44 @@ DEFINE_STANDARD_HANDLE(DrawTrSurf_Triangulation, Draw_Drawable3D)
|
||||
//! Optional display of triangles and nodes indices.
|
||||
class DrawTrSurf_Triangulation : public Draw_Drawable3D
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Triangulation, Draw_Drawable3D)
|
||||
Draw_Drawable3D_FACTORY
|
||||
public:
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Triangulation (const Handle(Poly_Triangulation)& T);
|
||||
|
||||
Handle(Poly_Triangulation) Triangulation() const { return myTriangulation; }
|
||||
|
||||
void ShowNodes (const Standard_Boolean theB) { myNodes = theB; }
|
||||
|
||||
Standard_Boolean ShowNodes() const { return myNodes; }
|
||||
|
||||
void ShowTriangles (const Standard_Boolean theB) { myTriangles = theB; }
|
||||
|
||||
Standard_Boolean ShowTriangles() const { return myTriangles; }
|
||||
|
||||
Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
Standard_EXPORT DrawTrSurf_Triangulation(const Handle(Poly_Triangulation)& T);
|
||||
|
||||
Standard_EXPORT Handle(Poly_Triangulation) Triangulation() const;
|
||||
|
||||
Standard_EXPORT void ShowNodes (const Standard_Boolean B);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ShowNodes() const;
|
||||
|
||||
Standard_EXPORT void ShowTriangles (const Standard_Boolean B);
|
||||
|
||||
Standard_EXPORT Standard_Boolean ShowTriangles() const;
|
||||
|
||||
Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
//! 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;
|
||||
|
||||
//! For variable whatis command. Set as a result the
|
||||
//! type of the variable.
|
||||
|
||||
//! Save drawable into stream.
|
||||
Standard_EXPORT virtual void Save (Standard_OStream& theStream) const Standard_OVERRIDE;
|
||||
|
||||
//! For variable whatis command. Set as a result the type of the variable.
|
||||
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(DrawTrSurf_Triangulation,Draw_Drawable3D)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Poly_Triangulation) myTriangulation;
|
||||
Handle(TColStd_HArray1OfInteger) myInternals;
|
||||
Handle(TColStd_HArray1OfInteger) myFree;
|
||||
Standard_Boolean myNodes;
|
||||
Standard_Boolean myTriangles;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _DrawTrSurf_Triangulation_HeaderFile
|
||||
|
@@ -2,32 +2,24 @@ DrawTrSurf.cxx
|
||||
DrawTrSurf.hxx
|
||||
DrawTrSurf_BezierCurve.cxx
|
||||
DrawTrSurf_BezierCurve.hxx
|
||||
DrawTrSurf_BezierCurve.lxx
|
||||
DrawTrSurf_BezierCurve2d.cxx
|
||||
DrawTrSurf_BezierCurve2d.hxx
|
||||
DrawTrSurf_BezierCurve2d.lxx
|
||||
DrawTrSurf_BezierSurface.cxx
|
||||
DrawTrSurf_BezierSurface.hxx
|
||||
DrawTrSurf_BezierSurface.lxx
|
||||
DrawTrSurf_BSplineCurve.cxx
|
||||
DrawTrSurf_BSplineCurve.hxx
|
||||
DrawTrSurf_BSplineCurve.lxx
|
||||
DrawTrSurf_BSplineCurve2d.cxx
|
||||
DrawTrSurf_BSplineCurve2d.hxx
|
||||
DrawTrSurf_BSplineCurve2d.lxx
|
||||
DrawTrSurf_BSplineSurface.cxx
|
||||
DrawTrSurf_BSplineSurface.hxx
|
||||
DrawTrSurf_BSplineSurface.lxx
|
||||
DrawTrSurf_Curve.cxx
|
||||
DrawTrSurf_Curve.hxx
|
||||
DrawTrSurf_Curve.lxx
|
||||
DrawTrSurf_Curve2d.cxx
|
||||
DrawTrSurf_Curve2d.hxx
|
||||
DrawTrSurf_Curve2d.lxx
|
||||
DrawTrSurf_Debug.cxx
|
||||
DrawTrSurf_Drawable.cxx
|
||||
DrawTrSurf_Drawable.hxx
|
||||
DrawTrSurf_Drawable.lxx
|
||||
DrawTrSurf_Params.hxx
|
||||
DrawTrSurf_Point.cxx
|
||||
DrawTrSurf_Point.hxx
|
||||
DrawTrSurf_Polygon2D.cxx
|
||||
@@ -36,7 +28,6 @@ DrawTrSurf_Polygon3D.cxx
|
||||
DrawTrSurf_Polygon3D.hxx
|
||||
DrawTrSurf_Surface.cxx
|
||||
DrawTrSurf_Surface.hxx
|
||||
DrawTrSurf_Surface.lxx
|
||||
DrawTrSurf_Triangulation.cxx
|
||||
DrawTrSurf_Triangulation.hxx
|
||||
DrawTrSurf_Triangulation2D.cxx
|
||||
|
Reference in New Issue
Block a user