mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-14 20:59:23 +08:00
Coding - Apply more flags from Clang-tidy (#977)
- Refactor boolean expressions and improve code readability across multiple files - Simplified boolean expressions by removing unnecessary comparisons to true/false. - Replaced explicit boolean checks with direct variable usage Used flags: readability-static-accessed-through-instance readability-simplify-boolean-expr performance-for-range-copy performance-move-const-arg misc-unused-parameters misc-redundant-expression
This commit is contained in:
@@ -262,7 +262,7 @@ void BinLDrivers_DocumentRetrievalDriver::Read(Standard_IStream&
|
||||
for (; anIterS.More(); anIterS.Next())
|
||||
{
|
||||
BinLDrivers_DocumentSection& aCurSection = anIterS.ChangeValue();
|
||||
if (aCurSection.IsPostRead() == false)
|
||||
if (!aCurSection.IsPostRead())
|
||||
{
|
||||
theIStream.seekg((std::streampos)aCurSection.Offset());
|
||||
if (aCurSection.Name().IsEqual(SHAPESECTION_POS))
|
||||
@@ -671,12 +671,8 @@ void BinLDrivers_DocumentRetrievalDriver::Clear()
|
||||
bool BinLDrivers_DocumentRetrievalDriver::CheckDocumentVersion(const int theFileVersion,
|
||||
const int theCurVersion)
|
||||
{
|
||||
if (theFileVersion < TDocStd_FormatVersion_LOWER || theFileVersion > theCurVersion)
|
||||
{
|
||||
// file was written with another version
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
// file was written with another version
|
||||
return theFileVersion >= TDocStd_FormatVersion_LOWER && theFileVersion <= theCurVersion;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -86,7 +86,7 @@ void BinLDrivers_DocumentSection::WriteTOC(Standard_OStream& theStream
|
||||
{
|
||||
char aBuf[512];
|
||||
|
||||
if (myName.IsEmpty() == false)
|
||||
if (!myName.IsEmpty())
|
||||
{
|
||||
int* aBufSz = reinterpret_cast<int*>(&aBuf[0]);
|
||||
const size_t aBufSzSize = sizeof(aBuf) / sizeof(int);
|
||||
|
||||
@@ -63,7 +63,7 @@ bool BinMDataStd_BooleanListDriver::Paste(const BinObjMgt_Persistent& theS
|
||||
theSource.GetByteArray(&aTargetArray(aFirstInd), aLength);
|
||||
for (aIndex = aFirstInd; aIndex <= aLastInd; aIndex++)
|
||||
{
|
||||
anAtt->Append(aTargetArray.Value(aIndex) ? true : false);
|
||||
anAtt->Append(aTargetArray.Value(aIndex) != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type,
|
||||
if (myType == type)
|
||||
{
|
||||
occ::handle<TNaming_NamedShape> aShape = occ::down_cast<TNaming_NamedShape>(myGeometries[0]);
|
||||
if (aShape.IsNull() == false && G1.IsNull() == false)
|
||||
if (!aShape.IsNull() && !G1.IsNull())
|
||||
if (aShape->Get() == G1->Get())
|
||||
return;
|
||||
}
|
||||
@@ -91,8 +91,7 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type,
|
||||
{
|
||||
occ::handle<TNaming_NamedShape> aShape1 = occ::down_cast<TNaming_NamedShape>(myGeometries[0]);
|
||||
occ::handle<TNaming_NamedShape> aShape2 = occ::down_cast<TNaming_NamedShape>(myGeometries[1]);
|
||||
if (aShape1.IsNull() == false && G1.IsNull() == false && aShape2.IsNull() == false
|
||||
&& G2.IsNull() == false)
|
||||
if (!aShape1.IsNull() && !G1.IsNull() && !aShape2.IsNull() && !G2.IsNull())
|
||||
if (aShape1->Get() == G1->Get() && aShape2->Get() == G2->Get())
|
||||
return;
|
||||
}
|
||||
@@ -116,8 +115,8 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type,
|
||||
occ::handle<TNaming_NamedShape> aShape1 = occ::down_cast<TNaming_NamedShape>(myGeometries[0]);
|
||||
occ::handle<TNaming_NamedShape> aShape2 = occ::down_cast<TNaming_NamedShape>(myGeometries[1]);
|
||||
occ::handle<TNaming_NamedShape> aShape3 = occ::down_cast<TNaming_NamedShape>(myGeometries[2]);
|
||||
if (aShape1.IsNull() == false && G1.IsNull() == false && aShape2.IsNull() == false
|
||||
&& G2.IsNull() == false && aShape3.IsNull() == false && G3.IsNull() == false)
|
||||
if (!aShape1.IsNull() && !G1.IsNull() && !aShape2.IsNull() && !G2.IsNull() && !aShape3.IsNull()
|
||||
&& !G3.IsNull())
|
||||
if (aShape1->Get() == G1->Get() && aShape2->Get() == G2->Get() && aShape3->Get() == G3->Get())
|
||||
return;
|
||||
}
|
||||
@@ -144,9 +143,8 @@ void TDataXtd_Constraint::Set(const TDataXtd_ConstraintEnum type,
|
||||
occ::handle<TNaming_NamedShape> aShape2 = occ::down_cast<TNaming_NamedShape>(myGeometries[1]);
|
||||
occ::handle<TNaming_NamedShape> aShape3 = occ::down_cast<TNaming_NamedShape>(myGeometries[2]);
|
||||
occ::handle<TNaming_NamedShape> aShape4 = occ::down_cast<TNaming_NamedShape>(myGeometries[3]);
|
||||
if (aShape1.IsNull() == false && G1.IsNull() == false && aShape2.IsNull() == false
|
||||
&& G2.IsNull() == false && aShape3.IsNull() == false && G3.IsNull() == false
|
||||
&& aShape4.IsNull() == false && G4.IsNull() == false)
|
||||
if (!aShape1.IsNull() && !G1.IsNull() && !aShape2.IsNull() && !G2.IsNull() && !aShape3.IsNull()
|
||||
&& !G3.IsNull() && !aShape4.IsNull() && !G4.IsNull())
|
||||
if (aShape1->Get() == G1->Get() && aShape2->Get() == G2->Get() && aShape3->Get() == G3->Get()
|
||||
&& aShape3->Get() == G4->Get())
|
||||
return;
|
||||
@@ -221,7 +219,7 @@ void TDataXtd_Constraint::SetGeometry(const int Index, const occ::handle<TNaming
|
||||
// OCC2932 correction
|
||||
occ::handle<TNaming_NamedShape> aGeom =
|
||||
occ::down_cast<TNaming_NamedShape>(myGeometries[Index - 1]);
|
||||
if (aGeom.IsNull() == false && G.IsNull() == false)
|
||||
if (!aGeom.IsNull() && !G.IsNull())
|
||||
if (aGeom->Get() == G->Get())
|
||||
return;
|
||||
|
||||
@@ -267,7 +265,7 @@ bool TDataXtd_Constraint::IsPlanar() const
|
||||
void TDataXtd_Constraint::SetValue(const occ::handle<TDataStd_Real>& V)
|
||||
{
|
||||
// OCC2932 correction
|
||||
if (myValue.IsNull() == false && V.IsNull() == false)
|
||||
if (!myValue.IsNull() && !V.IsNull())
|
||||
if (myValue->Get() == V->Get())
|
||||
return;
|
||||
|
||||
|
||||
@@ -262,13 +262,7 @@ bool IsImported(const occ::handle<TNaming_NamedShape>& NS)
|
||||
if (!it.More())
|
||||
return false;
|
||||
it.Next();
|
||||
if (!it.More())
|
||||
return false;
|
||||
// plus d un shape.
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "WARNING IMPORTED" << std::endl;
|
||||
#endif
|
||||
return true;
|
||||
return it.More();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -119,11 +119,7 @@ TDF_Label TNaming_Node::Label()
|
||||
|
||||
bool TNaming_Node::IsValidInTrans(int Trans)
|
||||
{
|
||||
if (myAtt->Transaction() <= Trans && Trans <= myAtt->UntilTransaction())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return myAtt->Transaction() <= Trans && Trans <= myAtt->UntilTransaction();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -1410,7 +1406,7 @@ TDF_Label TNaming_Tool::Label(const occ::handle<TNaming_UsedShapes>& Shapes,
|
||||
TNaming_RefShape* prs = Shapes->Map().Find(S);
|
||||
TNaming_Node* pdn = prs->FirstUse();
|
||||
|
||||
while (pdn != nullptr && !(pdn->myNew == prs && pdn->myAtt->Evolution() != TNaming_SELECTED))
|
||||
while (pdn != nullptr && (pdn->myNew != prs || pdn->myAtt->Evolution() == TNaming_SELECTED))
|
||||
{
|
||||
pdn = pdn->NextSameShape(prs);
|
||||
}
|
||||
|
||||
@@ -677,12 +677,10 @@ static bool IsMultipleCase(
|
||||
if (isCommon)
|
||||
break; // common single face found
|
||||
}
|
||||
if (isCommon && aM.Extent() < aNbs.Extent())
|
||||
{ // number of unique faces (to have single solution)
|
||||
// should be at least no less than (Nb of Neighbourgs) +1
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
// number of unique faces (to have single solution)
|
||||
// should be at least no less than (Nb of Neighbourgs) +1
|
||||
return isCommon && aM.Extent() < aNbs.Extent();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -963,12 +961,7 @@ static bool Filter(const TDF_Label& F,
|
||||
//-----------------
|
||||
// Check du filtre.
|
||||
//-----------------
|
||||
if (Compare(NS, MDF, Stop, S))
|
||||
return true;
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "TNaming_Naming::Name Filter insufficient" << std::endl;
|
||||
#endif
|
||||
return false;
|
||||
return Compare(NS, MDF, Stop, S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1365,10 +1358,7 @@ static bool HasAncFace(const TopoDS_Shape& Context,
|
||||
TopoDS_Wire anOuterW;
|
||||
if (TNaming::OuterWire(aFace, anOuterW))
|
||||
{
|
||||
if (!anOuterW.IsNull() && anOuterW.IsEqual(W))
|
||||
isOuter = true;
|
||||
else
|
||||
isOuter = false;
|
||||
isOuter = !anOuterW.IsNull() && anOuterW.IsEqual(W);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1621,10 +1611,7 @@ static bool HasAncSolid(const TopoDS_Shape& Context,
|
||||
#ifdef OCCT_DEBUG_TSOL
|
||||
Write(anOuterShell, "OuterShell.brep");
|
||||
#endif
|
||||
if (!anOuterShell.IsNull() && anOuterShell.IsEqual(Sh))
|
||||
isOuter = true;
|
||||
else
|
||||
isOuter = false;
|
||||
isOuter = !anOuterShell.IsNull() && anOuterShell.IsEqual(Sh);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ bool LDOMParser::ParseDocument(std::istream& theIStream, const bool theWithoutRo
|
||||
case LDOM_XmlReader::XML_COMMENT:
|
||||
continue;
|
||||
case LDOM_XmlReader::XML_FULL_ELEMENT:
|
||||
if (isElement == false)
|
||||
if (!isElement)
|
||||
{
|
||||
isElement = true;
|
||||
myDocument->myRootElement = &myReader->GetElement();
|
||||
@@ -235,7 +235,7 @@ bool LDOMParser::ParseDocument(std::istream& theIStream, const bool theWithoutRo
|
||||
myError = "Expected comment or end-of-file";
|
||||
break;
|
||||
case LDOM_XmlReader::XML_START_ELEMENT:
|
||||
if (isElement == false)
|
||||
if (!isElement)
|
||||
{
|
||||
isElement = true;
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ const LDOM_BasicAttribute* LDOM_BasicElement::GetFirstAttribute(
|
||||
{
|
||||
if (aFirstAttr->getNodeType() == LDOM_Node::ATTRIBUTE_NODE)
|
||||
break;
|
||||
if (aFirstAttr->isNull() == false)
|
||||
if (!aFirstAttr->isNull())
|
||||
theLastCh = aFirstAttr;
|
||||
aPrevNode = (const LDOM_BasicNode**)&(aFirstAttr->mySibling);
|
||||
aFirstAttr = aFirstAttr->mySibling;
|
||||
|
||||
@@ -197,7 +197,7 @@ char* LDOM_CharReference::Encode(const char* theSrc, int& theLen, const bool isA
|
||||
ptrDest += 6;
|
||||
}
|
||||
else // predefined entity reference
|
||||
if (isAttribute == false && aCode == ENTI_QUOT)
|
||||
if (!isAttribute && aCode == ENTI_QUOT)
|
||||
*ptrDest++ = *ptrSrc;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ LDOM_Attr LDOM_Element::getAttributeNode(const LDOMString& aName) const
|
||||
LDOM_NodeList LDOM_Element::getElementsByTagName(const LDOMString& theTagName) const
|
||||
{
|
||||
LDOM_NodeList aList(myDocument);
|
||||
if (isNull() == false)
|
||||
if (!isNull())
|
||||
{
|
||||
const LDOM_BasicElement& anElem = (const LDOM_BasicElement&)Origin();
|
||||
// if (anElem.GetTagName().equals(theTagName))
|
||||
|
||||
@@ -101,7 +101,7 @@ bool LDOM_NodeList::operator==(const LDOM_NullPtr*) const
|
||||
|
||||
bool LDOM_NodeList::operator!=(const LDOM_NullPtr*) const
|
||||
{
|
||||
return !(myDoc.IsNull() || mySeq->Length() == 0);
|
||||
return !myDoc.IsNull() && mySeq->Length() != 0;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -43,10 +43,8 @@ LDOM_SBuffer::LDOM_SBuffer(const int theMaxBuf)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
LDOM_SBuffer::~LDOM_SBuffer()
|
||||
{
|
||||
// no destruction is required as IncAllocator is used
|
||||
}
|
||||
// no destruction is required as IncAllocator is used
|
||||
LDOM_SBuffer::~LDOM_SBuffer() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre
|
||||
int aBytesRest = (int)(myEndPtr - myPtr);
|
||||
if (aBytesRest < XML_MIN_BUFFER)
|
||||
{
|
||||
if (myEOF == true)
|
||||
if (myEOF)
|
||||
{
|
||||
if (aBytesRest <= 0)
|
||||
break; // END of processing
|
||||
@@ -329,7 +329,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre
|
||||
myError += TCollection_AsciiString(myPtr, XML_MIN_BUFFER);
|
||||
return XML_UNKNOWN;
|
||||
case '\0':
|
||||
if (myEOF == true)
|
||||
if (myEOF)
|
||||
continue;
|
||||
[[fallthrough]];
|
||||
default:
|
||||
@@ -481,7 +481,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre
|
||||
// Checking the characters in STATE_ELEMENT, seek the end of TagName
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
case STATE_ELEMENT:
|
||||
if (::isName(myPtr, myEndPtr, aNameEnd) == false)
|
||||
if (!::isName(myPtr, myEndPtr, aNameEnd))
|
||||
if (theData.Length() == 0 || aNameEnd != myPtr)
|
||||
{
|
||||
myError = "Invalid tag name";
|
||||
@@ -540,7 +540,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord(Standard_IStream& theIStre
|
||||
#endif
|
||||
return XML_START_ELEMENT;
|
||||
default:
|
||||
if (::isName(myPtr, myEndPtr, aNameEnd) == false)
|
||||
if (!::isName(myPtr, myEndPtr, aNameEnd))
|
||||
if (theData.Length() == 0 || aNameEnd != myPtr)
|
||||
{
|
||||
myError = "Invalid attribute name";
|
||||
|
||||
@@ -91,7 +91,7 @@ bool PCDM_ReaderFilter::IsSubPassed(const TCollection_AsciiString& theEntry) con
|
||||
|
||||
bool PCDM_ReaderFilter::IsPartTree()
|
||||
{
|
||||
return !(mySubTrees.IsEmpty() || (mySubTrees.Size() == 1 && mySubTrees.First().Length() < 3));
|
||||
return !mySubTrees.IsEmpty() && (mySubTrees.Size() != 1 || mySubTrees.First().Length() >= 3);
|
||||
}
|
||||
|
||||
void PCDM_ReaderFilter::StartIteration()
|
||||
|
||||
@@ -128,10 +128,7 @@ bool TDF_CopyLabel::ExternalReferences(const TDF_Label&
|
||||
{
|
||||
ExternalReferences(L, itr.Value(), aExternals, aFilter, ds);
|
||||
}
|
||||
if (!aExternals.Extent())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
return aExternals.Extent() != 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
@@ -363,9 +363,7 @@ occ::handle<TDataStd_TreeNode> TDataStd_TreeNode::Father() const
|
||||
|
||||
bool TDataStd_TreeNode::IsRoot() const
|
||||
{
|
||||
if (myFather == nullptr && myPrevious == nullptr && myNext == nullptr)
|
||||
return true;
|
||||
return false;
|
||||
return myFather == nullptr && myPrevious == nullptr && myNext == nullptr;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
@@ -108,7 +108,7 @@ void TDocStd_Application::ReadingFormats(NCollection_Sequence<TCollection_AsciiS
|
||||
for (; anIter.More(); anIter.Next())
|
||||
{
|
||||
const occ::handle<PCDM_RetrievalDriver>& aDriver = anIter.Value();
|
||||
if (aDriver.IsNull() == false)
|
||||
if (!aDriver.IsNull())
|
||||
{
|
||||
theFormats.Append(anIter.Key());
|
||||
}
|
||||
@@ -126,7 +126,7 @@ void TDocStd_Application::WritingFormats(NCollection_Sequence<TCollection_AsciiS
|
||||
for (; anIter.More(); anIter.Next())
|
||||
{
|
||||
const occ::handle<PCDM_StorageDriver>& aDriver = anIter.Value();
|
||||
if (aDriver.IsNull() == false)
|
||||
if (!aDriver.IsNull())
|
||||
{
|
||||
theFormats.Append(anIter.Key());
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ bool TDocStd_Document::CommitTransaction()
|
||||
// deny modifications if the transaction is not opened
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -321,7 +321,7 @@ bool TDocStd_Document::CommitTransaction()
|
||||
// deny or allow modifications according to transaction state
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
}
|
||||
// Notify CDM_Application of the successful commit
|
||||
@@ -356,7 +356,7 @@ void TDocStd_Document::AbortTransaction()
|
||||
// deny or allow modifications according to transaction state
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
// Notify CDM_Application of the event
|
||||
if (IsOpened())
|
||||
@@ -399,7 +399,7 @@ void TDocStd_Document::OpenTransaction()
|
||||
// deny or allow modifications according to transaction state
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
// Notify CDM_Application of the event
|
||||
if (IsOpened())
|
||||
@@ -431,7 +431,7 @@ void TDocStd_Document::SetUndoLimit(const int L)
|
||||
// deny or allow modifications according to transaction state
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
// OpenTransaction(); dp 15/10/99
|
||||
}
|
||||
@@ -528,7 +528,7 @@ bool TDocStd_Document::Undo()
|
||||
// deny or allow modifications according to transaction state
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
|
||||
return undoDone;
|
||||
@@ -585,7 +585,7 @@ bool TDocStd_Document::Redo()
|
||||
// deny or allow modifications according to transaction state
|
||||
if (myOnlyTransactionModification)
|
||||
{
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit ? true : false);
|
||||
myData->AllowModification(myUndoTransaction.IsOpen() && myUndoLimit);
|
||||
}
|
||||
|
||||
return undoDone;
|
||||
|
||||
@@ -33,7 +33,7 @@ void TDocStd_PathParser::Parse()
|
||||
else
|
||||
return;
|
||||
temp.Trunc(PointPosition - 1);
|
||||
bool isFileName = (temp.Length()) ? true : false;
|
||||
bool isFileName = (temp.Length()) != 0;
|
||||
bool isTrek = true;
|
||||
#ifdef _WIN32
|
||||
PointPosition = temp.SearchFromEnd(TCollection_ExtendedString("\\"));
|
||||
|
||||
@@ -79,7 +79,7 @@ bool TObj_Application::SaveDocument(const occ::handle<TDocStd_Document>& theSour
|
||||
|
||||
// Release free memory
|
||||
Standard::Purge();
|
||||
return myIsError ? false : true;
|
||||
return !myIsError;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -97,7 +97,7 @@ bool TObj_Application::SaveDocument(const occ::handle<TDocStd_Document>& theSour
|
||||
|
||||
// Release free memory
|
||||
Standard::Purge();
|
||||
return myIsError ? false : true;
|
||||
return !myIsError;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -128,7 +128,7 @@ bool TObj_Application::LoadDocument(const TCollection_ExtendedString& theSourceF
|
||||
|
||||
// Release free memory
|
||||
Standard::Purge();
|
||||
return myIsError ? false : true;
|
||||
return !myIsError;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -159,7 +159,7 @@ bool TObj_Application::LoadDocument(Standard_IStream& theIStream,
|
||||
|
||||
// Release free memory
|
||||
Standard::Purge();
|
||||
return myIsError ? false : true;
|
||||
return !myIsError;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -172,7 +172,7 @@ bool TObj_Application::CreateNewDocument(occ::handle<TDocStd_Document>& theDo
|
||||
// Create the Document
|
||||
NewDocument(theFormat, theDoc);
|
||||
|
||||
return myIsError ? false : true;
|
||||
return !myIsError;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -110,7 +110,7 @@ bool TObj_Model::Load(const TCollection_ExtendedString& theFile)
|
||||
// theFile is empty, create new TDocStd_Document for this model
|
||||
aStatus = anApplication->CreateNewDocument(aDoc, GetFormat());
|
||||
|
||||
if (aStatus == true)
|
||||
if (aStatus)
|
||||
{
|
||||
// Put model in a new attribute on root label
|
||||
TDF_Label aLabel = aDoc->Main();
|
||||
@@ -127,7 +127,7 @@ bool TObj_Model::Load(const TCollection_ExtendedString& theFile)
|
||||
Messenger()->Send(Message_Msg("TObj_M_LoadDocument") << theFile, Message_Info);
|
||||
aStatus = anApplication->LoadDocument(theFile, aDoc);
|
||||
|
||||
if (aStatus == true)
|
||||
if (aStatus)
|
||||
{
|
||||
// Check for validity of the model read:
|
||||
// if it had wrong type, it has not been not properly restored
|
||||
@@ -162,7 +162,7 @@ bool TObj_Model::Load(const TCollection_ExtendedString& theFile)
|
||||
}
|
||||
}
|
||||
// initialise the new model
|
||||
if (aStatus == true)
|
||||
if (aStatus)
|
||||
{
|
||||
bool isInitOk = false;
|
||||
{
|
||||
|
||||
@@ -398,9 +398,7 @@ void TObj_Object::ClearBackReferences()
|
||||
bool TObj_Object::HasBackReferences() const
|
||||
{
|
||||
occ::handle<TObj_ObjectIterator> anItr = GetBackReferences();
|
||||
if (anItr.IsNull() || !anItr->More())
|
||||
return false;
|
||||
return true;
|
||||
return !anItr.IsNull() && anItr->More();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -793,7 +791,7 @@ TDF_Label TObj_Object::addReference(const int theRank1, const occ::handle<TObj_O
|
||||
aRefLabel = aRefLabel.FindChild(theRank1, true);
|
||||
|
||||
TDF_TagSource aTag;
|
||||
TDF_Label aLabel = aTag.NewChild(aRefLabel);
|
||||
TDF_Label aLabel = TDF_TagSource::NewChild(aRefLabel);
|
||||
|
||||
occ::handle<TObj_Object> me = this;
|
||||
TObj_TReference::Set(aLabel, theObject, me);
|
||||
@@ -1212,10 +1210,7 @@ bool TObj_Object::IsAlive() const
|
||||
return false;
|
||||
|
||||
occ::handle<TObj_Object> anObj;
|
||||
if (!GetObj(myLabel, anObj))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return GetObj(myLabel, anObj);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -47,7 +47,7 @@ TDF_Label TObj_Partition::NewLabel() const
|
||||
{
|
||||
TDF_Label aLabel;
|
||||
TDF_TagSource aTag;
|
||||
aLabel = aTag.NewChild(GetChildLabel());
|
||||
aLabel = TDF_TagSource::NewChild(GetChildLabel());
|
||||
return aLabel;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ bool TObj_Partition::copyData(const occ::handle<TObj_Object>& theTargetObject)
|
||||
{
|
||||
bool IsDone;
|
||||
occ::handle<TObj_Partition> aTargetPartition = occ::down_cast<TObj_Partition>(theTargetObject);
|
||||
IsDone = aTargetPartition.IsNull() ? false : true;
|
||||
IsDone = !aTargetPartition.IsNull();
|
||||
if (IsDone)
|
||||
{
|
||||
IsDone = TObj_Object::copyData(theTargetObject);
|
||||
|
||||
@@ -1108,13 +1108,8 @@ void TPrsStd_ConstraintTools::ComputeAngle(const occ::handle<TDataXtd_Constraint
|
||||
occ::handle<PrsDim_AngleDimension> ais;
|
||||
if (!anAIS.IsNull())
|
||||
{
|
||||
ais = occ::down_cast<PrsDim_AngleDimension>(anAIS);
|
||||
if (ais.IsNull())
|
||||
{
|
||||
toCreate = true;
|
||||
}
|
||||
else
|
||||
toCreate = false;
|
||||
ais = occ::down_cast<PrsDim_AngleDimension>(anAIS);
|
||||
toCreate = ais.IsNull();
|
||||
}
|
||||
|
||||
int ExtShape(0);
|
||||
|
||||
@@ -66,6 +66,6 @@ void XmlDrivers_DocumentRetrievalDriver::ShapeSetCleaning(
|
||||
{
|
||||
occ::handle<XmlMNaming_NamedShapeDriver> aNamedShapeDriver =
|
||||
occ::down_cast<XmlMNaming_NamedShapeDriver>(theDriver);
|
||||
if (aNamedShapeDriver.IsNull() == false)
|
||||
if (!aNamedShapeDriver.IsNull())
|
||||
aNamedShapeDriver->Clear();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ bool XmlMDataXtd_GeometryDriver::Paste(const XmlObjMgt_Persistent& theSour
|
||||
|
||||
XmlObjMgt_DOMString aType = theSource.Element().getAttribute(::TypeString());
|
||||
TDataXtd_GeometryEnum aTypeEnum;
|
||||
if (GeometryTypeEnum(aType, aTypeEnum) == false)
|
||||
if (!GeometryTypeEnum(aType, aTypeEnum))
|
||||
{
|
||||
myMessageDriver->Send("TDataXtd_GeometryEnum; "
|
||||
"string value without enum term equivalence",
|
||||
|
||||
@@ -258,7 +258,7 @@ static const XmlObjMgt_DOMString& EvolutionString(const TNaming_Evolution i)
|
||||
static TNaming_Evolution EvolutionEnum(const XmlObjMgt_DOMString& theString)
|
||||
{
|
||||
TNaming_Evolution aResult = TNaming_PRIMITIVE;
|
||||
if (theString.equals(::EvolPrimitiveString()) == false)
|
||||
if (!theString.equals(::EvolPrimitiveString()))
|
||||
{
|
||||
if (theString.equals(::EvolGeneratedString()))
|
||||
aResult = TNaming_GENERATED;
|
||||
|
||||
@@ -173,7 +173,7 @@ bool XmlMNaming_NamingDriver::Paste(const XmlObjMgt_Persistent& theSource,
|
||||
if (aDomEntry != nullptr)
|
||||
{
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aDomEntry, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aDomEntry, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve Entry from \"") + aDomEntry + '\"';
|
||||
|
||||
@@ -71,7 +71,7 @@ XmlMNaming_Shape1::XmlMNaming_Shape1(const XmlObjMgt_Element& theEl)
|
||||
"XmlMNaming_Shape1; orientation value without enum term equivalence");
|
||||
}
|
||||
const char* anIntPtr = (const char*)&aPtr[1];
|
||||
if (XmlObjMgt::GetInteger(anIntPtr, myTShapeID) == false)
|
||||
if (!XmlObjMgt::GetInteger(anIntPtr, myTShapeID))
|
||||
throw Standard_DomainError(
|
||||
"XmlMNaming_Shape1; tshape value cannot be initialised by integer");
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void XmlLDrivers_DocumentStorageDriver::Write(const occ::handle<CDM_Document>& t
|
||||
// Fill the document with data
|
||||
XmlObjMgt_Element anElement = aDOMDoc.getDocumentElement();
|
||||
|
||||
if (WriteToDomDocument(theDocument, anElement, theRange) == false)
|
||||
if (!WriteToDomDocument(theDocument, anElement, theRange))
|
||||
{
|
||||
|
||||
LDOM_XmlWriter aWriter;
|
||||
@@ -340,7 +340,7 @@ bool XmlLDrivers_DocumentStorageDriver::WriteToDomDocument(
|
||||
aMessageDriver->Send(anErrorString.ToExtString(), Message_Fail);
|
||||
}
|
||||
}
|
||||
if (anObjNb <= 0 && IsError() == false)
|
||||
if (anObjNb <= 0 && !IsError())
|
||||
{
|
||||
SetIsError(true);
|
||||
SetStoreStatus(PCDM_SS_No_Obj);
|
||||
|
||||
@@ -290,7 +290,7 @@ int XmlMDF::ReadSubTree(
|
||||
+ "failure reading attribute " + aName,
|
||||
Message_Warning);
|
||||
}
|
||||
else if (isBound == false)
|
||||
else if (!isBound)
|
||||
theRelocTable.Bind(anID, tAtt);
|
||||
}
|
||||
#ifdef OCCT_DEBUG
|
||||
|
||||
@@ -56,7 +56,7 @@ bool XmlMDF_ReferenceDriver::Paste(const XmlObjMgt_Persistent& theSource,
|
||||
}
|
||||
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(anXPath, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(anXPath, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + anXPath + '\"';
|
||||
|
||||
@@ -49,7 +49,7 @@ bool XmlMDF_TagSourceDriver::Paste(const XmlObjMgt_Persistent& theSource,
|
||||
int aTag;
|
||||
XmlObjMgt_DOMString aTagStr = XmlObjMgt::GetStringValue(theSource.Element());
|
||||
|
||||
if (aTagStr.GetInteger(aTag) == false)
|
||||
if (!aTagStr.GetInteger(aTag))
|
||||
{
|
||||
TCollection_ExtendedString aMessageString =
|
||||
TCollection_ExtendedString("Cannot retrieve TagSource attribute from \"") + aTagStr + "\"";
|
||||
|
||||
@@ -104,7 +104,7 @@ bool XmlMDataStd_BooleanListDriver::Paste(const XmlObjMgt_Persistent& theS
|
||||
myMessageDriver->Send(aMessageString, Message_Warning);
|
||||
aValue = 0;
|
||||
}
|
||||
aBooleanList->Append(aValue ? true : false);
|
||||
aBooleanList->Append(aValue != 0);
|
||||
}
|
||||
else if (aLastInd >= 1)
|
||||
{
|
||||
@@ -121,7 +121,7 @@ bool XmlMDataStd_BooleanListDriver::Paste(const XmlObjMgt_Persistent& theS
|
||||
myMessageDriver->Send(aMessageString, Message_Warning);
|
||||
aValue = 0;
|
||||
}
|
||||
aBooleanList->Append(aValue ? true : false);
|
||||
aBooleanList->Append(aValue != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ bool XmlMDataStd_IntegerDriver::Paste(const XmlObjMgt_Persistent& theSourc
|
||||
int aValue;
|
||||
XmlObjMgt_DOMString anIntStr = XmlObjMgt::GetStringValue(theSource);
|
||||
|
||||
if (anIntStr.GetInteger(aValue) == false)
|
||||
if (!anIntStr.GetInteger(aValue))
|
||||
{
|
||||
TCollection_ExtendedString aMessageString =
|
||||
TCollection_ExtendedString("Cannot retrieve Integer attribute from \"") + anIntStr + "\"";
|
||||
|
||||
@@ -63,7 +63,7 @@ bool XmlMDataStd_RealDriver::Paste(const XmlObjMgt_Persistent& theSource,
|
||||
double aValue(0.);
|
||||
const XmlObjMgt_DOMString& aRealStr = XmlObjMgt::GetStringValue(theSource);
|
||||
const char* aValueStr = static_cast<const char*>(aRealStr.GetString());
|
||||
if (XmlObjMgt::GetReal(aRealStr, aValue) == false)
|
||||
if (!XmlObjMgt::GetReal(aRealStr, aValue))
|
||||
{
|
||||
TCollection_ExtendedString aMessageString =
|
||||
TCollection_ExtendedString("Cannot retrieve Real attribute from \"") + aValueStr + "\"";
|
||||
|
||||
@@ -117,7 +117,7 @@ bool XmlMDataStd_ReferenceArrayDriver::Paste(const XmlObjMgt_Persistent& t
|
||||
else
|
||||
{
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"';
|
||||
@@ -145,7 +145,7 @@ bool XmlMDataStd_ReferenceArrayDriver::Paste(const XmlObjMgt_Persistent& t
|
||||
else
|
||||
{
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"';
|
||||
|
||||
@@ -115,7 +115,7 @@ bool XmlMDataStd_ReferenceListDriver::Paste(const XmlObjMgt_Persistent& th
|
||||
return false;
|
||||
}
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"';
|
||||
@@ -140,7 +140,7 @@ bool XmlMDataStd_ReferenceListDriver::Paste(const XmlObjMgt_Persistent& th
|
||||
return false;
|
||||
}
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"';
|
||||
|
||||
@@ -56,7 +56,7 @@ bool XmlMDocStd_XLinkDriver::Paste(const XmlObjMgt_Persistent& theSource,
|
||||
}
|
||||
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(anXPath, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(anXPath, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve XLink reference from \"") + anXPath + '\"';
|
||||
|
||||
@@ -146,7 +146,7 @@ bool XmlMFunction_ScopeDriver::Paste(const XmlObjMgt_Persistent& theSource
|
||||
continue;
|
||||
}
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"';
|
||||
@@ -172,7 +172,7 @@ bool XmlMFunction_ScopeDriver::Paste(const XmlObjMgt_Persistent& theSource
|
||||
return false;
|
||||
}
|
||||
TCollection_AsciiString anEntry;
|
||||
if (XmlObjMgt::GetTagEntryString(aValueStr, anEntry) == false)
|
||||
if (!XmlObjMgt::GetTagEntryString(aValueStr, anEntry))
|
||||
{
|
||||
TCollection_ExtendedString aMessage =
|
||||
TCollection_ExtendedString("Cannot retrieve reference from \"") + aValueStr + '\"';
|
||||
|
||||
@@ -23,7 +23,6 @@ BinMXCAFDoc_VisMaterialToolDriver::BinMXCAFDoc_VisMaterialToolDriver(
|
||||
const occ::handle<Message_Messenger>& theMsgDriver)
|
||||
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_VisMaterialTool)->Name())
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -49,5 +48,4 @@ void BinMXCAFDoc_VisMaterialToolDriver::Paste(
|
||||
BinObjMgt_Persistent&,
|
||||
NCollection_IndexedMap<occ::handle<Standard_Transient>>&) const
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -177,10 +177,6 @@ bool DEBREP_ConfigurationNode::CheckContent(const occ::handle<NCollection_Buffer
|
||||
return false;
|
||||
}
|
||||
const char* aBytes = (const char*)theBuffer->Data();
|
||||
if (::strstr(aBytes, "DBRep_DrawableShape") || ::strstr(aBytes, "CASCADE Topology V1")
|
||||
|| ::strstr(aBytes, "CASCADE Topology V3"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return ::strstr(aBytes, "DBRep_DrawableShape") || ::strstr(aBytes, "CASCADE Topology V1")
|
||||
|| ::strstr(aBytes, "CASCADE Topology V3");
|
||||
}
|
||||
|
||||
@@ -174,9 +174,5 @@ bool DEXCAF_ConfigurationNode::CheckContent(const occ::handle<NCollection_Buffer
|
||||
return false;
|
||||
}
|
||||
const char* aBytes = (const char*)theBuffer->Data();
|
||||
if (!::strncmp(aBytes, "BINFILE", 7))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return ::strncmp(aBytes, "BINFILE", 7) == 0;
|
||||
}
|
||||
|
||||
@@ -2282,7 +2282,7 @@ bool RWGltf_GltfJsonParser::gltfParseBuffer(
|
||||
const RWGltf_JsonValue* anUriVal = findObjectMember(theBuffer, "uri");
|
||||
|
||||
int64_t anOffset = theView.ByteOffset + theAccessor.ByteOffset;
|
||||
const int32_t aByteStride = theAccessor.ByteStride != 0 ? theView.ByteStride : theView.ByteStride;
|
||||
const int32_t aByteStride = theView.ByteStride;
|
||||
bool isBinary = false;
|
||||
if (myIsBinary)
|
||||
{
|
||||
@@ -2566,11 +2566,7 @@ bool RWGltf_GltfJsonParser::Parse(const Message_ProgressRange& theProgress)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!aPS.More())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return aPS.More();
|
||||
#else
|
||||
Message::SendFail("Error: glTF reader is unavailable - OCCT has been built without RapidJSON "
|
||||
"support [HAVE_RAPIDJSON undefined]");
|
||||
|
||||
@@ -33,10 +33,7 @@ RWGltf_GltfLatePrimitiveArray::RWGltf_GltfLatePrimitiveArray(const TCollection_A
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWGltf_GltfLatePrimitiveArray::~RWGltf_GltfLatePrimitiveArray()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWGltf_GltfLatePrimitiveArray::~RWGltf_GltfLatePrimitiveArray() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -70,8 +67,9 @@ RWGltf_GltfPrimArrayData& RWGltf_GltfLatePrimitiveArray::AddPrimArrayData(
|
||||
// make sure indexes go after vertex positions but before any other vertex attributes
|
||||
if (myData.First().Type == RWGltf_GltfArrayType_Position)
|
||||
{
|
||||
myData.InsertAfter(myData.Lower(), RWGltf_GltfPrimArrayData(theType));
|
||||
return myData.ChangeValue(myData.Lower() + 1);
|
||||
myData.InsertAfter(NCollection_Sequence<RWGltf_GltfPrimArrayData>::Lower(),
|
||||
RWGltf_GltfPrimArrayData(theType));
|
||||
return myData.ChangeValue(NCollection_Sequence<RWGltf_GltfPrimArrayData>::Lower() + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -58,10 +58,7 @@ RWGltf_GltfMaterialMap::RWGltf_GltfMaterialMap(const TCollection_AsciiString& th
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWGltf_GltfMaterialMap::~RWGltf_GltfMaterialMap()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWGltf_GltfMaterialMap::~RWGltf_GltfMaterialMap() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -102,10 +102,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWGltf_TriangulationReader, RWMesh_TriangulationReade
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWGltf_TriangulationReader::RWGltf_TriangulationReader()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWGltf_TriangulationReader::RWGltf_TriangulationReader() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -151,11 +148,11 @@ bool RWGltf_TriangulationReader::readStreamData(
|
||||
theGltfData.StreamData->Size());
|
||||
std::istream aStream(&aStreamBuffer);
|
||||
aStream.seekg((std::streamoff)theGltfData.StreamOffset, std::ios_base::beg);
|
||||
if (!readBuffer(theSourceGltfMesh, theDestMesh, aStream, theGltfData.Accessor, theGltfData.Type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return readBuffer(theSourceGltfMesh,
|
||||
theDestMesh,
|
||||
aStream,
|
||||
theGltfData.Accessor,
|
||||
theGltfData.Type);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -47,17 +47,17 @@ Quantity_Color IGESCAFControl::DecodeColor(const int color)
|
||||
int IGESCAFControl::EncodeColor(const Quantity_Color& col)
|
||||
{
|
||||
int code = 0;
|
||||
if (std::abs(col.Red() - 1.) <= col.Epsilon())
|
||||
if (std::abs(col.Red() - 1.) <= Quantity_Color::Epsilon())
|
||||
code |= 0x001;
|
||||
else if (std::abs(col.Red()) > col.Epsilon())
|
||||
else if (std::abs(col.Red()) > Quantity_Color::Epsilon())
|
||||
return 0;
|
||||
if (std::abs(col.Green() - 1.) <= col.Epsilon())
|
||||
if (std::abs(col.Green() - 1.) <= Quantity_Color::Epsilon())
|
||||
code |= 0x010;
|
||||
else if (std::abs(col.Green()) > col.Epsilon())
|
||||
else if (std::abs(col.Green()) > Quantity_Color::Epsilon())
|
||||
return 0;
|
||||
if (std::abs(col.Blue() - 1.) <= col.Epsilon())
|
||||
if (std::abs(col.Blue() - 1.) <= Quantity_Color::Epsilon())
|
||||
code |= 0x100;
|
||||
else if (std::abs(col.Blue()) > col.Epsilon())
|
||||
else if (std::abs(col.Blue()) > Quantity_Color::Epsilon())
|
||||
return 0;
|
||||
|
||||
switch (code)
|
||||
|
||||
@@ -328,7 +328,7 @@ void IGESCAFControl_Writer::MakeColors(
|
||||
else
|
||||
{
|
||||
occ::handle<TCollection_HAsciiString> str =
|
||||
new TCollection_HAsciiString(col.StringName(col.Name()));
|
||||
new TCollection_HAsciiString(Quantity_Color::StringName(col.Name()));
|
||||
colent = new IGESGraph_Color;
|
||||
NCollection_Vec3<double> aColor_sRGB;
|
||||
col.Values(aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
|
||||
|
||||
@@ -178,9 +178,7 @@ bool IGESConvGeom_GeomBuilder::IsZOnly() const
|
||||
return false;
|
||||
gp_XYZ t = thepos.TranslationPart();
|
||||
t.SetZ(0.0);
|
||||
if (!t.IsEqual(gp_XYZ(0., 0., 0.), epsl))
|
||||
return false;
|
||||
return true;
|
||||
return t.IsEqual(gp_XYZ(0., 0., 0.), epsl);
|
||||
}
|
||||
|
||||
void IGESConvGeom_GeomBuilder::EvalXYZ(const gp_XYZ& val, double& X, double& Y, double& Z) const
|
||||
|
||||
@@ -230,10 +230,10 @@ void IGESData::Init()
|
||||
occ::handle<TCollection_HAsciiString> datestr;
|
||||
if (year < 2000)
|
||||
// #65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000)
|
||||
datestr = GS.NewDateString(0, 0, 0, 0, 0, 0, 0);
|
||||
datestr = IGESData_GlobalSection::NewDateString(0, 0, 0, 0, 0, 0, 0);
|
||||
else
|
||||
// #65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000)
|
||||
datestr = GS.NewDateString(0, 0, 0, 0, 0, 0, -1);
|
||||
datestr = IGESData_GlobalSection::NewDateString(0, 0, 0, 0, 0, 0, -1);
|
||||
GS.SetSeparator(',');
|
||||
GS.SetEndMark(';');
|
||||
GS.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product")));
|
||||
|
||||
@@ -80,7 +80,6 @@ IGESData_GlobalSection::IGESData_GlobalSection()
|
||||
theIGESVersion(11), // IGES 5.3 by default
|
||||
theDraftingStandard(0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -282,8 +282,8 @@ void IGESDimen_ToolDimensionDisplayData::OwnCheck(
|
||||
ach->AddFail("Incorrect Dimension Type");
|
||||
if (ent->LabelPosition() < 0 || ent->LabelPosition() > 4)
|
||||
ach->AddFail("Incorrect Preferred Label Position");
|
||||
if (!(ent->CharacterSet() == 1 || ent->CharacterSet() == 1001 || ent->CharacterSet() == 1002
|
||||
|| ent->CharacterSet() == 1003))
|
||||
if (ent->CharacterSet() != 1 && ent->CharacterSet() != 1001 && ent->CharacterSet() != 1002
|
||||
&& ent->CharacterSet() != 1003)
|
||||
ach->AddFail("Incorrect Character Set");
|
||||
if (ent->DecimalSymbol() != 0 && ent->DecimalSymbol() != 1)
|
||||
ach->AddFail("Incorrect Decimal Symbol");
|
||||
|
||||
@@ -198,8 +198,8 @@ void IGESSolid_ToolEllipsoid::OwnCheck(const occ::handle<IGESSolid_Ellipsoid>& e
|
||||
double prosca = ent->XAxis().Dot(ent->ZAxis());
|
||||
if (prosca < -eps || prosca > eps)
|
||||
ach->AddFail("Local Z axis : Not orthogonal to X axis");
|
||||
if (!(ent->Size().X() >= ent->Size().Y() && ent->Size().Y() >= ent->Size().Z()
|
||||
&& ent->Size().Z() > 0))
|
||||
if (ent->Size().X() < ent->Size().Y() || ent->Size().Y() < ent->Size().Z()
|
||||
|| ent->Size().Z() <= 0)
|
||||
ach->AddFail("Size : The values does not satisfy LX >= LY >= LZ > 0");
|
||||
}
|
||||
|
||||
|
||||
@@ -123,13 +123,9 @@ bool IGESToBRep_Actor::Recognize(const occ::handle<Standard_Transient>& start)
|
||||
// Cas reconnus
|
||||
int typnum = ent->TypeNumber();
|
||||
int fornum = ent->FormNumber();
|
||||
if (IGESToBRep::IsCurveAndSurface(ent)
|
||||
|| ((typnum == 402 && (fornum == 1 || fornum == 7 || fornum == 14 || fornum == 15))
|
||||
|| (typnum == 408) || (typnum == 308)))
|
||||
return true;
|
||||
|
||||
// Cas restants : non reconnus
|
||||
return false;
|
||||
return IGESToBRep::IsCurveAndSurface(ent)
|
||||
|| ((typnum == 402 && (fornum == 1 || fornum == 7 || fornum == 14 || fornum == 15))
|
||||
|| (typnum == 408) || (typnum == 308));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
@@ -1429,7 +1429,7 @@ occ::handle<Geom_BSplineCurve> IGESToBRep_BasicCurve::TransferCopiousData(
|
||||
}
|
||||
|
||||
int FormNb = start->FormNumber();
|
||||
if (!(FormNb == 11 || FormNb == 12 || FormNb == 63))
|
||||
if (FormNb != 11 && FormNb != 12 && FormNb != 63)
|
||||
{
|
||||
Message_Msg msg1240("IGES_1240");
|
||||
SendWarning(start, msg1240);
|
||||
@@ -1539,7 +1539,7 @@ occ::handle<Geom2d_BSplineCurve> IGESToBRep_BasicCurve::Transfer2dCopiousData(
|
||||
}
|
||||
|
||||
int FormNb = start->FormNumber();
|
||||
if (!(FormNb == 11 || FormNb == 12 || FormNb == 63))
|
||||
if (FormNb != 11 && FormNb != 12 && FormNb != 63)
|
||||
{
|
||||
Message_Msg msg1240("IGES_1240");
|
||||
SendWarning(start, msg1240);
|
||||
|
||||
@@ -626,7 +626,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::TransferOffsetCurve(
|
||||
IGESToBRep_TopoCurve TC(*this);
|
||||
TopoDS_Shape Sh = TC.TransferTopoCurve(BaseCrv);
|
||||
|
||||
if (Sh.IsNull() || !((Sh.ShapeType() == TopAbs_EDGE) || (Sh.ShapeType() == TopAbs_WIRE)))
|
||||
if (Sh.IsNull() || ((Sh.ShapeType() != TopAbs_EDGE) && (Sh.ShapeType() != TopAbs_WIRE)))
|
||||
{
|
||||
Message_Msg Msg1156("IGES_1156");
|
||||
occ::handle<TCollection_HAsciiString> label = GetModel()->StringLabel(BaseCrv);
|
||||
@@ -767,7 +767,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::Transfer2dOffsetCurve(
|
||||
IGESToBRep_TopoCurve TC(*this);
|
||||
TC.SetModeTransfer(false);
|
||||
TopoDS_Shape Sh = TC.Transfer2dTopoCurve(BaseCrv, face, trans, uFact);
|
||||
if (Sh.IsNull() || !((Sh.ShapeType() == TopAbs_EDGE) || (Sh.ShapeType() == TopAbs_WIRE)))
|
||||
if (Sh.IsNull() || ((Sh.ShapeType() != TopAbs_EDGE) && (Sh.ShapeType() != TopAbs_WIRE)))
|
||||
{
|
||||
Message_Msg Msg1156("IGES_1156"); //"Edge or wire expected from TransferTopoCurve"
|
||||
occ::handle<TCollection_HAsciiString> label = GetModel()->StringLabel(BaseCrv);
|
||||
|
||||
@@ -67,10 +67,7 @@ RWObj_CafWriter::RWObj_CafWriter(const TCollection_AsciiString& theFile)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWObj_CafWriter::~RWObj_CafWriter()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWObj_CafWriter::~RWObj_CafWriter() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ RWObj_MtlReader::RWObj_MtlReader(
|
||||
myMaterials(&theMaterials),
|
||||
myNbLines(0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -24,7 +24,6 @@ RWObj_ObjMaterialMap::RWObj_ObjMaterialMap(const TCollection_AsciiString& theFil
|
||||
: RWMesh_MaterialMap(theFile),
|
||||
myFile(nullptr)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -75,7 +75,6 @@ RWObj_Reader::RWObj_Reader()
|
||||
myNbElemsBig(0),
|
||||
myToAbort(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -113,9 +112,9 @@ bool RWObj_Reader::read(std::istream& theStream,
|
||||
}
|
||||
|
||||
// determine length of file
|
||||
theStream.seekg(0, theStream.end);
|
||||
theStream.seekg(0, std::istream::end);
|
||||
const int64_t aFileLen = theStream.tellg();
|
||||
theStream.seekg(0, theStream.beg);
|
||||
theStream.seekg(0, std::istream::beg);
|
||||
if (aFileLen <= 0L)
|
||||
{
|
||||
Message::SendFail(TCollection_AsciiString("Error: file '") + theFile + "' is empty");
|
||||
|
||||
@@ -226,9 +226,5 @@ bool DEPLY_ConfigurationNode::CheckContent(const occ::handle<NCollection_Buffer>
|
||||
return false;
|
||||
}
|
||||
const char* aBytes = (const char*)theBuffer->Data();
|
||||
if (!::strncmp(aBytes, "ply", 3) && ::isspace(aBytes[3]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !::strncmp(aBytes, "ply", 3) && ::isspace(aBytes[3]);
|
||||
}
|
||||
|
||||
@@ -39,15 +39,11 @@ RWPly_CafWriter::RWPly_CafWriter(const TCollection_AsciiString& theFile)
|
||||
myHasPartId(true),
|
||||
myHasFaceId(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWPly_CafWriter::~RWPly_CafWriter()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWPly_CafWriter::~RWPly_CafWriter() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ RWPly_PlyWriterContext::RWPly_PlyWriterContext()
|
||||
myHasTexCoords(false),
|
||||
myHasSurfId(false)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -315,10 +315,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader(const occ::handle<XSControl_WorkSes
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
STEPCAFControl_Reader::~STEPCAFControl_Reader()
|
||||
{
|
||||
//
|
||||
}
|
||||
STEPCAFControl_Reader::~STEPCAFControl_Reader() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -1109,13 +1106,13 @@ static void SetAssemblyComponentStyle(
|
||||
Quantity_ColorRGBA aFullSCol;
|
||||
if (!aSurfCol.IsNull())
|
||||
{
|
||||
theStyles.DecodeColor(aSurfCol, aSCol);
|
||||
STEPConstruct_Styles::DecodeColor(aSurfCol, aSCol);
|
||||
aFullSCol = Quantity_ColorRGBA(aSCol);
|
||||
}
|
||||
if (!aBoundCol.IsNull())
|
||||
theStyles.DecodeColor(aBoundCol, aBCol);
|
||||
STEPConstruct_Styles::DecodeColor(aBoundCol, aBCol);
|
||||
if (!aCurveCol.IsNull())
|
||||
theStyles.DecodeColor(aCurveCol, aCCol);
|
||||
STEPConstruct_Styles::DecodeColor(aCurveCol, aCCol);
|
||||
if (aRenderProps.IsDefined())
|
||||
{
|
||||
aFullSCol = aRenderProps.GetRGBAColor();
|
||||
@@ -1278,13 +1275,13 @@ static void SetStyle(
|
||||
Quantity_ColorRGBA aFullSCol;
|
||||
if (!aSurfCol.IsNull())
|
||||
{
|
||||
theStyles.DecodeColor(aSurfCol, aSCol);
|
||||
STEPConstruct_Styles::DecodeColor(aSurfCol, aSCol);
|
||||
aFullSCol = Quantity_ColorRGBA(aSCol);
|
||||
}
|
||||
if (!aBoundCol.IsNull())
|
||||
theStyles.DecodeColor(aBoundCol, aBCol);
|
||||
STEPConstruct_Styles::DecodeColor(aBoundCol, aBCol);
|
||||
if (!aCurveCol.IsNull())
|
||||
theStyles.DecodeColor(aCurveCol, aCCol);
|
||||
STEPConstruct_Styles::DecodeColor(aCurveCol, aCCol);
|
||||
if (aRenderProps.IsDefined())
|
||||
{
|
||||
aFullSCol = aRenderProps.GetRGBAColor();
|
||||
@@ -2070,7 +2067,7 @@ bool STEPCAFControl_Reader::ReadSHUOs(
|
||||
Quantity_ColorRGBA colRGBA;
|
||||
if (!SurfCol.IsNull())
|
||||
{
|
||||
Styles.DecodeColor(SurfCol, col);
|
||||
STEPConstruct_Styles::DecodeColor(SurfCol, col);
|
||||
colRGBA = Quantity_ColorRGBA(col);
|
||||
}
|
||||
if (aRenderProps.IsDefined())
|
||||
@@ -2082,13 +2079,13 @@ bool STEPCAFControl_Reader::ReadSHUOs(
|
||||
if (!BoundCol.IsNull())
|
||||
{
|
||||
Quantity_Color col;
|
||||
Styles.DecodeColor(BoundCol, col);
|
||||
STEPConstruct_Styles::DecodeColor(BoundCol, col);
|
||||
CTool->SetColor(aLabelForStyle, col, XCAFDoc_ColorCurv);
|
||||
}
|
||||
if (!CurveCol.IsNull())
|
||||
{
|
||||
Quantity_Color col;
|
||||
Styles.DecodeColor(CurveCol, col);
|
||||
STEPConstruct_Styles::DecodeColor(CurveCol, col);
|
||||
CTool->SetColor(aLabelForStyle, col, XCAFDoc_ColorCurv);
|
||||
}
|
||||
if (!IsVisible)
|
||||
@@ -3571,7 +3568,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(
|
||||
{
|
||||
// get representation items
|
||||
NCollection_Sequence<occ::handle<Standard_Transient>> aSeqRI;
|
||||
for (int i = aSAs.Lower(); i <= aSAs.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<opencascade::handle<StepRepr_ShapeAspect>>::Lower();
|
||||
i <= aSAs.Upper();
|
||||
i++)
|
||||
{
|
||||
Interface_EntityIterator anIterSA = aGraph.Sharings(aSAs.Value(i));
|
||||
occ::handle<StepAP242_GeometricItemSpecificUsage> aGISU;
|
||||
@@ -3862,7 +3861,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(
|
||||
NCollection_Sequence<TDF_Label> aShLS1, aShLS2;
|
||||
|
||||
// Collect shapes
|
||||
for (int i = aSeqRI1.Lower(); i <= aSeqRI1.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<opencascade::handle<Standard_Transient>>::Lower();
|
||||
i <= aSeqRI1.Upper();
|
||||
i++)
|
||||
{
|
||||
int anIndex = FindShapeIndexForDGT(aSeqRI1.Value(i), theWS);
|
||||
TopoDS_Shape aSh;
|
||||
@@ -3894,7 +3895,9 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(
|
||||
if (!aSeqRI2.IsEmpty())
|
||||
{
|
||||
// for dimensional location
|
||||
for (int i = aSeqRI2.Lower(); i <= aSeqRI2.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<opencascade::handle<Standard_Transient>>::Lower();
|
||||
i <= aSeqRI2.Upper();
|
||||
i++)
|
||||
{
|
||||
int anIndex = FindShapeIndexForDGT(aSeqRI2.Value(i), theWS);
|
||||
TopoDS_Shape aSh;
|
||||
|
||||
@@ -1242,10 +1242,10 @@ static void MakeSTEPStyles(
|
||||
{
|
||||
Quantity_ColorRGBA aSurfCol = aStyle.GetColorSurfRGBA();
|
||||
aRenderTransp = 1.0 - aSurfCol.Alpha();
|
||||
aSurfColor = theStyles.EncodeColor(aSurfCol.GetRGB(), theDPDCs, theColRGBs);
|
||||
aSurfColor = STEPConstruct_Styles::EncodeColor(aSurfCol.GetRGB(), theDPDCs, theColRGBs);
|
||||
}
|
||||
if (aStyle.IsSetColorCurv())
|
||||
aCurvColor = theStyles.EncodeColor(aStyle.GetColorCurv(), theDPDCs, theColRGBs);
|
||||
aCurvColor = STEPConstruct_Styles::EncodeColor(aStyle.GetColorCurv(), theDPDCs, theColRGBs);
|
||||
|
||||
bool aHasOwn = (!aSurfColor.IsNull() || !aCurvColor.IsNull() || !aStyle.IsVisible());
|
||||
|
||||
@@ -1290,9 +1290,10 @@ static void MakeSTEPStyles(
|
||||
else
|
||||
{
|
||||
// default white color
|
||||
aSurfColor =
|
||||
theStyles.EncodeColor(Quantity_Color(Quantity_NOC_WHITE), theDPDCs, theColRGBs);
|
||||
aPSA = theStyles.MakeColorPSA(anItem,
|
||||
aSurfColor = STEPConstruct_Styles::EncodeColor(Quantity_Color(Quantity_NOC_WHITE),
|
||||
theDPDCs,
|
||||
theColRGBs);
|
||||
aPSA = theStyles.MakeColorPSA(anItem,
|
||||
aSurfColor,
|
||||
aCurvColor,
|
||||
STEPConstruct_RenderingProperties(),
|
||||
@@ -2260,17 +2261,17 @@ static bool createSHUOStyledItem(
|
||||
{
|
||||
Quantity_ColorRGBA aSurfCol = theStyle.GetColorSurfRGBA();
|
||||
aRenderTransp = 1.0 - aSurfCol.Alpha();
|
||||
aSurfColor = aStyles.EncodeColor(aSurfCol.GetRGB());
|
||||
aSurfColor = STEPConstruct_Styles::EncodeColor(aSurfCol.GetRGB());
|
||||
}
|
||||
if (theStyle.IsSetColorCurv())
|
||||
aCurvColor = aStyles.EncodeColor(theStyle.GetColorCurv());
|
||||
aCurvColor = STEPConstruct_Styles::EncodeColor(theStyle.GetColorCurv());
|
||||
bool isComponent = true; // cause need to get PSBC
|
||||
occ::handle<StepRepr_RepresentationItem> anItem;
|
||||
// set default color for invisible SHUO.
|
||||
bool isSetDefaultColor = false;
|
||||
if (aSurfColor.IsNull() && aCurvColor.IsNull() && !theStyle.IsVisible())
|
||||
{
|
||||
aSurfColor = aStyles.EncodeColor(Quantity_Color(Quantity_NOC_WHITE));
|
||||
aSurfColor = STEPConstruct_Styles::EncodeColor(Quantity_Color(Quantity_NOC_WHITE));
|
||||
isSetDefaultColor = true;
|
||||
}
|
||||
STEPConstruct_RenderingProperties aRenderProps;
|
||||
@@ -4553,9 +4554,9 @@ bool STEPCAFControl_Writer::writeDGTsAP242(const occ::handle<XSControl_WorkSessi
|
||||
Interface_Graph aGraph = aHGraph->Graph();
|
||||
|
||||
// Common entities for presentation
|
||||
STEPConstruct_Styles aStyles(theWS);
|
||||
occ::handle<StepVisual_Colour> aCurvColor = aStyles.EncodeColor(Quantity_NOC_WHITE);
|
||||
occ::handle<StepRepr_RepresentationItem> anItem = nullptr;
|
||||
STEPConstruct_Styles aStyles(theWS);
|
||||
occ::handle<StepVisual_Colour> aCurvColor = STEPConstruct_Styles::EncodeColor(Quantity_NOC_WHITE);
|
||||
occ::handle<StepRepr_RepresentationItem> anItem = nullptr;
|
||||
myGDTPrsCurveStyle->SetValue(
|
||||
1,
|
||||
aStyles.MakeColorPSA(anItem, aCurvColor, aCurvColor, STEPConstruct_RenderingProperties()));
|
||||
|
||||
@@ -300,9 +300,7 @@ bool STEPControl_ActorRead::Recognize(const occ::handle<Standard_Transient>& sta
|
||||
|
||||
// On prend son contenu
|
||||
|
||||
if (Recognize(und->Rep1()) || Recognize(und->Rep2()))
|
||||
return true;
|
||||
return false;
|
||||
return Recognize(und->Rep1()) || Recognize(und->Rep2());
|
||||
}
|
||||
|
||||
if (start->IsKind(STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation)))
|
||||
|
||||
@@ -377,8 +377,7 @@ int STEPControl_Reader::NbRootsForTransfer()
|
||||
continue;
|
||||
const char* str2 = PDC->LifeCycleStage()->String().ToCString();
|
||||
const char* str3 = PDC->Name()->String().ToCString();
|
||||
if (!(strcasecmp(str1.ToCString(), str2) == 0
|
||||
|| strcasecmp(str1.ToCString(), str3) == 0))
|
||||
if (strcasecmp(str1.ToCString(), str2) != 0 && strcasecmp(str1.ToCString(), str3) != 0)
|
||||
IsRoot = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ void STEPControl_Writer::InitializeMissingParameters()
|
||||
{
|
||||
SetShapeFixParameters(DESTEP_Parameters::GetDefaultShapeFixParameters());
|
||||
}
|
||||
if (GetShapeProcessFlags().second == false)
|
||||
if (!GetShapeProcessFlags().second)
|
||||
{
|
||||
ShapeProcess::OperationsFlags aFlags;
|
||||
aFlags.set(ShapeProcess::Operation::SplitCommonVertex);
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
inline void SetBase(const StepDimTol_DatumOrCommonDatum& theBase) { myBase = theBase; }
|
||||
|
||||
//! Indicates is field Modifiers exist
|
||||
inline bool HasModifiers() const { return !(myModifiers.IsNull() || myModifiers->Length() == 0); }
|
||||
inline bool HasModifiers() const { return !myModifiers.IsNull() && myModifiers->Length() != 0; }
|
||||
|
||||
//! Returns field Modifiers
|
||||
inline occ::handle<NCollection_HArray1<StepDimTol_DatumReferenceModifier>> Modifiers()
|
||||
|
||||
@@ -243,7 +243,10 @@ void TopoDSToStep_MakeTessellatedItem::Init(const TopoDS_Shell&
|
||||
occ::handle<NCollection_HArray1<occ::handle<StepVisual_TessellatedStructuredItem>>> anItems =
|
||||
new NCollection_HArray1<occ::handle<StepVisual_TessellatedStructuredItem>>(1,
|
||||
aTessFaces.Size());
|
||||
for (int anIndx = aTessFaces.Lower(); anIndx <= aTessFaces.Upper(); ++anIndx)
|
||||
for (int anIndx =
|
||||
NCollection_Sequence<opencascade::handle<StepVisual_TessellatedStructuredItem>>::Lower();
|
||||
anIndx <= aTessFaces.Upper();
|
||||
++anIndx)
|
||||
{
|
||||
anItems->SetValue(anIndx, aTessFaces.Value(anIndx));
|
||||
}
|
||||
|
||||
@@ -168,10 +168,6 @@ bool DESTL_ConfigurationNode::CheckContent(const occ::handle<NCollection_Buffer>
|
||||
return false;
|
||||
}
|
||||
const char* aBytes = (const char*)theBuffer->Data();
|
||||
if (!(::strncmp(aBytes, "solid", 5) || ::strncmp(aBytes, "SOLID", 5)) && isspace(aBytes[5]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// binary STL has no header for identification - format can be detected only by file extension
|
||||
return false;
|
||||
return !(::strncmp(aBytes, "solid", 5) || ::strncmp(aBytes, "SOLID", 5)) && isspace(aBytes[5]);
|
||||
}
|
||||
|
||||
@@ -494,9 +494,9 @@ occ::handle<Poly_Triangulation> RWStl::ReadAsciiStream(Standard_IStream&
|
||||
aReader.SetMergeAngle(theMergeAngle);
|
||||
|
||||
// get length of stream to feed progress indicator
|
||||
theStream.seekg(0, theStream.end);
|
||||
theStream.seekg(0, Standard_IStream::end);
|
||||
std::streampos theEnd = theStream.tellg();
|
||||
theStream.seekg(0, theStream.beg);
|
||||
theStream.seekg(0, Standard_IStream::beg);
|
||||
|
||||
Standard_ReadLineBuffer aBuffer(THE_BUFFER_SIZE);
|
||||
if (!aReader.ReadAscii(theStream, aBuffer, theEnd, theProgress))
|
||||
|
||||
@@ -123,7 +123,6 @@ RWStl_Reader::RWStl_Reader()
|
||||
: myMergeAngle(M_PI / 2.0),
|
||||
myMergeTolearance(0.0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -195,7 +194,7 @@ bool RWStl_Reader::IsAscii(Standard_IStream& theStream, const bool isSeekgAvaila
|
||||
if (isSeekgAvailable)
|
||||
{
|
||||
// get back to the beginning
|
||||
theStream.seekg(0, theStream.beg);
|
||||
theStream.seekg(0, Standard_IStream::beg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
StlAPI_Writer::StlAPI_Writer()
|
||||
: myASCIIMode(true)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -19,7 +19,6 @@ Vrml_DirectionalLight::Vrml_DirectionalLight()
|
||||
myColor(Quantity_NOC_WHITE),
|
||||
myDirection(0, 0, -1)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
Vrml_DirectionalLight::Vrml_DirectionalLight(const bool aOnOff,
|
||||
@@ -85,7 +84,7 @@ Standard_OStream& Vrml_DirectionalLight::Print(Standard_OStream& anOStream) cons
|
||||
{
|
||||
anOStream << "DirectionalLight {\n";
|
||||
|
||||
if (myOnOff != true)
|
||||
if (!myOnOff)
|
||||
{
|
||||
anOStream << " on\t\tFALSE\n";
|
||||
// anOStream << myOnOff << "\n";
|
||||
|
||||
@@ -58,7 +58,7 @@ Standard_OStream& Vrml_LOD::Print(Standard_OStream& anOStream) const
|
||||
int i;
|
||||
anOStream << "LOD {\n";
|
||||
|
||||
if (myRangeFlag == true)
|
||||
if (myRangeFlag)
|
||||
{
|
||||
anOStream << " range [\n\t";
|
||||
for (i = myRange->Lower(); i <= myRange->Upper(); i++)
|
||||
|
||||
@@ -19,7 +19,6 @@ Vrml_PointLight::Vrml_PointLight()
|
||||
myColor(Quantity_NOC_WHITE),
|
||||
myLocation(0, 0, 1)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
Vrml_PointLight::Vrml_PointLight(const bool aOnOff,
|
||||
@@ -85,7 +84,7 @@ Standard_OStream& Vrml_PointLight::Print(Standard_OStream& anOStream) const
|
||||
{
|
||||
anOStream << "PointLight {\n";
|
||||
|
||||
if (myOnOff != true)
|
||||
if (!myOnOff)
|
||||
{
|
||||
anOStream << " on\t\tFALSE\n";
|
||||
// anOStream << myOnOff << "\n";
|
||||
|
||||
@@ -22,7 +22,6 @@ Vrml_SpotLight::Vrml_SpotLight()
|
||||
myDropOffRate(0),
|
||||
myCutOffAngle(0.785398)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
Vrml_SpotLight::Vrml_SpotLight(const bool aOnOff,
|
||||
@@ -124,7 +123,7 @@ Standard_OStream& Vrml_SpotLight::Print(Standard_OStream& anOStream) const
|
||||
{
|
||||
anOStream << "SpotLight {\n";
|
||||
|
||||
if (myOnOff != true)
|
||||
if (!myOnOff)
|
||||
{
|
||||
anOStream << " on\t\tFALSE\n";
|
||||
// anOStream << myOnOff << "\n";
|
||||
|
||||
@@ -118,7 +118,7 @@ Standard_OStream& Vrml_Texture2::Print(Standard_OStream& anOStream) const
|
||||
break;
|
||||
}
|
||||
|
||||
if (myImage->ArrayFlag() == true)
|
||||
if (myImage->ArrayFlag())
|
||||
{
|
||||
for (i = myImage->Array()->Lower(); i <= myImage->Array()->Upper(); i++)
|
||||
{
|
||||
|
||||
@@ -214,9 +214,9 @@ VrmlData_ErrorStatus VrmlData_Cone::Write(const char* thePrefix) const
|
||||
Sprintf(buf, "height %.12g", myHeight);
|
||||
aStatus = Scene().WriteLine(buf);
|
||||
}
|
||||
if (OK(aStatus) && myHasBottom == false)
|
||||
if (OK(aStatus) && !myHasBottom)
|
||||
aStatus = Scene().WriteLine("bottom FALSE");
|
||||
if (OK(aStatus) && myHasSide == false)
|
||||
if (OK(aStatus) && !myHasSide)
|
||||
aStatus = Scene().WriteLine("side FALSE");
|
||||
|
||||
aStatus = WriteClosing();
|
||||
@@ -340,11 +340,11 @@ VrmlData_ErrorStatus VrmlData_Cylinder::Write(const char* thePrefix) const
|
||||
Sprintf(buf, "height %.12g", myHeight);
|
||||
aStatus = Scene().WriteLine(buf);
|
||||
}
|
||||
if (OK(aStatus) && myHasBottom == false)
|
||||
if (OK(aStatus) && !myHasBottom)
|
||||
aStatus = Scene().WriteLine("bottom FALSE");
|
||||
if (OK(aStatus) && myHasSide == false)
|
||||
if (OK(aStatus) && !myHasSide)
|
||||
aStatus = Scene().WriteLine("side FALSE");
|
||||
if (OK(aStatus) && myHasTop == false)
|
||||
if (OK(aStatus) && !myHasTop)
|
||||
aStatus = Scene().WriteLine("top FALSE");
|
||||
|
||||
aStatus = WriteClosing();
|
||||
|
||||
@@ -95,7 +95,7 @@ occ::handle<VrmlData_Node> VrmlData_Group::Clone(const occ::handle<VrmlData_Node
|
||||
for (; anIter.More(); anIter.Next())
|
||||
{
|
||||
const occ::handle<VrmlData_Node>& aNode = anIter.Value();
|
||||
if (aNode.IsNull() == false)
|
||||
if (!aNode.IsNull())
|
||||
aResult->myNodes.Append(aNode->Clone(aDummyNode));
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ occ::handle<VrmlData_Node> VrmlData_Group::FindNode(const char* theName, gp_Trsf
|
||||
for (; anIter.More(); anIter.Next())
|
||||
{
|
||||
const occ::handle<VrmlData_Node>& aNode = anIter.Value();
|
||||
if (aNode.IsNull() == false)
|
||||
if (!aNode.IsNull())
|
||||
{
|
||||
if (strcmp(aNode->Name(), theName) == 0)
|
||||
{
|
||||
@@ -127,10 +127,10 @@ occ::handle<VrmlData_Node> VrmlData_Group::FindNode(const char* theName, gp_Trsf
|
||||
if (aNode->IsKind(STANDARD_TYPE(VrmlData_Group)))
|
||||
{
|
||||
const occ::handle<VrmlData_Group> aGroup = occ::down_cast<VrmlData_Group>(aNode);
|
||||
if (aGroup.IsNull() == false)
|
||||
if (!aGroup.IsNull())
|
||||
{
|
||||
aResult = aGroup->FindNode(theName, theLocation);
|
||||
if (aResult.IsNull() == false)
|
||||
if (!aResult.IsNull())
|
||||
{
|
||||
// theLocation *= myTrsf;
|
||||
theLocation.PreMultiply(myTrsf);
|
||||
@@ -189,7 +189,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read(VrmlData_InBuffer& theBuffer)
|
||||
if (!OK(aStatus, ReadNode(theBuffer, aChildNode)))
|
||||
break;
|
||||
AddNode(aChildNode);
|
||||
if (isBracketed == false)
|
||||
if (!isBracketed)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -229,7 +229,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read(VrmlData_InBuffer& theBuffer)
|
||||
break;
|
||||
|
||||
AddNode(aChildNode);
|
||||
if (isBracketed == false)
|
||||
if (!isBracketed)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -265,7 +265,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read(VrmlData_InBuffer& theBuffer)
|
||||
break;
|
||||
|
||||
aGroupNode->AddNode(aChildNode);
|
||||
if (isBracketed == false)
|
||||
if (!isBracketed)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ VrmlData_ErrorStatus VrmlData_Group::openFile(Standard_IStream& the
|
||||
VrmlData_ErrorStatus VrmlData_Group::Write(const char* thePrefix) const
|
||||
{
|
||||
VrmlData_ErrorStatus aStatus(VrmlData_StatusOK);
|
||||
if (myNodes.IsEmpty() == false)
|
||||
if (!myNodes.IsEmpty())
|
||||
{
|
||||
const VrmlData_Scene& aScene = Scene();
|
||||
bool isTransform = myIsTransform;
|
||||
@@ -571,7 +571,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write(const char* thePrefix) const
|
||||
if (OK(aStatus, aScene.WriteLine(thePrefix, header[isTransform ? 1 : 0], GlobalIndent())))
|
||||
{
|
||||
char buf[240];
|
||||
if (OK(aStatus) && aScene.IsDummyWrite() == false)
|
||||
if (OK(aStatus) && !aScene.IsDummyWrite())
|
||||
{
|
||||
const gp_XYZ aBoxCorner[2] = {myBox.CornerMin(), myBox.CornerMax()};
|
||||
// Check that the box is not void
|
||||
@@ -594,7 +594,7 @@ VrmlData_ErrorStatus VrmlData_Group::Write(const char* thePrefix) const
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OK(aStatus) && isTransform && aScene.IsDummyWrite() == false)
|
||||
if (OK(aStatus) && isTransform && !aScene.IsDummyWrite())
|
||||
{
|
||||
// Output the Scale
|
||||
const double aScaleFactor = myTrsf.ScaleFactor();
|
||||
|
||||
@@ -297,11 +297,11 @@ occ::handle<VrmlData_Node> VrmlData_IndexedFaceSet::Clone(
|
||||
{
|
||||
// Create a dummy node to pass the different Scene instance to methods Clone
|
||||
const occ::handle<VrmlData_UnknownNode> aDummyNode = new VrmlData_UnknownNode(aResult->Scene());
|
||||
if (myCoords.IsNull() == false)
|
||||
if (!myCoords.IsNull())
|
||||
aResult->SetCoordinates(occ::down_cast<VrmlData_Coordinate>(myCoords->Clone(aDummyNode)));
|
||||
if (myNormals.IsNull() == false)
|
||||
if (!myNormals.IsNull())
|
||||
aResult->SetNormals(occ::down_cast<VrmlData_Normal>(myNormals->Clone(aDummyNode)));
|
||||
if (myColors.IsNull() == false)
|
||||
if (!myColors.IsNull())
|
||||
aResult->SetColors(occ::down_cast<VrmlData_Color>(myColors->Clone(aDummyNode)));
|
||||
// TODO: Replace the following lines with the relevant copying
|
||||
aResult->SetPolygons(myNbPolygons, myArrPolygons);
|
||||
@@ -428,7 +428,7 @@ bool VrmlData_IndexedFaceSet::IsDefault() const
|
||||
bool aResult(true);
|
||||
if (myNbPolygons)
|
||||
aResult = false;
|
||||
else if (myCoords.IsNull() == false)
|
||||
else if (!myCoords.IsNull())
|
||||
aResult = myCoords->IsDefault();
|
||||
return aResult;
|
||||
}
|
||||
@@ -444,11 +444,11 @@ VrmlData_ErrorStatus VrmlData_IndexedFaceSet::Write(const char* thePrefix) const
|
||||
{
|
||||
|
||||
// Write the attributes of interface "VrmlData_Faceted"
|
||||
if (IsCCW() == false)
|
||||
if (!IsCCW())
|
||||
aStatus = aScene.WriteLine("ccw FALSE");
|
||||
if (OK(aStatus) && IsSolid() == false)
|
||||
if (OK(aStatus) && !IsSolid())
|
||||
aStatus = aScene.WriteLine("solid FALSE");
|
||||
if (OK(aStatus) && IsConvex() == false)
|
||||
if (OK(aStatus) && !IsConvex())
|
||||
aStatus = aScene.WriteLine("convex FALSE");
|
||||
if (OK(aStatus) && CreaseAngle() > Precision::Confusion())
|
||||
{
|
||||
@@ -457,26 +457,26 @@ VrmlData_ErrorStatus VrmlData_IndexedFaceSet::Write(const char* thePrefix) const
|
||||
aStatus = aScene.WriteLine("creaseAngle", buf);
|
||||
}
|
||||
|
||||
if (OK(aStatus) && myCoords.IsNull() == false)
|
||||
if (OK(aStatus) && !myCoords.IsNull())
|
||||
aStatus = aScene.WriteNode("coord", myCoords);
|
||||
if (OK(aStatus))
|
||||
aStatus = aScene.WriteArrIndex("coordIndex", myArrPolygons, myNbPolygons);
|
||||
|
||||
if (OK(aStatus) && myNormalPerVertex == false)
|
||||
if (OK(aStatus) && !myNormalPerVertex)
|
||||
aStatus = aScene.WriteLine("normalPerVertex FALSE");
|
||||
if (OK(aStatus) && myNormals.IsNull() == false)
|
||||
if (OK(aStatus) && !myNormals.IsNull())
|
||||
aStatus = aScene.WriteNode("normal", myNormals);
|
||||
if (OK(aStatus))
|
||||
aStatus = aScene.WriteArrIndex("normalIndex", myArrNormalInd, myNbNormals);
|
||||
|
||||
if (OK(aStatus) && myColorPerVertex == false)
|
||||
if (OK(aStatus) && !myColorPerVertex)
|
||||
aStatus = aScene.WriteLine("colorPerVertex FALSE");
|
||||
if (OK(aStatus) && myColors.IsNull() == false)
|
||||
if (OK(aStatus) && !myColors.IsNull())
|
||||
aStatus = aScene.WriteNode("color", myColors);
|
||||
if (OK(aStatus))
|
||||
aStatus = aScene.WriteArrIndex("colorIndex", myArrColorInd, myNbColors);
|
||||
|
||||
if (OK(aStatus) && myTxCoords.IsNull() == false)
|
||||
if (OK(aStatus) && !myTxCoords.IsNull())
|
||||
aStatus = aScene.WriteNode("texCoord", myTxCoords);
|
||||
if (OK(aStatus))
|
||||
aStatus = aScene.WriteArrIndex("texCoordIndex", myArrTextureInd, myNbTextures);
|
||||
|
||||
@@ -105,9 +105,9 @@ occ::handle<VrmlData_Node> VrmlData_IndexedLineSet::Clone(
|
||||
{
|
||||
// Create a dummy node to pass the different Scene instance to methods Clone
|
||||
const occ::handle<VrmlData_UnknownNode> aDummyNode = new VrmlData_UnknownNode(aResult->Scene());
|
||||
if (myCoords.IsNull() == false)
|
||||
if (!myCoords.IsNull())
|
||||
aResult->SetCoordinates(occ::down_cast<VrmlData_Coordinate>(myCoords->Clone(aDummyNode)));
|
||||
if (myColors.IsNull() == false)
|
||||
if (!myColors.IsNull())
|
||||
aResult->SetColors(occ::down_cast<VrmlData_Color>(myColors->Clone(aDummyNode)));
|
||||
// TODO: Replace the following lines with the relevant copying
|
||||
aResult->SetPolygons(myNbPolygons, myArrPolygons);
|
||||
@@ -176,14 +176,14 @@ VrmlData_ErrorStatus VrmlData_IndexedLineSet::Write(const char* thePrefix) const
|
||||
if (OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
{
|
||||
|
||||
if (OK(aStatus) && myCoords.IsNull() == false)
|
||||
if (OK(aStatus) && !myCoords.IsNull())
|
||||
aStatus = aScene.WriteNode("coord", myCoords);
|
||||
if (OK(aStatus))
|
||||
aStatus = aScene.WriteArrIndex("coordIndex", myArrPolygons, myNbPolygons);
|
||||
|
||||
if (OK(aStatus) && myColorPerVertex == false)
|
||||
if (OK(aStatus) && !myColorPerVertex)
|
||||
aStatus = aScene.WriteLine("colorPerVertex FALSE");
|
||||
if (OK(aStatus) && myColors.IsNull() == false)
|
||||
if (OK(aStatus) && !myColors.IsNull())
|
||||
aStatus = aScene.WriteNode("color", myColors);
|
||||
if (OK(aStatus))
|
||||
aStatus = aScene.WriteArrIndex("colorIndex", myArrColorInd, myNbColors);
|
||||
@@ -204,7 +204,7 @@ bool VrmlData_IndexedLineSet::IsDefault() const
|
||||
bool aResult(true);
|
||||
if (myNbPolygons)
|
||||
aResult = false;
|
||||
else if (myCoords.IsNull() == false)
|
||||
else if (!myCoords.IsNull())
|
||||
aResult = myCoords->IsDefault();
|
||||
return aResult;
|
||||
}
|
||||
|
||||
@@ -248,8 +248,7 @@ VrmlData_ErrorStatus VrmlData_Material::Write(const char* thePrefix) const
|
||||
VrmlData_ErrorStatus aStatus = VrmlData_StatusOK;
|
||||
const VrmlData_Scene& aScene = Scene();
|
||||
static char header[] = "Material {";
|
||||
if (aScene.IsDummyWrite() == false
|
||||
&& OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
if (!aScene.IsDummyWrite() && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
{
|
||||
char buf[128];
|
||||
double val[3];
|
||||
|
||||
@@ -69,9 +69,9 @@ VrmlData_Node::VrmlData_Node(const VrmlData_Scene& theScene, const char* theName
|
||||
|
||||
occ::handle<VrmlData_Node> VrmlData_Node::Clone(const occ::handle<VrmlData_Node>& theOther) const
|
||||
{
|
||||
if (theOther.IsNull() == false)
|
||||
if (!theOther.IsNull())
|
||||
{
|
||||
if (theOther->IsKind(DynamicType()) == false)
|
||||
if (!theOther->IsKind(DynamicType()))
|
||||
return nullptr;
|
||||
if (&theOther->Scene() == myScene)
|
||||
theOther->myName = myName;
|
||||
@@ -227,7 +227,7 @@ VrmlData_ErrorStatus VrmlData_Node::ReadMultiString(
|
||||
if (!OK(aStatus, ReadString(theBuffer, aString)))
|
||||
break;
|
||||
theResult.Append(aString);
|
||||
if (isBracketed == false || !OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
|
||||
if (!isBracketed || !OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
|
||||
break;
|
||||
if (theBuffer.LinePtr[0] == ',')
|
||||
{
|
||||
@@ -272,7 +272,7 @@ VrmlData_ErrorStatus VrmlData_Node::ReadNode(VrmlData_InBuffer& t
|
||||
// We create a relevant node using the line with the type ID
|
||||
else if (OK(aStatus,
|
||||
const_cast<VrmlData_Scene*>(myScene)->createNode(theBuffer, aNode, theType)))
|
||||
if (aNode.IsNull() == false)
|
||||
if (!aNode.IsNull())
|
||||
// The node data are read here, including the final closing brace
|
||||
aStatus = aNode->Read(theBuffer);
|
||||
|
||||
@@ -300,9 +300,9 @@ occ::handle<VrmlData_Node> VrmlData_ShapeNode::Clone(
|
||||
{
|
||||
// Create a dummy node to pass the different Scene instance to methods Clone
|
||||
const occ::handle<VrmlData_UnknownNode> aDummyNode = new VrmlData_UnknownNode(aResult->Scene());
|
||||
if (myAppearance.IsNull() == false)
|
||||
if (!myAppearance.IsNull())
|
||||
aResult->SetAppearance(occ::down_cast<VrmlData_Appearance>(myAppearance->Clone(aDummyNode)));
|
||||
if (myGeometry.IsNull() == false)
|
||||
if (!myGeometry.IsNull())
|
||||
aResult->SetGeometry(occ::down_cast<VrmlData_Geometry>(myGeometry->Clone(aDummyNode)));
|
||||
}
|
||||
return aResult;
|
||||
@@ -352,9 +352,9 @@ VrmlData_ErrorStatus VrmlData_ShapeNode::Write(const char* thePrefix) const
|
||||
static char header[] = "Shape {";
|
||||
if (OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
{
|
||||
if (myAppearance.IsNull() == false)
|
||||
if (!myAppearance.IsNull())
|
||||
aStatus = aScene.WriteNode("appearance", myAppearance);
|
||||
if (myGeometry.IsNull() == false && OK(aStatus))
|
||||
if (!myGeometry.IsNull() && OK(aStatus))
|
||||
aStatus = aScene.WriteNode("geometry", myGeometry);
|
||||
|
||||
aStatus = WriteClosing();
|
||||
@@ -367,7 +367,7 @@ VrmlData_ErrorStatus VrmlData_ShapeNode::Write(const char* thePrefix) const
|
||||
bool VrmlData_ShapeNode::IsDefault() const
|
||||
{
|
||||
bool aResult(true);
|
||||
if (myGeometry.IsNull() == false)
|
||||
if (!myGeometry.IsNull())
|
||||
aResult = myGeometry->IsDefault();
|
||||
return aResult;
|
||||
}
|
||||
@@ -428,11 +428,11 @@ occ::handle<VrmlData_Node> VrmlData_Appearance::Clone(
|
||||
{
|
||||
// Create a dummy node to pass the different Scene instance to methods Clone
|
||||
const occ::handle<VrmlData_UnknownNode> aDummyNode = new VrmlData_UnknownNode(aResult->Scene());
|
||||
if (myMaterial.IsNull() == false)
|
||||
if (!myMaterial.IsNull())
|
||||
aResult->SetMaterial(occ::down_cast<VrmlData_Material>(myMaterial->Clone(aDummyNode)));
|
||||
if (myTexture.IsNull() == false)
|
||||
if (!myTexture.IsNull())
|
||||
aResult->SetTexture(occ::down_cast<VrmlData_Texture>(myTexture->Clone(aDummyNode)));
|
||||
if (myTTransform.IsNull() == false)
|
||||
if (!myTTransform.IsNull())
|
||||
aResult->SetTextureTransform(
|
||||
occ::down_cast<VrmlData_TextureTransform>(myTTransform->Clone(aDummyNode)));
|
||||
}
|
||||
@@ -487,11 +487,11 @@ VrmlData_ErrorStatus VrmlData_Appearance::Write(const char* thePrefix) const
|
||||
const VrmlData_Scene& aScene = Scene();
|
||||
if (OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
{
|
||||
if (myMaterial.IsNull() == false)
|
||||
if (!myMaterial.IsNull())
|
||||
aStatus = aScene.WriteNode("material", myMaterial);
|
||||
if (myTexture.IsNull() == false && OK(aStatus))
|
||||
if (!myTexture.IsNull() && OK(aStatus))
|
||||
aStatus = aScene.WriteNode("texture", myTexture);
|
||||
if (myTTransform.IsNull() == false && OK(aStatus))
|
||||
if (!myTTransform.IsNull() && OK(aStatus))
|
||||
aStatus = aScene.WriteNode("textureTransform", myTTransform);
|
||||
|
||||
aStatus = WriteClosing();
|
||||
@@ -504,11 +504,11 @@ VrmlData_ErrorStatus VrmlData_Appearance::Write(const char* thePrefix) const
|
||||
bool VrmlData_Appearance::IsDefault() const
|
||||
{
|
||||
bool aResult(true);
|
||||
if (myMaterial.IsNull() == false)
|
||||
if (!myMaterial.IsNull())
|
||||
aResult = myMaterial->IsDefault();
|
||||
if (aResult && myTexture.IsNull() == false)
|
||||
if (aResult && !myTexture.IsNull())
|
||||
aResult = myTexture->IsDefault();
|
||||
if (aResult && myTTransform.IsNull() == false)
|
||||
if (aResult && !myTTransform.IsNull())
|
||||
aResult = myTTransform->IsDefault();
|
||||
return aResult;
|
||||
}
|
||||
@@ -575,8 +575,7 @@ VrmlData_ErrorStatus VrmlData_ImageTexture::Write(const char* thePrefix) const
|
||||
VrmlData_ErrorStatus aStatus = VrmlData_StatusOK;
|
||||
const VrmlData_Scene& aScene = Scene();
|
||||
static char header[] = "ImageTexture {";
|
||||
if (aScene.IsDummyWrite() == false
|
||||
&& OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
if (!aScene.IsDummyWrite() && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
{
|
||||
TCollection_AsciiString url = "\"";
|
||||
url += URL().First();
|
||||
|
||||
@@ -81,8 +81,8 @@ VrmlData_Scene::VrmlData_Scene(const occ::handle<NCollection_IncAllocator>& theA
|
||||
const occ::handle<VrmlData_Node>& VrmlData_Scene::AddNode(const occ::handle<VrmlData_Node>& theN,
|
||||
const bool isTopLevel)
|
||||
{
|
||||
if (theN.IsNull() == false)
|
||||
if (theN->IsKind(STANDARD_TYPE(VrmlData_WorldInfo)) == false)
|
||||
if (!theN.IsNull())
|
||||
if (!theN->IsKind(STANDARD_TYPE(VrmlData_WorldInfo)))
|
||||
{
|
||||
std::lock_guard<std::mutex> aLock(myMutex);
|
||||
const occ::handle<VrmlData_Node>& aNode =
|
||||
@@ -90,7 +90,7 @@ const occ::handle<VrmlData_Node>& VrmlData_Scene::AddNode(const occ::handle<Vrml
|
||||
// Name is checked for uniqueness. If not, letter 'D' is appended until
|
||||
// the name proves to be unique.
|
||||
if (aNode->Name()[0] != '\0')
|
||||
while (myNamedNodes.Add(aNode) == false)
|
||||
while (!myNamedNodes.Add(aNode))
|
||||
aNode->setName(aNode->Name(), "D");
|
||||
if (isTopLevel)
|
||||
myLstNodes.Append(aNode);
|
||||
@@ -123,7 +123,7 @@ Standard_OStream& operator<<(Standard_OStream& theOutput, const VrmlData_Scene&
|
||||
for (; anIterD.More(); anIterD.Next())
|
||||
{
|
||||
const occ::handle<VrmlData_Node>& aNode = anIterD.Value();
|
||||
if (aNode.IsNull() == false)
|
||||
if (!aNode.IsNull())
|
||||
{
|
||||
const VrmlData_ErrorStatus aStatus = aScene.WriteNode(nullptr, aNode);
|
||||
if (aStatus != VrmlData_StatusOK && aStatus != VrmlData_NotImplemented)
|
||||
@@ -141,7 +141,7 @@ Standard_OStream& operator<<(Standard_OStream& theOutput, const VrmlData_Scene&
|
||||
for (; anIter.More(); anIter.Next())
|
||||
{
|
||||
const occ::handle<VrmlData_Node>& aNode = anIter.Value();
|
||||
if (aNode.IsNull() == false)
|
||||
if (!aNode.IsNull())
|
||||
{
|
||||
const VrmlData_ErrorStatus aStatus = aScene.WriteNode(nullptr, aNode);
|
||||
if (aStatus != VrmlData_StatusOK && aStatus != VrmlData_NotImplemented)
|
||||
@@ -268,7 +268,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadLine(VrmlData_InBuffer& theBuffer)
|
||||
|
||||
nonempty_line:
|
||||
// Try to detect comment
|
||||
if (theBuffer.IsProcessed == false)
|
||||
if (!theBuffer.IsProcessed)
|
||||
{
|
||||
bool isQuoted(false);
|
||||
int anOffset(0);
|
||||
@@ -279,7 +279,7 @@ nonempty_line:
|
||||
*ptr = ptr[anOffset];
|
||||
if (*ptr == '\n' || *ptr == '\r' || *ptr == '#')
|
||||
{
|
||||
if (isQuoted == false)
|
||||
if (!isQuoted)
|
||||
{
|
||||
*ptr = '\0';
|
||||
break;
|
||||
@@ -347,12 +347,12 @@ VrmlData_Scene& VrmlData_Scene::operator<<(Standard_IStream& theInput)
|
||||
// Unknown nodes are not stored however they do not generate error
|
||||
if (myStatus != VrmlData_StatusOK)
|
||||
break;
|
||||
if (aNode.IsNull() == false /*&&
|
||||
if (!aNode.IsNull() /*&&
|
||||
!aNode->IsKind (STANDARD_TYPE(VrmlData_UnknownNode))*/)
|
||||
{
|
||||
if (aNode->IsKind(STANDARD_TYPE(VrmlData_WorldInfo)) == false)
|
||||
if (!aNode->IsKind(STANDARD_TYPE(VrmlData_WorldInfo)))
|
||||
myLstNodes.Append(aNode);
|
||||
else if (aNode->IsDefault() == false)
|
||||
else if (!aNode->IsDefault())
|
||||
{
|
||||
const occ::handle<VrmlData_WorldInfo> aInfo = occ::down_cast<VrmlData_WorldInfo>(aNode);
|
||||
myWorldInfo->SetTitle(aInfo->Title());
|
||||
@@ -420,10 +420,10 @@ occ::handle<VrmlData_Node> VrmlData_Scene::FindNode(const char* theName, gp_Trsf
|
||||
if (aNode->IsKind(STANDARD_TYPE(VrmlData_Group)))
|
||||
{
|
||||
const occ::handle<VrmlData_Group> aGroup = occ::down_cast<VrmlData_Group>(aNode);
|
||||
if (aGroup.IsNull() == false)
|
||||
if (!aGroup.IsNull())
|
||||
{
|
||||
aResult = aGroup->FindNode(theName, theLocation);
|
||||
if (aResult.IsNull() == false)
|
||||
if (!aResult.IsNull())
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -578,12 +578,12 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode(VrmlData_InBuffer&
|
||||
}
|
||||
}
|
||||
aStatus = ReadLine(theBuffer);
|
||||
if (aNode.IsNull() == false)
|
||||
if (!aNode.IsNull())
|
||||
{
|
||||
if (aNode->Name()[0] != '\0')
|
||||
myNamedNodes.Add(aNode);
|
||||
if (theType.IsNull() == false)
|
||||
if (aNode->IsKind(theType) == false)
|
||||
if (!theType.IsNull())
|
||||
if (!aNode->IsKind(theType))
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
}
|
||||
if (aStatus == VrmlData_StatusOK)
|
||||
@@ -641,22 +641,22 @@ void VrmlData_Scene::createShape(
|
||||
// Try a Shape type of node
|
||||
const occ::handle<VrmlData_ShapeNode> aNodeShape =
|
||||
occ::down_cast<VrmlData_ShapeNode>(anIter.Value());
|
||||
if (aNodeShape.IsNull() == false)
|
||||
if (!aNodeShape.IsNull())
|
||||
{
|
||||
const occ::handle<VrmlData_Geometry> aNodeGeom = aNodeShape->Geometry();
|
||||
if (aNodeGeom.IsNull() == false)
|
||||
if (!aNodeGeom.IsNull())
|
||||
{
|
||||
if (aSingleShape.IsNull() == false)
|
||||
if (!aSingleShape.IsNull())
|
||||
isSingleShape = false;
|
||||
const occ::handle<TopoDS_TShape> aTShape = aNodeGeom->TShape();
|
||||
aSingleShape.TShape(aTShape);
|
||||
if (aSingleShape.IsNull() == false)
|
||||
if (!aSingleShape.IsNull())
|
||||
{
|
||||
aBuilder.Add(outShape, aSingleShape);
|
||||
if (pMapShapeApp != nullptr)
|
||||
{
|
||||
const occ::handle<VrmlData_Appearance>& anAppearance = aNodeShape->Appearance();
|
||||
if (anAppearance.IsNull() == false)
|
||||
if (!anAppearance.IsNull())
|
||||
{
|
||||
// Check if the current topology is a single face
|
||||
if (aTShape->IsKind(STANDARD_TYPE(TopoDS_TFace)))
|
||||
@@ -681,11 +681,11 @@ void VrmlData_Scene::createShape(
|
||||
}
|
||||
// Try a Group type of node
|
||||
const occ::handle<VrmlData_Group> aNodeGroup = occ::down_cast<VrmlData_Group>(anIter.Value());
|
||||
if (aNodeGroup.IsNull() == false)
|
||||
if (!aNodeGroup.IsNull())
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
aNodeGroup->Shape(aShape, pMapShapeApp);
|
||||
if (aShape.IsNull() == false)
|
||||
if (!aShape.IsNull())
|
||||
{
|
||||
aBuilder.Add(outShape, aShape);
|
||||
isSingleShape = false;
|
||||
@@ -863,7 +863,7 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadArrIndex(VrmlData_InBuffer& theBuffer,
|
||||
// The input value is a node index, store it in the buffer vector
|
||||
vecInt.Append(static_cast<int>(anIntValue));
|
||||
}
|
||||
if ((anIntValue < 0 || isMore == false) && vecInt.Length() > 0)
|
||||
if ((anIntValue < 0 || !isMore) && vecInt.Length() > 0)
|
||||
{
|
||||
const int aLen = vecInt.Length();
|
||||
// The input is the end-of-face, store and close this face
|
||||
@@ -910,7 +910,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteArrIndex(const char* thePrefix,
|
||||
const size_t theNbBlocks) const
|
||||
{
|
||||
VrmlData_ErrorStatus aStatus(VrmlData_StatusOK);
|
||||
if (theNbBlocks && (IsDummyWrite() == false))
|
||||
if (theNbBlocks && (!IsDummyWrite()))
|
||||
{
|
||||
if (VrmlData_Node::OK(aStatus, WriteLine(thePrefix, "[", 1)))
|
||||
{
|
||||
@@ -968,7 +968,7 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteXYZ(const gp_XYZ& theXYZ,
|
||||
const char* thePostfix) const
|
||||
{
|
||||
char buf[240];
|
||||
if (IsDummyWrite() == false)
|
||||
if (!IsDummyWrite())
|
||||
{
|
||||
if (isApplyScale && myLinearScale > Precision::Confusion())
|
||||
Sprintf(buf,
|
||||
@@ -1051,8 +1051,8 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteNode(const char*
|
||||
else if (theNode->Name()[0] == '\0')
|
||||
isNoName = true;
|
||||
|
||||
if (theNode.IsNull() == false)
|
||||
if (theNode->IsDefault() == false)
|
||||
if (!theNode.IsNull())
|
||||
if (!theNode->IsDefault())
|
||||
{
|
||||
if (isNoName && IsDummyWrite())
|
||||
{
|
||||
@@ -1146,7 +1146,7 @@ void dumpNode(Standard_OStream& theStream,
|
||||
const occ::handle<VrmlData_Appearance> anAppearance =
|
||||
occ::down_cast<VrmlData_Appearance>(theNode);
|
||||
dumpNodeHeader(theStream, theIndent, "Appearance", theNode->Name());
|
||||
if (theIndent.IsEmpty() == false)
|
||||
if (!theIndent.IsEmpty())
|
||||
{
|
||||
dumpNode(theStream, anAppearance->Material(), aNewIndent);
|
||||
dumpNode(theStream, anAppearance->Texture(), aNewIndent);
|
||||
@@ -1157,7 +1157,7 @@ void dumpNode(Standard_OStream& theStream,
|
||||
{
|
||||
const occ::handle<VrmlData_ShapeNode> aShape = occ::down_cast<VrmlData_ShapeNode>(theNode);
|
||||
dumpNodeHeader(theStream, theIndent, "Shape", theNode->Name());
|
||||
if (theIndent.IsEmpty() == false)
|
||||
if (!theIndent.IsEmpty())
|
||||
{
|
||||
dumpNode(theStream, aShape->Appearance(), aNewIndent);
|
||||
dumpNode(theStream, aShape->Geometry(), aNewIndent);
|
||||
@@ -1179,7 +1179,7 @@ void dumpNode(Standard_OStream& theStream,
|
||||
char buf[64];
|
||||
Sprintf(buf, "Group (%s)", aGroup->IsTransform() ? "Transform" : "Group");
|
||||
dumpNodeHeader(theStream, theIndent, buf, theNode->Name());
|
||||
if (theIndent.IsEmpty() == false)
|
||||
if (!theIndent.IsEmpty())
|
||||
{
|
||||
NCollection_List<occ::handle<VrmlData_Node>>::Iterator anIter = aGroup->NodeIterator();
|
||||
for (; anIter.More(); anIter.Next())
|
||||
|
||||
@@ -108,7 +108,7 @@ occ::handle<VrmlData_Geometry> VrmlData_ShapeConvert::makeTShapeNode(
|
||||
{
|
||||
case TopAbs_FACE: {
|
||||
const TopoDS_Face& aFace = TopoDS::Face(theShape);
|
||||
if (aFace.IsNull() == false)
|
||||
if (!aFace.IsNull())
|
||||
{
|
||||
occ::handle<Poly_Triangulation> aTri = BRep_Tool::Triangulation(aFace, theLoc);
|
||||
|
||||
@@ -118,7 +118,7 @@ occ::handle<VrmlData_Geometry> VrmlData_ShapeConvert::makeTShapeNode(
|
||||
break;
|
||||
}
|
||||
|
||||
if (aTri.IsNull() == false)
|
||||
if (!aTri.IsNull())
|
||||
{
|
||||
TopoDS_Shape aTestedShapeRev = aTestedShape;
|
||||
aTestedShapeRev.Orientation(isReverse ? TopAbs_FORWARD : TopAbs_REVERSED);
|
||||
@@ -127,7 +127,7 @@ occ::handle<VrmlData_Geometry> VrmlData_ShapeConvert::makeTShapeNode(
|
||||
aFaceSetToReuse = occ::down_cast<VrmlData_IndexedFaceSet>(myRelMap(aTestedShapeRev));
|
||||
|
||||
occ::handle<VrmlData_Coordinate> aCoordToReuse;
|
||||
if (aFaceSetToReuse.IsNull() == false)
|
||||
if (!aFaceSetToReuse.IsNull())
|
||||
aCoordToReuse = aFaceSetToReuse->Coordinates();
|
||||
|
||||
aTShapeNode = triToIndexedFaceSet(aTri, aFace, aCoordToReuse);
|
||||
@@ -140,14 +140,14 @@ occ::handle<VrmlData_Geometry> VrmlData_ShapeConvert::makeTShapeNode(
|
||||
break;
|
||||
case TopAbs_WIRE: {
|
||||
const TopoDS_Wire& aWire = TopoDS::Wire(theShape);
|
||||
if (aWire.IsNull() == false)
|
||||
if (!aWire.IsNull())
|
||||
{
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TopAbs_EDGE: {
|
||||
const TopoDS_Edge& aEdge = TopoDS::Edge(theShape);
|
||||
if (aEdge.IsNull() == false)
|
||||
if (!aEdge.IsNull())
|
||||
{
|
||||
if (myRelMap.IsBound(aTestedShape))
|
||||
{
|
||||
@@ -374,7 +374,7 @@ occ::handle<VrmlData_Geometry> VrmlData_ShapeConvert::triToIndexedFaceSet(
|
||||
}
|
||||
|
||||
// Create the Coordinates node
|
||||
if (theCoord.IsNull() == false)
|
||||
if (!theCoord.IsNull())
|
||||
aFaceSet->SetCoordinates(theCoord);
|
||||
else
|
||||
{
|
||||
@@ -417,7 +417,7 @@ occ::handle<VrmlData_Geometry> VrmlData_ShapeConvert::triToIndexedFaceSet(
|
||||
TopLoc_Location aLoc;
|
||||
constexpr double aConf2 = Precision::SquareConfusion();
|
||||
const occ::handle<Geom_Surface> aSurface = BRep_Tool::Surface(theFace, aLoc);
|
||||
if (theTri->HasUVNodes() && aSurface.IsNull() == false)
|
||||
if (theTri->HasUVNodes() && !aSurface.IsNull())
|
||||
{
|
||||
if (aSurface->IsCNu(1) && aSurface->IsCNv(1))
|
||||
{
|
||||
|
||||
@@ -149,8 +149,7 @@ VrmlData_ErrorStatus VrmlData_WorldInfo::Write(const char* thePrefix) const
|
||||
VrmlData_ErrorStatus aStatus(VrmlData_StatusOK);
|
||||
const VrmlData_Scene& aScene = Scene();
|
||||
static char header[] = "WorldInfo {";
|
||||
if (aScene.IsDummyWrite() == false
|
||||
&& OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
if (!aScene.IsDummyWrite() && OK(aStatus, aScene.WriteLine(thePrefix, header, GlobalIndent())))
|
||||
{
|
||||
char buf[4096];
|
||||
if (myTitle)
|
||||
@@ -159,7 +158,7 @@ VrmlData_ErrorStatus VrmlData_WorldInfo::Write(const char* thePrefix) const
|
||||
aStatus = aScene.WriteLine(buf);
|
||||
}
|
||||
|
||||
if (myInfo.IsEmpty() == false && OK(aStatus))
|
||||
if (!myInfo.IsEmpty() && OK(aStatus))
|
||||
{
|
||||
if (OK(aStatus, aScene.WriteLine("info [", nullptr, GlobalIndent())))
|
||||
{
|
||||
|
||||
@@ -43,15 +43,11 @@ RWMesh_CafReader::RWMesh_CafReader()
|
||||
myMemoryLimitMiB(-1),
|
||||
myExtraStatus(RWMesh_CafReaderStatusEx_NONE)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWMesh_CafReader::~RWMesh_CafReader()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWMesh_CafReader::~RWMesh_CafReader() = default;
|
||||
|
||||
void RWMesh_CafReader::SetDocument(const occ::handle<TDocStd_Document>& theDoc)
|
||||
{
|
||||
@@ -540,7 +536,7 @@ void RWMesh_CafReader::generateNames(const TCollection_AsciiString& theFile,
|
||||
|
||||
// replace empty names
|
||||
occ::handle<TDataStd_Name> aNodeName;
|
||||
int aRootIndex = aRootLabels.Lower();
|
||||
int aRootIndex = NCollection_Sequence<TDF_Label>::Lower();
|
||||
NCollection_Sequence<TDF_Label> aNewRootLabels;
|
||||
for (NCollection_Sequence<TDF_Label>::Iterator aRootIter(aRootLabels); aRootIter.More();
|
||||
++aRootIndex, aRootIter.Next())
|
||||
|
||||
@@ -28,7 +28,6 @@ RWMesh_CoordinateSystemConverter::RWMesh_CoordinateSystemConverter()
|
||||
myHasScale(false),
|
||||
myIsEmpty(true)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -44,10 +44,7 @@ RWMesh_MaterialMap::RWMesh_MaterialMap(const TCollection_AsciiString& theFile)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWMesh_MaterialMap::~RWMesh_MaterialMap()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWMesh_MaterialMap::~RWMesh_MaterialMap() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -28,10 +28,7 @@ RWMesh_TriangulationSource::RWMesh_TriangulationSource()
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
RWMesh_TriangulationSource::~RWMesh_TriangulationSource()
|
||||
{
|
||||
//
|
||||
}
|
||||
RWMesh_TriangulationSource::~RWMesh_TriangulationSource() = default;
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
|
||||
@@ -191,9 +191,7 @@ void XCAFDimTolObjects_DimensionObject::SetValues(
|
||||
|
||||
bool XCAFDimTolObjects_DimensionObject::IsDimWithRange() const
|
||||
{
|
||||
if (!myVal.IsNull() && myVal->Length() == 2)
|
||||
return true;
|
||||
return false;
|
||||
return !myVal.IsNull() && myVal->Length() == 2;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -453,20 +451,18 @@ void XCAFDimTolObjects_DimensionObject::RemoveDescription(const int theNumber)
|
||||
bool XCAFDimTolObjects_DimensionObject::IsDimensionalLocation(
|
||||
const XCAFDimTolObjects_DimensionType theType)
|
||||
{
|
||||
if (theType == XCAFDimTolObjects_DimensionType_Location_None
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_CurvedDistance
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_Oriented)
|
||||
return true;
|
||||
return false;
|
||||
return theType == XCAFDimTolObjects_DimensionType_Location_None
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_CurvedDistance
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Location_Oriented;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -474,22 +470,20 @@ bool XCAFDimTolObjects_DimensionObject::IsDimensionalLocation(
|
||||
bool XCAFDimTolObjects_DimensionObject::IsDimensionalSize(
|
||||
const XCAFDimTolObjects_DimensionType theType)
|
||||
{
|
||||
if (theType == XCAFDimTolObjects_DimensionType_Size_CurveLength
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_Diameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_SphericalDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_Radius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_SphericalRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_Thickness)
|
||||
return true;
|
||||
return false;
|
||||
return theType == XCAFDimTolObjects_DimensionType_Size_CurveLength
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_Diameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_SphericalDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_Radius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_SphericalRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius
|
||||
|| theType == XCAFDimTolObjects_DimensionType_Size_Thickness;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -45,9 +45,7 @@ bool XCAFDoc_ClippingPlaneTool::IsClippingPlane(const TDF_Label& theLabel) const
|
||||
return false;
|
||||
|
||||
occ::handle<TDataXtd_Plane> aPlaneAttribute;
|
||||
if (!theLabel.FindAttribute(TDataXtd_Plane::GetID(), aPlaneAttribute))
|
||||
return false;
|
||||
return true;
|
||||
return theLabel.FindAttribute(TDataXtd_Plane::GetID(), aPlaneAttribute);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -118,7 +116,7 @@ TDF_Label XCAFDoc_ClippingPlaneTool::AddClippingPlane(
|
||||
|
||||
// create a new clipping plane entry
|
||||
TDF_TagSource aTag;
|
||||
aLabel = aTag.NewChild(Label());
|
||||
aLabel = TDF_TagSource::NewChild(Label());
|
||||
|
||||
TDataXtd_Plane::Set(aLabel, thePlane);
|
||||
if (!theName.IsEmpty())
|
||||
|
||||
@@ -162,7 +162,7 @@ TDF_Label XCAFDoc_ColorTool::AddColor(const Quantity_ColorRGBA& theColor) const
|
||||
|
||||
// create a new color entry
|
||||
TDF_TagSource aTag;
|
||||
aLab = aTag.NewChild(Label());
|
||||
aLab = TDF_TagSource::NewChild(Label());
|
||||
XCAFDoc_Color::Set(aLab, theColor);
|
||||
|
||||
if (XCAFDoc_ColorTool_AutoNaming)
|
||||
|
||||
@@ -88,11 +88,7 @@ const occ::handle<XCAFDoc_ShapeTool>& XCAFDoc_DimTolTool::ShapeTool()
|
||||
bool XCAFDoc_DimTolTool::IsDimTol(const TDF_Label& theDimTolL) const
|
||||
{
|
||||
occ::handle<XCAFDoc_DimTol> aDimTolAttr;
|
||||
if (theDimTolL.FindAttribute(XCAFDoc_DimTol::GetID(), aDimTolAttr))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return theDimTolL.FindAttribute(XCAFDoc_DimTol::GetID(), aDimTolAttr);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -100,11 +96,7 @@ bool XCAFDoc_DimTolTool::IsDimTol(const TDF_Label& theDimTolL) const
|
||||
bool XCAFDoc_DimTolTool::IsDimension(const TDF_Label& theDimTolL) const
|
||||
{
|
||||
occ::handle<XCAFDoc_Dimension> aDimTolAttr;
|
||||
if (theDimTolL.FindAttribute(XCAFDoc_Dimension::GetID(), aDimTolAttr))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return theDimTolL.FindAttribute(XCAFDoc_Dimension::GetID(), aDimTolAttr);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -112,11 +104,7 @@ bool XCAFDoc_DimTolTool::IsDimension(const TDF_Label& theDimTolL) const
|
||||
bool XCAFDoc_DimTolTool::IsGeomTolerance(const TDF_Label& theDimTolL) const
|
||||
{
|
||||
occ::handle<XCAFDoc_GeomTolerance> aDimTolAttr;
|
||||
if (theDimTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aDimTolAttr))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return theDimTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aDimTolAttr);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -232,7 +220,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDimTol(
|
||||
{
|
||||
TDF_Label DimTolL;
|
||||
TDF_TagSource aTag;
|
||||
DimTolL = aTag.NewChild(Label());
|
||||
DimTolL = TDF_TagSource::NewChild(Label());
|
||||
XCAFDoc_DimTol::Set(DimTolL, kind, aVal, aName, aDescription);
|
||||
TCollection_AsciiString str = "DGT:";
|
||||
if (kind < 20)
|
||||
@@ -249,7 +237,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDimension()
|
||||
{
|
||||
TDF_Label aDimTolL;
|
||||
TDF_TagSource aTag;
|
||||
aDimTolL = aTag.NewChild(Label());
|
||||
aDimTolL = TDF_TagSource::NewChild(Label());
|
||||
occ::handle<XCAFDoc_Dimension> aDim = XCAFDoc_Dimension::Set(aDimTolL);
|
||||
TCollection_AsciiString aStr = "DGT:Dimension";
|
||||
TDataStd_Name::Set(aDimTolL, aStr);
|
||||
@@ -262,7 +250,7 @@ TDF_Label XCAFDoc_DimTolTool::AddGeomTolerance()
|
||||
{
|
||||
TDF_Label aDimTolL;
|
||||
TDF_TagSource aTag;
|
||||
aDimTolL = aTag.NewChild(Label());
|
||||
aDimTolL = TDF_TagSource::NewChild(Label());
|
||||
occ::handle<XCAFDoc_GeomTolerance> aTol = XCAFDoc_GeomTolerance::Set(aDimTolL);
|
||||
TCollection_AsciiString aStr = "DGT:Tolerance";
|
||||
TDataStd_Name::Set(aDimTolL, aStr);
|
||||
@@ -335,7 +323,7 @@ void XCAFDoc_DimTolTool::SetDimension(const NCollection_Sequence<TDF_Label>& the
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
|
||||
aChGNode->SetGraphID(XCAFDoc::DimensionRefFirstGUID());
|
||||
}
|
||||
for (int i = theFirstL.Lower(); i <= theFirstL.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<TDF_Label>::Lower(); i <= theFirstL.Upper(); i++)
|
||||
{
|
||||
if (!theFirstL.Value(i).FindAttribute(XCAFDoc::DimensionRefFirstGUID(), aFGNode))
|
||||
{
|
||||
@@ -354,7 +342,7 @@ void XCAFDoc_DimTolTool::SetDimension(const NCollection_Sequence<TDF_Label>& the
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
|
||||
aChGNode->SetGraphID(XCAFDoc::DimensionRefSecondGUID());
|
||||
}
|
||||
for (int i = theSecondL.Lower(); i <= theSecondL.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<TDF_Label>::Lower(); i <= theSecondL.Upper(); i++)
|
||||
{
|
||||
if (!theSecondL.Value(i).FindAttribute(XCAFDoc::DimensionRefSecondGUID(), aSecondFGNode))
|
||||
{
|
||||
@@ -414,7 +402,7 @@ void XCAFDoc_DimTolTool::SetGeomTolerance(const NCollection_Sequence<TDF_Label>&
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theGeomTolL);
|
||||
aChGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID());
|
||||
}
|
||||
for (int i = theL.Lower(); i <= theL.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<TDF_Label>::Lower(); i <= theL.Upper(); i++)
|
||||
{
|
||||
if (!theL.Value(i).FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aFGNode))
|
||||
{
|
||||
@@ -600,11 +588,7 @@ bool XCAFDoc_DimTolTool::GetDimTol(const TDF_Label& Dim
|
||||
bool XCAFDoc_DimTolTool::IsDatum(const TDF_Label& theDimTolL) const
|
||||
{
|
||||
occ::handle<XCAFDoc_Datum> aDatumAttr;
|
||||
if (theDimTolL.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return theDimTolL.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr);
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -656,7 +640,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDatum(
|
||||
{
|
||||
TDF_Label DatumL;
|
||||
TDF_TagSource aTag;
|
||||
DatumL = aTag.NewChild(Label());
|
||||
DatumL = TDF_TagSource::NewChild(Label());
|
||||
XCAFDoc_Datum::Set(DatumL, aName, aDescription, anIdentification);
|
||||
TDataStd_Name::Set(DatumL, "DGT:Datum");
|
||||
return DatumL;
|
||||
@@ -668,7 +652,7 @@ TDF_Label XCAFDoc_DimTolTool::AddDatum()
|
||||
{
|
||||
TDF_Label aDatumL;
|
||||
TDF_TagSource aTag;
|
||||
aDatumL = aTag.NewChild(Label());
|
||||
aDatumL = TDF_TagSource::NewChild(Label());
|
||||
occ::handle<XCAFDoc_Datum> aDat = XCAFDoc_Datum::Set(aDatumL);
|
||||
TDataStd_Name::Set(aDatumL, "DGT:Datum");
|
||||
return aDatumL;
|
||||
@@ -705,7 +689,7 @@ void XCAFDoc_DimTolTool::SetDatum(const NCollection_Sequence<TDF_Label>& theL,
|
||||
aChGNode = XCAFDoc_GraphNode::Set(theDatumL);
|
||||
aChGNode->SetGraphID(XCAFDoc::DatumRefGUID());
|
||||
}
|
||||
for (int i = theL.Lower(); i <= theL.Upper(); i++)
|
||||
for (int i = NCollection_Sequence<TDF_Label>::Lower(); i <= theL.Upper(); i++)
|
||||
{
|
||||
if (!theL.Value(i).FindAttribute(XCAFDoc::DatumRefGUID(), aFGNode))
|
||||
{
|
||||
|
||||
@@ -240,18 +240,14 @@ int XCAFDoc_GraphNode::ChildIndex(const occ::handle<XCAFDoc_GraphNode>& Ch) cons
|
||||
|
||||
bool XCAFDoc_GraphNode::IsFather(const occ::handle<XCAFDoc_GraphNode>& Ch) const
|
||||
{
|
||||
if (ChildIndex(Ch))
|
||||
return true;
|
||||
return false;
|
||||
return ChildIndex(Ch) != 0;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
bool XCAFDoc_GraphNode::IsChild(const occ::handle<XCAFDoc_GraphNode>& F) const
|
||||
{
|
||||
if (FatherIndex(F))
|
||||
return true;
|
||||
return false;
|
||||
return FatherIndex(F) != 0;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
@@ -141,7 +141,7 @@ TDF_Label XCAFDoc_LayerTool::AddLayer(const TCollection_ExtendedString& theLayer
|
||||
if (FindLayer(theLayer, lab))
|
||||
return lab;
|
||||
TDF_TagSource aTag;
|
||||
TDF_Label aLabel = aTag.NewChild(Label());
|
||||
TDF_Label aLabel = TDF_TagSource::NewChild(Label());
|
||||
occ::handle<TDataStd_Name> aName = new TDataStd_Name;
|
||||
aName->Set(aLabel, theLayer);
|
||||
return aLabel;
|
||||
@@ -156,7 +156,7 @@ TDF_Label XCAFDoc_LayerTool::AddLayer(const TCollection_ExtendedString& theLayer
|
||||
if (!lab.IsNull())
|
||||
return lab;
|
||||
TDF_TagSource aTag;
|
||||
TDF_Label aLabel = aTag.NewChild(Label());
|
||||
TDF_Label aLabel = TDF_TagSource::NewChild(Label());
|
||||
occ::handle<TDataStd_Name> aName = new TDataStd_Name;
|
||||
aName->Set(aLabel, theLayer);
|
||||
return aLabel;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user