-// File: AIS_Line.cxx
-// Created: Tue Jan 21 11:45:01 1997
-// Author: Prestataire Christiane ARMAND
-// <car@chamalox.paris1.matra-dtv.fr>
-// Copyright: Matra Datavision 1997
-
-#define GER61351 //GG_171199 Enable to set an object RGB color
-// instead a restricted object NameOfColor.
+// Created on: 1997-01-21
+// Created by: Prestataire Christiane ARMAND
+// Copyright (c) 1997-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.
+
+//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
#include <AIS_Line.ixx>
#include <Aspect_TypeOfLine.hxx>
#include <Prs3d_Drawer.hxx>
#include <Precision.hxx>
#include <Prs3d_LineAspect.hxx>
-#include <Graphic3d_ArrayOfPrimitives.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <TColgp_Array1OfPnt.hxx>
//=======================================================================
void AIS_Line::SetColor(const Quantity_NameOfColor aCol)
-#ifdef GER61351
{
SetColor(Quantity_Color(aCol));
}
void AIS_Line::SetColor(const Quantity_Color &aCol)
-#endif
{
hasOwnColor=Standard_True;
myOwnColor=aCol;
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
else{
-#ifdef GER61351
Quantity_Color CC;
if( HasColor() ) CC = myOwnColor;
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-#else
- Quantity_NameOfColor CC =
- AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
-#endif
-
myDrawer->LineAspect()->SetColor(CC);
myOwnColor = CC;
}
{
myOwnWidth=aValue;
-#ifndef GER61351
- Quantity_NameOfColor CC =
- HasColor()? myOwnColor : AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
-#endif
-
if (!myDrawer->HasLineAspect ()) {
-#ifdef GER61351
Quantity_Color CC;
if( HasColor() ) CC = myOwnColor;
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
-#endif
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
} else
myDrawer->LineAspect()->SetWidth(aValue);
//=======================================================================
void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
{
-
GeomAdaptor_Curve curv(myComponent);
- Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
- if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
- if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
//pas de prise en compte lors du FITALL
aPresentation->SetInfiniteState (Standard_True);
-
}
//=======================================================================
//=======================================================================
void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentation)
{
-
gp_Pnt P1 = myStartPoint->Pnt();
gp_Pnt P2 = myEndPoint->Pnt();
Standard_Real dist = P1.Distance(P2);
GeomAdaptor_Curve curv(myComponent,0.,dist);
- Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
- if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
- if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
-
}
myEndPoint->Pnt());
aSelection->Add(seg);
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager2d)&,
- const Handle(Graphic2d_GraphicObject)&,
- const Standard_Integer)
-{
-}
//=======================================================================
//function : Compute