| 1 | // Copyright (c) 1995-1999 Matra Datavision |
| 2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
| 3 | // |
| 4 | // This file is part of Open CASCADE Technology software library. |
| 5 | // |
| 6 | // This library is free software; you can redistribute it and/or modify it under |
| 7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
| 8 | // by the Free Software Foundation, with special exception defined in the file |
| 9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
| 10 | // distribution for complete text of the license and disclaimer of any warranty. |
| 11 | // |
| 12 | // Alternatively, this file may be used under the terms of Open CASCADE |
| 13 | // commercial license or contractual agreement. |
| 14 | |
| 15 | #include <Prs3d_Drawer.ixx> |
| 16 | |
| 17 | // ======================================================================= |
| 18 | // function : Prs3d_Drawer |
| 19 | // purpose : |
| 20 | // ======================================================================= |
| 21 | Prs3d_Drawer::Prs3d_Drawer() |
| 22 | : myNbPoints (30), |
| 23 | myIsoOnPlane (Standard_False), |
| 24 | myFreeBoundaryDraw (Standard_True), |
| 25 | myUnFreeBoundaryDraw (Standard_True), |
| 26 | myWireDraw (Standard_True), |
| 27 | myShadingAspect (new Prs3d_ShadingAspect()), |
| 28 | myShadingAspectGlobal (Standard_True), |
| 29 | myChordialDeviation (0.0001), |
| 30 | myTypeOfDeflection (Aspect_TOD_RELATIVE), |
| 31 | myMaximalParameterValue (500000.), |
| 32 | myDeviationCoefficient (0.001), |
| 33 | myHLRDeviationCoefficient (0.02), |
| 34 | myDeviationAngle (12.0 * M_PI / 180.0), |
| 35 | myHLRAngle (20.0 * M_PI / 180.0), |
| 36 | myVertexDrawMode (Prs3d_VDM_Isolated), |
| 37 | myLineDrawArrow (Standard_False), |
| 38 | myDrawHiddenLine (Standard_False), |
| 39 | myFaceBoundaryDraw (Standard_False), |
| 40 | myTypeOfHLR (Prs3d_TOH_PolyAlgo) |
| 41 | { |
| 42 | myDimensionModelUnits.SetLengthUnits ("m"); |
| 43 | myDimensionModelUnits.SetAngleUnits ("rad"); |
| 44 | myDimensionDisplayUnits.SetLengthUnits ("m"); |
| 45 | myDimensionDisplayUnits.SetAngleUnits ("deg"); |
| 46 | } |
| 47 | |
| 48 | void Prs3d_Drawer::SetTypeOfDeflection(const Aspect_TypeOfDeflection aTypeOfDeflection){ |
| 49 | |
| 50 | myTypeOfDeflection = aTypeOfDeflection;} |
| 51 | |
| 52 | Aspect_TypeOfDeflection Prs3d_Drawer::TypeOfDeflection() const { |
| 53 | |
| 54 | return myTypeOfDeflection; |
| 55 | |
| 56 | } |
| 57 | |
| 58 | |
| 59 | void Prs3d_Drawer::SetIsoOnPlane(const Standard_Boolean OnOff) |
| 60 | { |
| 61 | myIsoOnPlane = OnOff; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | Standard_Boolean Prs3d_Drawer::IsoOnPlane()const |
| 66 | { |
| 67 | return myIsoOnPlane; |
| 68 | } |
| 69 | |
| 70 | |
| 71 | Standard_Integer Prs3d_Drawer::Discretisation() const |
| 72 | { |
| 73 | return myNbPoints; |
| 74 | } |
| 75 | |
| 76 | |
| 77 | void Prs3d_Drawer::SetDiscretisation(const Standard_Integer d) |
| 78 | { |
| 79 | myNbPoints = d; |
| 80 | } |
| 81 | |
| 82 | |
| 83 | void Prs3d_Drawer::SetMaximalChordialDeviation( |
| 84 | const Quantity_Length aChordialDeviation) { |
| 85 | myChordialDeviation = aChordialDeviation; |
| 86 | } |
| 87 | |
| 88 | Quantity_Length Prs3d_Drawer::MaximalChordialDeviation() const { |
| 89 | return myChordialDeviation; |
| 90 | } |
| 91 | |
| 92 | // |
| 93 | //======================================================================= |
| 94 | //function : SetDeviationCoefficient |
| 95 | //purpose : |
| 96 | //======================================================================= |
| 97 | |
| 98 | void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real aCoefficient) { |
| 99 | |
| 100 | myDeviationCoefficient = aCoefficient; |
| 101 | } |
| 102 | |
| 103 | //======================================================================= |
| 104 | //function : DeviationCoefficient |
| 105 | //purpose : |
| 106 | //======================================================================= |
| 107 | |
| 108 | Standard_Real Prs3d_Drawer::DeviationCoefficient () const { |
| 109 | |
| 110 | return myDeviationCoefficient; |
| 111 | } |
| 112 | |
| 113 | //======================================================================= |
| 114 | //function : SetHLRDeviationCoefficient |
| 115 | //purpose : |
| 116 | //======================================================================= |
| 117 | |
| 118 | void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real aCoefficient) { |
| 119 | |
| 120 | myHLRDeviationCoefficient = aCoefficient; |
| 121 | } |
| 122 | |
| 123 | //======================================================================= |
| 124 | //function : HLRDeviationCoefficient |
| 125 | //purpose : |
| 126 | //======================================================================= |
| 127 | |
| 128 | Standard_Real Prs3d_Drawer::HLRDeviationCoefficient () const { |
| 129 | |
| 130 | return myHLRDeviationCoefficient; |
| 131 | } |
| 132 | |
| 133 | //======================================================================= |
| 134 | //function : SetHLRAngle |
| 135 | //purpose : |
| 136 | //======================================================================= |
| 137 | |
| 138 | void Prs3d_Drawer::SetHLRAngle (const Standard_Real anAngle) { |
| 139 | |
| 140 | myHLRAngle = anAngle; |
| 141 | } |
| 142 | |
| 143 | //======================================================================= |
| 144 | //function : HLRAngle |
| 145 | //purpose : |
| 146 | //======================================================================= |
| 147 | |
| 148 | Standard_Real Prs3d_Drawer::HLRAngle () const { |
| 149 | |
| 150 | return myHLRAngle; |
| 151 | } |
| 152 | |
| 153 | //======================================================================= |
| 154 | //function : SetDeviationAngle |
| 155 | //purpose : |
| 156 | //======================================================================= |
| 157 | |
| 158 | void Prs3d_Drawer::SetDeviationAngle (const Standard_Real anAngle) |
| 159 | { |
| 160 | myDeviationAngle = anAngle; |
| 161 | } |
| 162 | |
| 163 | //======================================================================= |
| 164 | //function : DeviationAngle |
| 165 | //purpose : |
| 166 | //======================================================================= |
| 167 | |
| 168 | Standard_Real Prs3d_Drawer::DeviationAngle () const |
| 169 | { |
| 170 | return myDeviationAngle; |
| 171 | } |
| 172 | |
| 173 | |
| 174 | void Prs3d_Drawer::SetMaximalParameterValue (const Standard_Real Value) { |
| 175 | myMaximalParameterValue = Value; |
| 176 | } |
| 177 | |
| 178 | Standard_Real Prs3d_Drawer::MaximalParameterValue () const { |
| 179 | return myMaximalParameterValue; |
| 180 | } |
| 181 | |
| 182 | Handle (Prs3d_IsoAspect) Prs3d_Drawer::UIsoAspect (){ |
| 183 | |
| 184 | if (myUIsoAspect.IsNull()) |
| 185 | myUIsoAspect = new Prs3d_IsoAspect |
| 186 | (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1); |
| 187 | |
| 188 | return myUIsoAspect; |
| 189 | } |
| 190 | |
| 191 | void Prs3d_Drawer::SetUIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) { |
| 192 | myUIsoAspect = anAspect; |
| 193 | } |
| 194 | |
| 195 | Handle (Prs3d_IsoAspect) Prs3d_Drawer::VIsoAspect () { |
| 196 | if (myVIsoAspect.IsNull()) |
| 197 | myVIsoAspect = new Prs3d_IsoAspect |
| 198 | (Quantity_NOC_GRAY75,Aspect_TOL_SOLID,0.5,1); |
| 199 | |
| 200 | return myVIsoAspect; |
| 201 | } |
| 202 | |
| 203 | void Prs3d_Drawer::SetVIsoAspect ( const Handle(Prs3d_IsoAspect)& anAspect) { |
| 204 | myVIsoAspect = anAspect; |
| 205 | } |
| 206 | |
| 207 | Handle (Prs3d_LineAspect) Prs3d_Drawer::FreeBoundaryAspect () { |
| 208 | if (myFreeBoundaryAspect.IsNull()) |
| 209 | myFreeBoundaryAspect = new Prs3d_LineAspect |
| 210 | (Quantity_NOC_GREEN,Aspect_TOL_SOLID,1.); |
| 211 | |
| 212 | return myFreeBoundaryAspect; |
| 213 | } |
| 214 | |
| 215 | void Prs3d_Drawer::SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& anAspect) { |
| 216 | myFreeBoundaryAspect = anAspect; |
| 217 | } |
| 218 | |
| 219 | void Prs3d_Drawer::SetFreeBoundaryDraw ( const Standard_Boolean OnOff ) { |
| 220 | myFreeBoundaryDraw = OnOff; |
| 221 | } |
| 222 | |
| 223 | Standard_Boolean Prs3d_Drawer::FreeBoundaryDraw () const { |
| 224 | return myFreeBoundaryDraw; |
| 225 | } |
| 226 | |
| 227 | Handle (Prs3d_LineAspect) Prs3d_Drawer::UnFreeBoundaryAspect (){ |
| 228 | if (myUnFreeBoundaryAspect.IsNull()) |
| 229 | myUnFreeBoundaryAspect = new Prs3d_LineAspect |
| 230 | (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.); |
| 231 | return myUnFreeBoundaryAspect; |
| 232 | } |
| 233 | |
| 234 | void Prs3d_Drawer::SetUnFreeBoundaryAspect ( const Handle(Prs3d_LineAspect)& anAspect) { |
| 235 | myUnFreeBoundaryAspect = anAspect; |
| 236 | } |
| 237 | |
| 238 | void Prs3d_Drawer::SetUnFreeBoundaryDraw ( const Standard_Boolean OnOff ) { |
| 239 | myUnFreeBoundaryDraw = OnOff; |
| 240 | } |
| 241 | |
| 242 | Standard_Boolean Prs3d_Drawer::UnFreeBoundaryDraw () const { |
| 243 | return myUnFreeBoundaryDraw; |
| 244 | } |
| 245 | |
| 246 | Handle (Prs3d_LineAspect) Prs3d_Drawer::WireAspect () { |
| 247 | if (myWireAspect.IsNull()) |
| 248 | myWireAspect = new Prs3d_LineAspect(Quantity_NOC_RED,Aspect_TOL_SOLID,1.); |
| 249 | |
| 250 | return myWireAspect; |
| 251 | } |
| 252 | |
| 253 | void Prs3d_Drawer::SetWireAspect ( const Handle(Prs3d_LineAspect)& anAspect) { |
| 254 | myWireAspect = anAspect; |
| 255 | } |
| 256 | void Prs3d_Drawer::SetWireDraw ( const Standard_Boolean OnOff ) { |
| 257 | myWireDraw = OnOff; |
| 258 | } |
| 259 | |
| 260 | Standard_Boolean Prs3d_Drawer::WireDraw () const { |
| 261 | return myWireDraw; |
| 262 | } |
| 263 | |
| 264 | |
| 265 | Handle (Prs3d_LineAspect) Prs3d_Drawer::LineAspect () { |
| 266 | if (myLineAspect.IsNull()) |
| 267 | myLineAspect = new Prs3d_LineAspect |
| 268 | (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.); |
| 269 | return myLineAspect; |
| 270 | } |
| 271 | |
| 272 | void Prs3d_Drawer::SetLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) { |
| 273 | myLineAspect = anAspect; |
| 274 | } |
| 275 | |
| 276 | Handle (Prs3d_TextAspect) Prs3d_Drawer::TextAspect () { |
| 277 | if (myTextAspect.IsNull()) |
| 278 | myTextAspect = new Prs3d_TextAspect(); |
| 279 | |
| 280 | return myTextAspect; |
| 281 | } |
| 282 | |
| 283 | void Prs3d_Drawer::SetTextAspect ( const Handle(Prs3d_TextAspect)& anAspect) { |
| 284 | myTextAspect = anAspect; |
| 285 | } |
| 286 | |
| 287 | Handle (Prs3d_ShadingAspect) Prs3d_Drawer::ShadingAspect () { |
| 288 | if (myShadingAspect.IsNull()) |
| 289 | myShadingAspect = new Prs3d_ShadingAspect(); |
| 290 | |
| 291 | return myShadingAspect; |
| 292 | } |
| 293 | |
| 294 | void Prs3d_Drawer::SetShadingAspect ( const Handle(Prs3d_ShadingAspect)& anAspect) { |
| 295 | myShadingAspect = anAspect; |
| 296 | } |
| 297 | |
| 298 | void Prs3d_Drawer::SetShadingAspectGlobal(const Standard_Boolean aValue) { |
| 299 | myShadingAspectGlobal = aValue; |
| 300 | } |
| 301 | |
| 302 | Standard_Boolean Prs3d_Drawer::ShadingAspectGlobal() const { |
| 303 | |
| 304 | return myShadingAspectGlobal; |
| 305 | |
| 306 | } |
| 307 | |
| 308 | void Prs3d_Drawer::SetLineArrowDraw ( const Standard_Boolean OnOff ) { |
| 309 | myLineDrawArrow = OnOff; |
| 310 | } |
| 311 | |
| 312 | Standard_Boolean Prs3d_Drawer::LineArrowDraw () const { |
| 313 | return myLineDrawArrow; |
| 314 | } |
| 315 | |
| 316 | Handle (Prs3d_ArrowAspect) Prs3d_Drawer::ArrowAspect() { |
| 317 | if (myArrowAspect.IsNull()) |
| 318 | myArrowAspect = new Prs3d_ArrowAspect; |
| 319 | |
| 320 | return myArrowAspect; |
| 321 | } |
| 322 | |
| 323 | void Prs3d_Drawer::SetArrowAspect ( const Handle(Prs3d_ArrowAspect)& anAspect) { |
| 324 | myArrowAspect = anAspect; |
| 325 | } |
| 326 | |
| 327 | Handle (Prs3d_PointAspect) Prs3d_Drawer::PointAspect() { |
| 328 | if (myPointAspect.IsNull()) |
| 329 | myPointAspect = new Prs3d_PointAspect |
| 330 | (Aspect_TOM_PLUS,Quantity_NOC_YELLOW,1.); |
| 331 | |
| 332 | return myPointAspect; |
| 333 | } |
| 334 | |
| 335 | void Prs3d_Drawer::SetPointAspect ( const Handle(Prs3d_PointAspect)& anAspect) { |
| 336 | myPointAspect = anAspect; |
| 337 | } |
| 338 | |
| 339 | void Prs3d_Drawer::SetVertexDrawMode (const Prs3d_VertexDrawMode theMode) |
| 340 | { |
| 341 | // Prs3d_VDM_Inherited value is allowed at AIS_Drawer level. |
| 342 | // Replacing it by Prs3d_VDM_Isolated to avoid unpredictable behavior. |
| 343 | myVertexDrawMode = (theMode == Prs3d_VDM_Inherited ? Prs3d_VDM_Isolated : theMode); |
| 344 | } |
| 345 | |
| 346 | Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode () const |
| 347 | { |
| 348 | return myVertexDrawMode; |
| 349 | } |
| 350 | |
| 351 | Standard_Boolean Prs3d_Drawer::DrawHiddenLine () const {return myDrawHiddenLine;} |
| 352 | |
| 353 | void Prs3d_Drawer::EnableDrawHiddenLine () {myDrawHiddenLine=Standard_True;} |
| 354 | |
| 355 | void Prs3d_Drawer::DisableDrawHiddenLine () {myDrawHiddenLine=Standard_False;} |
| 356 | |
| 357 | Handle (Prs3d_LineAspect) Prs3d_Drawer::HiddenLineAspect () { |
| 358 | if (myHiddenLineAspect.IsNull()) |
| 359 | myHiddenLineAspect = new Prs3d_LineAspect |
| 360 | (Quantity_NOC_YELLOW,Aspect_TOL_DASH,0.5); |
| 361 | |
| 362 | return myHiddenLineAspect; |
| 363 | } |
| 364 | |
| 365 | void Prs3d_Drawer::SetHiddenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) { |
| 366 | myHiddenLineAspect = anAspect; |
| 367 | } |
| 368 | |
| 369 | Handle (Prs3d_LineAspect) Prs3d_Drawer::SeenLineAspect () { |
| 370 | if (mySeenLineAspect.IsNull()) |
| 371 | mySeenLineAspect = new Prs3d_LineAspect |
| 372 | (Quantity_NOC_YELLOW,Aspect_TOL_SOLID,1.); |
| 373 | |
| 374 | return mySeenLineAspect; |
| 375 | } |
| 376 | |
| 377 | void Prs3d_Drawer::SetSeenLineAspect ( const Handle(Prs3d_LineAspect)& anAspect) { |
| 378 | mySeenLineAspect = anAspect; |
| 379 | } |
| 380 | |
| 381 | Handle (Prs3d_LineAspect) Prs3d_Drawer::VectorAspect () { |
| 382 | if (myVectorAspect.IsNull()) |
| 383 | myVectorAspect = new Prs3d_LineAspect |
| 384 | (Quantity_NOC_SKYBLUE,Aspect_TOL_SOLID,1.); |
| 385 | |
| 386 | return myVectorAspect; |
| 387 | } |
| 388 | |
| 389 | void Prs3d_Drawer::SetVectorAspect ( const Handle(Prs3d_LineAspect)& anAspect) { |
| 390 | myVectorAspect = anAspect; |
| 391 | } |
| 392 | |
| 393 | Handle (Prs3d_DatumAspect) Prs3d_Drawer::DatumAspect () { |
| 394 | if (myDatumAspect.IsNull()) |
| 395 | myDatumAspect = new Prs3d_DatumAspect; |
| 396 | |
| 397 | return myDatumAspect; |
| 398 | } |
| 399 | |
| 400 | void Prs3d_Drawer::SetDatumAspect ( const Handle(Prs3d_DatumAspect)& anAspect) { |
| 401 | myDatumAspect = anAspect; |
| 402 | } |
| 403 | |
| 404 | Handle (Prs3d_PlaneAspect) Prs3d_Drawer::PlaneAspect () { |
| 405 | if (myPlaneAspect.IsNull()) |
| 406 | myPlaneAspect = new Prs3d_PlaneAspect; |
| 407 | |
| 408 | return myPlaneAspect; |
| 409 | } |
| 410 | |
| 411 | void Prs3d_Drawer::SetPlaneAspect ( const Handle(Prs3d_PlaneAspect)& anAspect) { |
| 412 | myPlaneAspect = anAspect; |
| 413 | } |
| 414 | |
| 415 | // ======================================================================= |
| 416 | // function : DimensionAspect |
| 417 | // purpose : |
| 418 | // ======================================================================= |
| 419 | Handle(Prs3d_DimensionAspect) Prs3d_Drawer::DimensionAspect() |
| 420 | { |
| 421 | if (myDimensionAspect.IsNull()) |
| 422 | { |
| 423 | myDimensionAspect = new Prs3d_DimensionAspect; |
| 424 | } |
| 425 | |
| 426 | return myDimensionAspect; |
| 427 | } |
| 428 | |
| 429 | // ======================================================================= |
| 430 | // function : SetDimensionAspect |
| 431 | // purpose : |
| 432 | // ======================================================================= |
| 433 | void Prs3d_Drawer::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect) |
| 434 | { |
| 435 | myDimensionAspect = theAspect; |
| 436 | } |
| 437 | |
| 438 | // ======================================================================= |
| 439 | // function : SetDimLengthModelUnits |
| 440 | // purpose : |
| 441 | // ======================================================================= |
| 442 | void Prs3d_Drawer::SetDimLengthModelUnits (const TCollection_AsciiString& theUnits) |
| 443 | { |
| 444 | myDimensionModelUnits.SetLengthUnits (theUnits); |
| 445 | } |
| 446 | |
| 447 | // ======================================================================= |
| 448 | // function : SetDimAngleModelUnits |
| 449 | // purpose : |
| 450 | // ======================================================================= |
| 451 | void Prs3d_Drawer::SetDimAngleModelUnits (const TCollection_AsciiString& theUnits) |
| 452 | { |
| 453 | myDimensionModelUnits.SetAngleUnits (theUnits); |
| 454 | } |
| 455 | |
| 456 | // ======================================================================= |
| 457 | // function : DimLengthModelUnits |
| 458 | // purpose : |
| 459 | // ======================================================================= |
| 460 | const TCollection_AsciiString& Prs3d_Drawer::DimLengthModelUnits() const |
| 461 | { |
| 462 | return myDimensionModelUnits.GetLengthUnits(); |
| 463 | } |
| 464 | |
| 465 | // ======================================================================= |
| 466 | // function : DimAngleModelUnits |
| 467 | // purpose : |
| 468 | // ======================================================================= |
| 469 | const TCollection_AsciiString& Prs3d_Drawer::DimAngleModelUnits() const |
| 470 | { |
| 471 | return myDimensionModelUnits.GetAngleUnits(); |
| 472 | } |
| 473 | |
| 474 | // ======================================================================= |
| 475 | // function : SetDimLengthDisplayUnits |
| 476 | // purpose : |
| 477 | // ======================================================================= |
| 478 | void Prs3d_Drawer::SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits) |
| 479 | { |
| 480 | myDimensionDisplayUnits.SetLengthUnits (theUnits); |
| 481 | } |
| 482 | |
| 483 | // ======================================================================= |
| 484 | // function : SetDimAngleDisplayUnits |
| 485 | // purpose : |
| 486 | // ======================================================================= |
| 487 | void Prs3d_Drawer::SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits) |
| 488 | { |
| 489 | myDimensionDisplayUnits.SetAngleUnits (theUnits); |
| 490 | } |
| 491 | |
| 492 | // ======================================================================= |
| 493 | // function : DimLengthDisplayUnits |
| 494 | // purpose : |
| 495 | // ======================================================================= |
| 496 | const TCollection_AsciiString& Prs3d_Drawer::DimLengthDisplayUnits() const |
| 497 | { |
| 498 | return myDimensionDisplayUnits.GetLengthUnits(); |
| 499 | } |
| 500 | |
| 501 | // ======================================================================= |
| 502 | // function : DimAngleDisplayUnits |
| 503 | // purpose : |
| 504 | // ======================================================================= |
| 505 | const TCollection_AsciiString& Prs3d_Drawer::DimAngleDisplayUnits() const |
| 506 | { |
| 507 | return myDimensionDisplayUnits.GetAngleUnits(); |
| 508 | } |
| 509 | |
| 510 | // ======================================================================= |
| 511 | // function : SectionAspect |
| 512 | // purpose : |
| 513 | // ======================================================================= |
| 514 | Handle (Prs3d_LineAspect) Prs3d_Drawer::SectionAspect() |
| 515 | { |
| 516 | if (mySectionAspect.IsNull()) |
| 517 | { |
| 518 | mySectionAspect = new Prs3d_LineAspect (Quantity_NOC_ORANGE, Aspect_TOL_SOLID, 1.0); |
| 519 | } |
| 520 | |
| 521 | return mySectionAspect; |
| 522 | } |
| 523 | |
| 524 | // ======================================================================= |
| 525 | // function : SetSectionAspect |
| 526 | // purpose : |
| 527 | // ======================================================================= |
| 528 | void Prs3d_Drawer::SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect) |
| 529 | { |
| 530 | mySectionAspect = theAspect; |
| 531 | } |
| 532 | |
| 533 | // ======================================================================= |
| 534 | // function : SetFaceBoundaryDraw |
| 535 | // purpose : |
| 536 | // ======================================================================= |
| 537 | void Prs3d_Drawer::SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled) |
| 538 | { |
| 539 | myFaceBoundaryDraw = theIsEnabled; |
| 540 | } |
| 541 | |
| 542 | // ======================================================================= |
| 543 | // function : IsFaceBoundaryDraw |
| 544 | // purpose : |
| 545 | // ======================================================================= |
| 546 | Standard_Boolean Prs3d_Drawer::IsFaceBoundaryDraw () const |
| 547 | { |
| 548 | return myFaceBoundaryDraw; |
| 549 | } |
| 550 | |
| 551 | // ======================================================================= |
| 552 | // function : SetFaceBoundaryAspect |
| 553 | // purpose : |
| 554 | // ======================================================================= |
| 555 | void Prs3d_Drawer::SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect) |
| 556 | { |
| 557 | myFaceBoundaryAspect = theAspect; |
| 558 | } |
| 559 | |
| 560 | // ======================================================================= |
| 561 | // function : FaceBoundaryAspect |
| 562 | // purpose : |
| 563 | // ======================================================================= |
| 564 | Handle(Prs3d_LineAspect) Prs3d_Drawer::FaceBoundaryAspect () |
| 565 | { |
| 566 | if (myFaceBoundaryAspect.IsNull ()) |
| 567 | { |
| 568 | myFaceBoundaryAspect = |
| 569 | new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0); |
| 570 | } |
| 571 | |
| 572 | return myFaceBoundaryAspect; |
| 573 | } |
| 574 | |
| 575 | // ======================================================================= |
| 576 | // function : SetTypeOfHLR |
| 577 | // purpose : set type of HLR algorithm |
| 578 | // ======================================================================= |
| 579 | void Prs3d_Drawer::SetTypeOfHLR ( const Prs3d_TypeOfHLR theTypeOfHLR) |
| 580 | { |
| 581 | myTypeOfHLR = theTypeOfHLR; |
| 582 | } |
| 583 | |
| 584 | // ======================================================================= |
| 585 | // function : TypeOfHLR |
| 586 | // purpose : gets type of HLR algorithm |
| 587 | // ======================================================================= |
| 588 | Prs3d_TypeOfHLR Prs3d_Drawer::TypeOfHLR ( ) const |
| 589 | { |
| 590 | return myTypeOfHLR; |
| 591 | } |