KiCad PCB EDA Suite
Loading...
Searching...
No Matches
data_block.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2025 Mark Roszko <
[email protected]
>
3
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
4
* Copyright (C) 2007 Ecma International (original Java source)
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*
18
* License info found here:
19
* https://www.loc.gov/preservation/digital/formats/fdd/fdd000491.shtml
20
*/
21
22
#include "
data_block.h
"
23
24
using namespace
U3D
;
25
26
27
DATA_BLOCK::DATA_BLOCK
()
28
{
29
m_dataSize
= 0;
30
m_metaDataSize
= 0;
31
m_blockType
= 0;
32
m_priority
= 0;
33
}
34
35
36
void
DATA_BLOCK::SetDataSize
( uint32_t aSize )
37
{
38
m_dataSize
= aSize;
39
if
( (
m_dataSize
& 0x3 ) == 0 )
40
{
41
m_data
.resize( aSize >> 2 );
42
}
43
else
44
{
45
m_data
.resize( ( aSize >> 2 ) + 1 );
46
}
47
}
48
49
50
void
DATA_BLOCK::SetMetaDataSize
( uint32_t aSize )
51
{
52
m_metaDataSize
= aSize;
53
if
( (
m_metaDataSize
& 0x3 ) == 0 )
54
{
55
m_metaData
.resize( aSize >> 2 );
56
}
57
else
58
{
59
m_metaData
.resize( ( aSize >> 2 ) + 1 );
60
}
61
}
62
63
64
void
DATA_BLOCK::SetMetaData
(
const
std::vector<uint32_t>& aValue )
65
{
66
if
( aValue.size() ==
m_metaData
.size() )
67
{
68
std::copy( aValue.begin(), aValue.end(),
m_metaData
.begin() );
69
}
70
}
U3D::DATA_BLOCK::SetMetaData
void SetMetaData(const std::vector< uint32_t > &aValue)
Definition
data_block.cpp:64
U3D::DATA_BLOCK::SetMetaDataSize
void SetMetaDataSize(uint32_t aSize)
Definition
data_block.cpp:50
U3D::DATA_BLOCK::m_data
std::vector< uint32_t > m_data
Definition
data_block.h:73
U3D::DATA_BLOCK::m_dataSize
uint32_t m_dataSize
Definition
data_block.h:74
U3D::DATA_BLOCK::m_metaData
std::vector< uint32_t > m_metaData
Definition
data_block.h:75
U3D::DATA_BLOCK::DATA_BLOCK
DATA_BLOCK()
Definition
data_block.cpp:27
U3D::DATA_BLOCK::m_priority
uint32_t m_priority
Definition
data_block.h:77
U3D::DATA_BLOCK::m_blockType
uint32_t m_blockType
Definition
data_block.h:78
U3D::DATA_BLOCK::SetDataSize
void SetDataSize(uint32_t aSize)
Definition
data_block.cpp:36
U3D::DATA_BLOCK::m_metaDataSize
uint32_t m_metaDataSize
Definition
data_block.h:76
data_block.h
U3D
Definition
bit_stream_writer.h:32
src
pcbnew
exporters
u3d
data_block.cpp
Generated on Sun Sep 21 2025 01:05:28 for KiCad PCB EDA Suite by
1.13.2