mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0030554: Coding - ChFiDS_CommonPoint uninitialized member traarc
Added missing initialization to ChFiDS_CommonPoint constructor.
This commit is contained in:
parent
a98b97f5da
commit
ac8f17746b
@ -27,11 +27,14 @@
|
|||||||
//function : ChFiDS_CommonPoint
|
//function : ChFiDS_CommonPoint
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
ChFiDS_CommonPoint::ChFiDS_CommonPoint() :
|
ChFiDS_CommonPoint::ChFiDS_CommonPoint()
|
||||||
tol(0.),
|
: tol (0.0),
|
||||||
isonarc(Standard_False),
|
prmarc (0.0),
|
||||||
isvtx(Standard_False),
|
prmtg (0.0),
|
||||||
hasvector(Standard_False)
|
traarc (TopAbs_FORWARD),
|
||||||
|
isonarc(Standard_False),
|
||||||
|
isvtx (Standard_False),
|
||||||
|
hasvector (Standard_False)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,8 +55,12 @@ public:
|
|||||||
//! Sets the values of a point which is a vertex on
|
//! Sets the values of a point which is a vertex on
|
||||||
//! the initial facet of restriction of one
|
//! the initial facet of restriction of one
|
||||||
//! of the surface.
|
//! of the surface.
|
||||||
void SetVertex (const TopoDS_Vertex& V);
|
void SetVertex (const TopoDS_Vertex& theVertex)
|
||||||
|
{
|
||||||
|
isvtx = Standard_True;
|
||||||
|
vtx = theVertex;
|
||||||
|
}
|
||||||
|
|
||||||
//! Sets the values of a point which is on the arc
|
//! Sets the values of a point which is on the arc
|
||||||
//! A, at parameter Param.
|
//! A, at parameter Param.
|
||||||
Standard_EXPORT void SetArc (const Standard_Real Tol, const TopoDS_Edge& A, const Standard_Real Param, const TopAbs_Orientation TArc);
|
Standard_EXPORT void SetArc (const Standard_Real Tol, const TopoDS_Edge& A, const Standard_Real Param, const TopAbs_Orientation TArc);
|
||||||
@ -66,30 +70,44 @@ public:
|
|||||||
|
|
||||||
//! Set the 3d point for a commonpoint that is not
|
//! Set the 3d point for a commonpoint that is not
|
||||||
//! a vertex or on an arc.
|
//! a vertex or on an arc.
|
||||||
void SetPoint (const gp_Pnt& Point);
|
void SetPoint (const gp_Pnt& thePoint) { point = thePoint; }
|
||||||
|
|
||||||
//! Set the output 3d vector
|
//! Set the output 3d vector
|
||||||
void SetVector (const gp_Vec& Vector);
|
void SetVector (const gp_Vec& theVector)
|
||||||
|
{
|
||||||
|
hasvector = Standard_True;
|
||||||
|
vector = theVector;
|
||||||
|
}
|
||||||
|
|
||||||
//! This method set the fuzziness on the point.
|
//! This method set the fuzziness on the point.
|
||||||
void SetTolerance (const Standard_Real Tol);
|
void SetTolerance (const Standard_Real Tol)
|
||||||
|
{
|
||||||
|
if (Tol > tol)
|
||||||
|
{
|
||||||
|
tol = Tol;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//! This method returns the fuzziness on the point.
|
//! This method returns the fuzziness on the point.
|
||||||
Standard_Real Tolerance() const;
|
Standard_Real Tolerance() const { return tol; }
|
||||||
|
|
||||||
//! Returns TRUE if the point is a vertex on the initial
|
//! Returns TRUE if the point is a vertex on the initial
|
||||||
//! restriction facet of the surface.
|
//! restriction facet of the surface.
|
||||||
Standard_Boolean IsVertex() const;
|
Standard_Boolean IsVertex() const { return isvtx; }
|
||||||
|
|
||||||
//! Returns the information about the point when it is
|
//! Returns the information about the point when it is
|
||||||
//! on the domain of the first patch, i-e when the function
|
//! on the domain of the first patch, i-e when the function
|
||||||
//! IsVertex returns True.
|
//! IsVertex returns True.
|
||||||
//! Otherwise, an exception is raised.
|
//! Otherwise, an exception is raised.
|
||||||
const TopoDS_Vertex& Vertex() const;
|
const TopoDS_Vertex& Vertex() const
|
||||||
|
{
|
||||||
|
if (!isvtx) { throw Standard_DomainError(); }
|
||||||
|
return vtx;
|
||||||
|
}
|
||||||
|
|
||||||
//! Returns TRUE if the point is a on an edge of the initial
|
//! Returns TRUE if the point is a on an edge of the initial
|
||||||
//! restriction facet of the surface.
|
//! restriction facet of the surface.
|
||||||
Standard_Boolean IsOnArc() const;
|
Standard_Boolean IsOnArc() const { return isonarc; }
|
||||||
|
|
||||||
//! Returns the arc of restriction containing the
|
//! Returns the arc of restriction containing the
|
||||||
//! vertex.
|
//! vertex.
|
||||||
@ -107,27 +125,20 @@ public:
|
|||||||
Standard_EXPORT Standard_Real Parameter() const;
|
Standard_EXPORT Standard_Real Parameter() const;
|
||||||
|
|
||||||
//! Returns the 3d point
|
//! Returns the 3d point
|
||||||
const gp_Pnt& Point() const;
|
const gp_Pnt& Point() const { return point; }
|
||||||
|
|
||||||
//! Returns TRUE if the output vector is stored.
|
//! Returns TRUE if the output vector is stored.
|
||||||
Standard_Boolean HasVector() const;
|
Standard_Boolean HasVector() const { return hasvector; }
|
||||||
|
|
||||||
//! Returns the output 3d vector
|
//! Returns the output 3d vector
|
||||||
const gp_Vec& Vector() const;
|
const gp_Vec& Vector() const
|
||||||
|
{
|
||||||
|
if (!hasvector) { throw Standard_DomainError ("ChFiDS_CommonPoint::Vector"); }
|
||||||
|
return vector;
|
||||||
|
}
|
||||||
protected:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TopoDS_Edge arc;
|
TopoDS_Edge arc;
|
||||||
TopoDS_Vertex vtx;
|
TopoDS_Vertex vtx;
|
||||||
gp_Pnt point;
|
gp_Pnt point;
|
||||||
@ -135,19 +146,11 @@ private:
|
|||||||
Standard_Real tol;
|
Standard_Real tol;
|
||||||
Standard_Real prmarc;
|
Standard_Real prmarc;
|
||||||
Standard_Real prmtg;
|
Standard_Real prmtg;
|
||||||
Standard_Boolean isonarc;
|
|
||||||
TopAbs_Orientation traarc;
|
TopAbs_Orientation traarc;
|
||||||
|
Standard_Boolean isonarc;
|
||||||
Standard_Boolean isvtx;
|
Standard_Boolean isvtx;
|
||||||
Standard_Boolean hasvector;
|
Standard_Boolean hasvector;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#include <ChFiDS_CommonPoint.lxx>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _ChFiDS_CommonPoint_HeaderFile
|
#endif // _ChFiDS_CommonPoint_HeaderFile
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
// Created on: 1993-11-30
|
|
||||||
// Created by: Isabelle GRIGNON
|
|
||||||
// Copyright (c) 1993-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.
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : SetVertex
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline void ChFiDS_CommonPoint::SetVertex(const TopoDS_Vertex& V)
|
|
||||||
{
|
|
||||||
isvtx = Standard_True;
|
|
||||||
vtx = V;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : SetPoint
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline void ChFiDS_CommonPoint::SetPoint(const gp_Pnt& Point)
|
|
||||||
{
|
|
||||||
point = Point;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : SetVector
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline void ChFiDS_CommonPoint::SetVector(const gp_Vec& Vector)
|
|
||||||
{
|
|
||||||
hasvector = Standard_True;
|
|
||||||
vector = Vector;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : SetTolerance
|
|
||||||
//purpose :
|
|
||||||
// PMN : 30/09/1997 : On se contente d'updater la tolerance.
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline void ChFiDS_CommonPoint::SetTolerance(const Standard_Real Tol)
|
|
||||||
{
|
|
||||||
if (Tol>tol) tol = Tol;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Tolerance
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline Standard_Real ChFiDS_CommonPoint::Tolerance()const
|
|
||||||
{
|
|
||||||
return tol;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsVertex
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline Standard_Boolean ChFiDS_CommonPoint::IsVertex()const
|
|
||||||
{
|
|
||||||
return isvtx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Vertex
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline const TopoDS_Vertex& ChFiDS_CommonPoint::Vertex()const
|
|
||||||
{
|
|
||||||
if (!isvtx) {throw Standard_DomainError();}
|
|
||||||
return vtx;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Point
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline const gp_Pnt& ChFiDS_CommonPoint::Point()const
|
|
||||||
{
|
|
||||||
return point;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : HasVector
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline Standard_Boolean ChFiDS_CommonPoint::HasVector()const
|
|
||||||
{
|
|
||||||
return hasvector;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : Vector
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline const gp_Vec& ChFiDS_CommonPoint::Vector()const
|
|
||||||
{
|
|
||||||
if (!hasvector) {
|
|
||||||
throw Standard_DomainError("ChFiDS_CommonPoint::Vector");
|
|
||||||
}
|
|
||||||
return vector;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : IsOnArc
|
|
||||||
//purpose :
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
inline Standard_Boolean ChFiDS_CommonPoint::IsOnArc()const
|
|
||||||
{
|
|
||||||
return isonarc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,7 +6,6 @@ ChFiDS_CircSection.cxx
|
|||||||
ChFiDS_CircSection.hxx
|
ChFiDS_CircSection.hxx
|
||||||
ChFiDS_CommonPoint.cxx
|
ChFiDS_CommonPoint.cxx
|
||||||
ChFiDS_CommonPoint.hxx
|
ChFiDS_CommonPoint.hxx
|
||||||
ChFiDS_CommonPoint.lxx
|
|
||||||
ChFiDS_ElSpine.cxx
|
ChFiDS_ElSpine.cxx
|
||||||
ChFiDS_ElSpine.hxx
|
ChFiDS_ElSpine.hxx
|
||||||
ChFiDS_ErrorStatus.hxx
|
ChFiDS_ErrorStatus.hxx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user