CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TrVecDefs.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23// GLES2 device definitions
24
25#ifndef ODBASETRVECDEVICEDEFINITIONS
26#define ODBASETRVECDEVICEDEFINITIONS
27
28#include "../TrVisDefs.h"
29#include "../TrVisLightDef.h"
30
41 };
43 {
46 if (!m_pWebStream.isNull())
47 m_pWebStream->release();
48 }
50 { if (nMod != 0xFFFFFFFF)
51 { OdTrVisLightDef::apply(nMod, l);
52 if (GETBIT(nMod, kOverrideDuplicate))
54 if (GETBIT(nMod, kOverrideWebFile))
56 if (GETBIT(nMod, kOverrideWebStream))
58 } else
59 *this = l;
60 return *this; }
61 OdUInt32 diff(const OdTrVecLightDef &dl2, bool bFinFirstDiff = false) const
62 {
63 OdUInt32 axxum = OdTrVisLightDef::diff(dl2, bFinFirstDiff);
64 if (axxum != 0xFFFFFFFF)
65 {
66 if (m_nDuplicate != dl2.m_nDuplicate)
67 { if (bFinFirstDiff)
68 return 0xFFFFFFFF;
70 }
71 if (m_webFile != dl2.m_webFile)
72 return (bFinFirstDiff) ? 0xFFFFFFFF : (axxum | kOverrideWebFile);
73 if ((m_pWebStream.isNull() && !dl2.m_pWebStream.isNull()) || (!m_pWebStream.isNull() && dl2.m_pWebStream.isNull()))
74 return (bFinFirstDiff) ? 0xFFFFFFFF : (axxum | kOverrideWebStream);
75 else if (!m_pWebStream.isNull() && !dl2.m_pWebStream.isNull())
76 {
77 if (const_cast<OdTrVecLightDef*>(this)->m_pWebStream->length() != const_cast<OdTrVecLightDef&>(dl2).m_pWebStream->length())
78 return (bFinFirstDiff) ? 0xFFFFFFFF : (axxum | kOverrideWebStream);
79
80 void* pData = NULL; OdUInt32 nBytes = 0;
81 const_cast<OdTrVecLightDef*>(this)->m_pWebStream->getBytes(pData, nBytes);
82 void* pData2 = NULL; OdUInt32 nBytes2 = 0;
83 const_cast<OdTrVecLightDef&>(dl2).m_pWebStream->getBytes(pData2, nBytes2);
84 if (nBytes != nBytes2)
85 return (bFinFirstDiff) ? 0xFFFFFFFF : (axxum | kOverrideWebStream);
86 if (pData != NULL && pData2 != NULL)
87 {
88 char* charPtr1 = static_cast<char*>(pData);
89 char* charPtr2 = static_cast<char*>(pData2);
90 if (strncmp(charPtr1, charPtr2, nBytes) != 0)
91 return (bFinFirstDiff) ? 0xFFFFFFFF : (axxum | kOverrideWebStream);
92 }
93 }
94 }
95 return axxum; }
96 bool operator ==(const OdTrVecLightDef &dl2) const
97 { return diff(dl2, true) == 0; }
98 bool operator !=(const OdTrVecLightDef &dl2) const
99 { return diff(dl2, true) != 0; }
100};
101
102#endif // ODBASETRVECDEVICEDEFINITIONS
OdSmartPtr< OdStreamBuf > OdStreamBufPtr
unsigned int OdUInt32
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
#define SETBIT_1(flags, bit)
Definition OdaDefs.h:520
bool isNull() const
virtual OdUInt64 length()
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition OdString.h:100
OdUInt32 m_nDuplicate
Definition TrVecDefs.h:35
OdString m_webFile
Definition TrVecDefs.h:36
OdTrVecLightDef & apply(OdUInt32 nMod, const OdTrVecLightDef &l)
Definition TrVecDefs.h:49
void setDefault()
Definition TrVecDefs.h:42
bool operator==(const OdTrVecLightDef &dl2) const
Definition TrVecDefs.h:96
OdStreamBufPtr m_pWebStream
Definition TrVecDefs.h:37
bool operator!=(const OdTrVecLightDef &dl2) const
Definition TrVecDefs.h:98
OdUInt32 diff(const OdTrVecLightDef &dl2, bool bFinFirstDiff=false) const
Definition TrVecDefs.h:61
OdUInt32 diff(const OdTrVisLightDef &dl2, bool bFinFirstDiff=false) const
OdTrVisLightDef & apply(OdUInt32 nMod, const OdTrVisLightDef &l)