Warning, /include/opencascade/BOPDS_Curve.lxx is written in an unsupported language. File is not indexed.
0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014
0015 #include <BOPDS_PaveBlock.hxx>
0016
0017 //=================================================================================================
0018
0019 inline BOPDS_Curve::BOPDS_Curve()
0020 : myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
0021 myPaveBlocks(myAllocator),
0022 myTechnoVertices(myAllocator),
0023 myTolerance(0.)
0024 {
0025 }
0026
0027 //=================================================================================================
0028
0029 inline BOPDS_Curve::BOPDS_Curve(const occ::handle<NCollection_BaseAllocator>& theAllocator)
0030 : myAllocator(theAllocator),
0031 myPaveBlocks(myAllocator),
0032 myTechnoVertices(myAllocator),
0033 myTolerance(0.)
0034 {
0035 }
0036
0037 //=================================================================================================
0038
0039 inline BOPDS_Curve::~BOPDS_Curve() = default;
0040
0041 //=================================================================================================
0042
0043 inline void BOPDS_Curve::SetCurve(const IntTools_Curve& theCurve)
0044 {
0045 myCurve = theCurve;
0046 }
0047
0048 //=================================================================================================
0049
0050 inline const IntTools_Curve& BOPDS_Curve::Curve() const
0051 {
0052 return myCurve;
0053 }
0054
0055 //=================================================================================================
0056
0057 inline void BOPDS_Curve::SetPaveBlocks(const NCollection_List<occ::handle<BOPDS_PaveBlock>>& theLPB)
0058 {
0059 NCollection_List<occ::handle<BOPDS_PaveBlock>>::Iterator aIt;
0060 //
0061 myPaveBlocks.Clear();
0062 aIt.Initialize(theLPB);
0063 for (; aIt.More(); aIt.Next())
0064 {
0065 myPaveBlocks.Append(aIt.Value());
0066 }
0067 }
0068
0069 //=================================================================================================
0070
0071 inline const NCollection_List<occ::handle<BOPDS_PaveBlock>>& BOPDS_Curve::PaveBlocks() const
0072 {
0073 return myPaveBlocks;
0074 }
0075
0076 //=================================================================================================
0077
0078 inline NCollection_List<occ::handle<BOPDS_PaveBlock>>& BOPDS_Curve::ChangePaveBlocks()
0079 {
0080 return myPaveBlocks;
0081 }
0082
0083 //=================================================================================================
0084
0085 inline void BOPDS_Curve::InitPaveBlock1()
0086 {
0087 if (!myPaveBlocks.Extent())
0088 {
0089 occ::handle<BOPDS_PaveBlock> aPB = new BOPDS_PaveBlock;
0090 myPaveBlocks.Append(aPB);
0091 }
0092 }
0093
0094 //=================================================================================================
0095
0096 inline occ::handle<BOPDS_PaveBlock>& BOPDS_Curve::ChangePaveBlock1()
0097 {
0098 occ::handle<BOPDS_PaveBlock>* pPB = (occ::handle<BOPDS_PaveBlock>*)&myPaveBlocks.First();
0099 return *pPB;
0100 }
0101
0102 //=================================================================================================
0103
0104 inline const NCollection_List<int>& BOPDS_Curve::TechnoVertices() const
0105 {
0106 return myTechnoVertices;
0107 }
0108
0109 //=================================================================================================
0110
0111 inline NCollection_List<int>& BOPDS_Curve::ChangeTechnoVertices()
0112 {
0113 return myTechnoVertices;
0114 }
0115
0116 //=================================================================================================
0117
0118 inline void BOPDS_Curve::SetBox(const Bnd_Box& theBox)
0119 {
0120 myBox = theBox;
0121 }
0122
0123 //=================================================================================================
0124
0125 inline const Bnd_Box& BOPDS_Curve::Box() const
0126 {
0127 return myBox;
0128 }
0129
0130 //=================================================================================================
0131
0132 inline Bnd_Box& BOPDS_Curve::ChangeBox()
0133 {
0134 return myBox;
0135 }
0136
0137 //=================================================================================================
0138
0139 inline bool BOPDS_Curve::HasEdge() const
0140 {
0141 bool bFlag;
0142 NCollection_List<occ::handle<BOPDS_PaveBlock>>::Iterator aItPB;
0143 //
0144 bFlag = false;
0145 aItPB.Initialize(myPaveBlocks);
0146 for (; aItPB.More(); aItPB.Next())
0147 {
0148 const occ::handle<BOPDS_PaveBlock>& aPB = aItPB.Value();
0149 bFlag = aPB->HasEdge();
0150 if (bFlag)
0151 {
0152 break;
0153 }
0154 }
0155 return bFlag;
0156 }