The <oda:condition> means "if" in programming. It has two attributes:
<xs:element name="someNameElement" type="xs:boolean" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue=">0">
...
</oda:condition>
<xs:element name="someNameElement" type="xs:int" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue="<0">
...
</oda:condition>
<xs:element name="someNameElement" type="xs:int" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue="!0">
...
</oda:condition>
<xs:element name="someNameElement" type="xs:int" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue="0">
...
</oda:condition>
<xs:element name="someNameElement" type="xs:boolean" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue="true">
...
</oda:condition>
<xs:element name="someNameElement" type="xs:int" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue="*3">
...
</oda:condition>
<xs:element name="someNameElement" type="xs:int" oda:isCondition=""/>
<oda:condition name="someNameElement" oda:conditionValue="!*3">
...
</oda:condition>
Useful extra attributes for <oda:condition>:
bool bEntry = pFiler->rdBool();
bool bEntry_2 = false;
if(bEntry)
{
bEntry_2 = pFiler->rdBool();
}
if(bEntry_2)
{
tolerance = pFiler->rdDouble();
}
<xs:element name="bEntry" type="xs:boolean" oda:isCondition/>
<oda:condition name="bEntry" oda:conditionValue="true">
<xs:element name="bEntry_2" type="xs:boolean" oda:isCondition/>
</oda:condition>
<oda:condition name=" bEntry_2" oda:conditionValue="true" oda:isMarkCondition="">
<xs:element name="tolerance " type="xs:double"/>
</oda:condition>
void OdChildClass::dwgOutFields(OdDbDwgFiler* pFiler) const
{
OdBaseClass::dwgOutFields(pFiler);
//Do something
}
void OdBaseClass::dwgOutFields(OdDbDwgFiler* pFiler) const
{
if(strcmp(this->isA()->name(), "OdChildClass") == 0)
{
//Do something
}
//Do something
}
<xs:complexType name=" OdChildClass" oda:version="1.0">
<xs:complexContent>
<xs:extension base=" OdBaseClass ">
<xs:sequence>
//Do something
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name=" OdBaseClass" oda:version="1.0">
<xs:sequence>
<oda:condition name="empty" oda:conditionValue="true" oda:isMarkCondition="" oda:isOwner=" OdChildClass">
//Do something
</oda:condition>
//Do something
</xs:sequence>
</xs:complexType>
To place a value into the cache, you must use the " oda:isCondition="" " attribute for the "xs:element" tag. This attribute marks only an xs:element tag that has one of the following types:
You don't need to set a value to this attribute. It should be empty.
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.
|