CFx SDK Documentation
2026 SP0
Loading...
Searching...
No Matches
SDK
CFx
dd_inc
Tr
vec
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
34
struct
OdTrVecLightDef
:
public
OdTrVisLightDef
35
{
OdUInt32
m_nDuplicate
;
36
OdString
m_webFile
;
37
OdStreamBufPtr
m_pWebStream
;
38
enum
{
kOverrideDuplicate
=
kLastOverride
<< 1,
39
kOverrideWebFile
=
kLastOverride
<< 2,
40
kOverrideWebStream
=
kLastOverride
<< 3
41
};
42
void
setDefault
()
43
{
44
OdTrVisLightDef::setDefault
();
45
m_nDuplicate
= 0;
m_webFile
=
OdString::kEmpty
;
46
if
(!
m_pWebStream
.isNull())
47
m_pWebStream
->release();
48
}
49
OdTrVecLightDef
&
apply
(
OdUInt32
nMod,
const
OdTrVecLightDef
&l)
50
{
if
(nMod != 0xFFFFFFFF)
51
{
OdTrVisLightDef::apply
(nMod, l);
52
if
(
GETBIT
(nMod,
kOverrideDuplicate
))
53
m_nDuplicate
= l.
m_nDuplicate
;
54
if
(
GETBIT
(nMod,
kOverrideWebFile
))
55
m_webFile
= l.
m_webFile
;
56
if
(
GETBIT
(nMod,
kOverrideWebStream
))
57
m_pWebStream
= l.
m_pWebStream
;
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;
69
SETBIT_1
(axxum,
kOverrideDuplicate
);
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
OdStreamBufPtr
OdSmartPtr< OdStreamBuf > OdStreamBufPtr
Definition
DbPageController.h:36
OdUInt32
unsigned int OdUInt32
Definition
OdPlatformSettings.h:768
GETBIT
#define GETBIT(flags, bit)
Definition
OdaDefs.h:517
SETBIT_1
#define SETBIT_1(flags, bit)
Definition
OdaDefs.h:520
TrVisDefs.h
TrVisLightDef.h
OdBaseObjectPtr::isNull
bool isNull() const
Definition
BaseObjectPtr.h:86
OdStreamBuf::length
virtual OdUInt64 length()
OdString
Definition
OdString.h:97
OdString::kEmpty
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition
OdString.h:100
OdTrVecLightDef
Definition
TrVecDefs.h:35
OdTrVecLightDef::m_nDuplicate
OdUInt32 m_nDuplicate
Definition
TrVecDefs.h:35
OdTrVecLightDef::m_webFile
OdString m_webFile
Definition
TrVecDefs.h:36
OdTrVecLightDef::apply
OdTrVecLightDef & apply(OdUInt32 nMod, const OdTrVecLightDef &l)
Definition
TrVecDefs.h:49
OdTrVecLightDef::setDefault
void setDefault()
Definition
TrVecDefs.h:42
OdTrVecLightDef::operator==
bool operator==(const OdTrVecLightDef &dl2) const
Definition
TrVecDefs.h:96
OdTrVecLightDef::kOverrideWebStream
@ kOverrideWebStream
Definition
TrVecDefs.h:40
OdTrVecLightDef::kOverrideWebFile
@ kOverrideWebFile
Definition
TrVecDefs.h:39
OdTrVecLightDef::kOverrideDuplicate
@ kOverrideDuplicate
Definition
TrVecDefs.h:38
OdTrVecLightDef::m_pWebStream
OdStreamBufPtr m_pWebStream
Definition
TrVecDefs.h:37
OdTrVecLightDef::operator!=
bool operator!=(const OdTrVecLightDef &dl2) const
Definition
TrVecDefs.h:98
OdTrVecLightDef::diff
OdUInt32 diff(const OdTrVecLightDef &dl2, bool bFinFirstDiff=false) const
Definition
TrVecDefs.h:61
OdTrVisLightDef
Definition
TrVisLightDef.h:39
OdTrVisLightDef::kLastOverride
@ kLastOverride
Definition
TrVisLightDef.h:59
OdTrVisLightDef::diff
OdUInt32 diff(const OdTrVisLightDef &dl2, bool bFinFirstDiff=false) const
Definition
TrVisLightDef.h:166
OdTrVisLightDef::apply
OdTrVisLightDef & apply(OdUInt32 nMod, const OdTrVisLightDef &l)
Definition
TrVisLightDef.h:129
OdTrVisLightDef::setDefault
void setDefault()
Definition
TrVisLightDef.h:107
Generated on Tue Apr 15 2025 11:30:07