1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00
occt/src/Contap/Contap_Line.gxx
bugmaster b311480ed5 0023024: Update headers of OCCT files
Added appropriate copyright and license information in source files
2012-03-21 19:43:04 +04:00

100 lines
2.6 KiB
Plaintext
Executable File

// Created on: 1993-02-05
// Created by: Jacques GOUSSARD
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
Contap_Line::Contap_Line () {
svtx = new TheHSequenceOfPoint ();
Trans = IntSurf_Undecided;
}
void Contap_Line::ResetSeqOfVertex() {
svtx = new TheHSequenceOfPoint ();
}
void Contap_Line::Add(const ThePoint& P) {
Standard_Integer n = svtx->Length();
if(n==0) {
svtx->Append(P);
}
else {
Standard_Real prm = P.ParameterOnLine();
if(prm > svtx->Value(n).ParameterOnLine()) {
svtx->Append(P);
}
else {
for(Standard_Integer i=n-1;i>0;i--) {
if(prm> svtx->Value(i).ParameterOnLine()) {
svtx->InsertBefore(i+1,P);
return;
}
}
svtx->Prepend(P);
}
}
}
void Contap_Line::Clear () {
if(!curv.IsNull())
curv->Clear();
svtx = new TheHSequenceOfPoint ();
typL = Contap_Walking;
}
void Contap_Line::SetValue(const gp_Lin& L)
{
pt = L.Location();
dir1 = L.Direction();
typL = Contap_Lin;
}
void Contap_Line::SetValue(const gp_Circ& C)
{
pt = C.Location();
dir1 = C.Position().Direction();
dir2 = C.Position().XDirection();
rad = C.Radius();
typL = Contap_Circle;
}
void Contap_Line::SetValue(const TheArc& A)
{
thearc = A;
typL = Contap_Restriction;
}
void Contap_Line::SetLineOn2S(const Handle(IntSurf_LineOn2S)& L) {
curv = L;
typL = Contap_Walking;
}
void Contap_Line::SetTransitionOnS(const IntSurf_TypeTrans T) {
Trans = T;
}
IntSurf_TypeTrans Contap_Line::TransitionOnS() const {
return(Trans);
}
const TheArc& Contap_Line::Arc () const
{
if (typL != Contap_Restriction) {Standard_DomainError::Raise();}
return thearc;
}