1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-06 10:36:12 +03:00
occt/src/Draft/Draft_VertexInfo.cxx
ski 9775fa6110 0026937: Eliminate NO_CXX_EXCEPTION macro support
Macro NO_CXX_EXCEPTION was removed from code.
Method Raise() was replaced by explicit throw statement.
Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer.
Method Standard_Failure::Caught() is deprecated now.
Eliminated empty constructors.
Updated samples.
Eliminate empty method ChangeValue from NCollection_Map class.
Removed not operable methods from NCollection classes.
2017-02-02 16:35:54 +03:00

154 lines
4.1 KiB
C++

// Created on: 1994-09-01
// Created by: Jacques GOUSSARD
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Draft_VertexInfo.hxx>
#include <gp_Pnt.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoMoreObject.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
//=======================================================================
//function : Draft_VertexInfo
//purpose :
//=======================================================================
Draft_VertexInfo::Draft_VertexInfo () {}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void Draft_VertexInfo::Add(const TopoDS_Edge& E)
{
for (myItEd.Initialize(myEdges); myItEd.More(); myItEd.Next()) {
if (E.IsSame(myItEd.Value())) {
break;
}
}
if (!myItEd.More()) {
myEdges.Append(E);
myParams.Append(RealLast());
}
}
//=======================================================================
//function : Geometry
//purpose :
//=======================================================================
const gp_Pnt& Draft_VertexInfo::Geometry () const
{
return myGeom;
}
//=======================================================================
//function : ChangeGeometry
//purpose :
//=======================================================================
gp_Pnt& Draft_VertexInfo::ChangeGeometry ()
{
return myGeom;
}
//=======================================================================
//function : Parameter
//purpose :
//=======================================================================
Standard_Real Draft_VertexInfo::Parameter (const TopoDS_Edge& E)
{
TColStd_ListIteratorOfListOfReal itp(myParams);
myItEd.Initialize(myEdges);
for (; myItEd.More(); myItEd.Next(),itp.Next()) {
if (myItEd.Value().IsSame(E)) {
return itp.Value();
}
}
throw Standard_DomainError();
}
//=======================================================================
//function : ChangeParameter
//purpose :
//=======================================================================
Standard_Real& Draft_VertexInfo::ChangeParameter (const TopoDS_Edge& E)
{
TColStd_ListIteratorOfListOfReal itp(myParams);
myItEd.Initialize(myEdges);
for (; myItEd.More(); myItEd.Next(),itp.Next()) {
if (myItEd.Value().IsSame(E)) {
return itp.Value();
}
}
throw Standard_DomainError();
}
//=======================================================================
//function : InitEdgeIterator
//purpose :
//=======================================================================
void Draft_VertexInfo::InitEdgeIterator ()
{
myItEd.Initialize(myEdges);
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
const TopoDS_Edge& Draft_VertexInfo::Edge () const
{
return TopoDS::Edge(myItEd.Value());
}
//=======================================================================
//function : MoreEdge
//purpose :
//=======================================================================
Standard_Boolean Draft_VertexInfo::MoreEdge() const
{
return myItEd.More();
}
//=======================================================================
//function : NextEdge
//purpose :
//=======================================================================
void Draft_VertexInfo::NextEdge()
{
myItEd.Next();
}