![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <NodeImpl.h>


Public Member Functions | |
| virtual NodeType | type () const =0 |
| void | checkImageFileOpen (const char *srcFileName, int srcLineNumber, const char *srcFunctionName) const |
| virtual bool | isTypeEquivalent (NodeImplSharedPtr ni)=0 |
| bool | isRoot () const |
| NodeImplSharedPtr | parent () |
| ustring | pathName () const |
| ustring | relativePathName (const NodeImplSharedPtr &origin, ustring childPathName=ustring()) const |
| ustring | elementName () const |
| ImageFileImplSharedPtr | destImageFile () |
| ustring | imageFileName () const |
| virtual bool | isDefined (const ustring &pathName)=0 |
| bool | isAttached () const |
| virtual void | setAttachedRecursive () |
| void | setParent (NodeImplSharedPtr parent, const ustring &elementName) |
| bool | isTypeConstrained () |
| virtual NodeImplSharedPtr | get (const ustring &pathName) |
| virtual void | set (const ustring &pathName, NodeImplSharedPtr ni, bool autoPathCreate=false) |
| virtual void | set (const StringList &fields, unsigned level, NodeImplSharedPtr ni, bool autoPathCreate=false) |
| virtual void | checkLeavesInSet (const StringSet &pathNames, NodeImplSharedPtr origin)=0 |
| void | checkBuffers (const std::vector< SourceDestBuffer > &sdbufs, bool allowMissing) |
| bool | findTerminalPosition (const NodeImplSharedPtr &target, uint64_t &countFromLeft) |
| virtual void | writeXml (ImageFileImplSharedPtr imf, CheckedFile &cf, int indent, const char *forcedFieldName=nullptr)=0 |
| virtual | ~NodeImpl ()=default |
| virtual void | dump (int indent=0, std::ostream &os=std::cout) const |
Protected Member Functions | |
| NodeImpl (ImageFileImplWeakPtr destImageFile) | |
| NodeImpl & | operator= (NodeImpl &n) |
| virtual NodeImplSharedPtr | lookup (const ustring &) |
| NodeImplSharedPtr | getRoot () |
Protected Attributes | |
| ImageFileImplWeakPtr | destImageFile_ |
| NodeImplWeakPtr | parent_ |
| ustring | elementName_ |
| bool | isAttached_ |
Definition at line 37 of file NodeImpl.h.
|
virtualdefault |
|
protected |
Definition at line 35 of file NodeImpl.cpp.
References checkImageFileOpen().
| void NodeImpl::checkBuffers | ( | const std::vector< SourceDestBuffer > & | sdbufs, |
| bool | allowMissing | ||
| ) |
this node is prototype of CompressedVector
don't checkImageFileOpen
Check that all buffers are same size
Add each pathName to set, error if already in set (a duplicate pathName in sdbufs)
Check no bad fields in sdbufs
Traverse tree recursively, checking that all nodes are listed in sdbufs
Definition at line 271 of file NodeImpl.cpp.
References checkLeavesInSet(), e57::E57_ERROR_BUFFER_DUPLICATE_PATHNAME, e57::E57_ERROR_BUFFER_SIZE_MISMATCH, e57::E57_ERROR_PATH_UNDEFINED, E57_EXCEPTION2, isDefined(), pathName(), and e57::toString().
| void NodeImpl::checkImageFileOpen | ( | const char * | srcFileName, |
| int | srcLineNumber, | ||
| const char * | srcFunctionName | ||
| ) | const |
Throw an exception if destImageFile (destImageFile_) isn't open
Definition at line 41 of file NodeImpl.cpp.
References destImageFile(), destImageFile_, and e57::E57_ERROR_IMAGEFILE_NOT_OPEN.
Referenced by e57::VectorNodeImpl::allowHeteroChildren(), e57::BlobNodeImpl::byteCount(), e57::CompressedVectorNodeImpl::childCount(), e57::StructureNodeImpl::childCount(), elementName(), e57::StructureNodeImpl::get(), e57::CompressedVectorNodeImpl::getCodecs(), e57::CompressedVectorNodeImpl::getPrototype(), isAttached(), e57::StructureNodeImpl::isDefined(), isRoot(), e57::IntegerNodeImpl::maximum(), e57::ScaledIntegerNodeImpl::maximum(), e57::FloatNodeImpl::maximum(), e57::IntegerNodeImpl::minimum(), e57::ScaledIntegerNodeImpl::minimum(), e57::FloatNodeImpl::minimum(), NodeImpl(), e57::ScaledIntegerNodeImpl::offset(), parent(), pathName(), e57::FloatNodeImpl::precision(), e57::ScaledIntegerNodeImpl::rawValue(), e57::BlobNodeImpl::read(), e57::CompressedVectorNodeImpl::reader(), relativePathName(), e57::ScaledIntegerNodeImpl::scale(), e57::ScaledIntegerNodeImpl::scaledMaximum(), e57::ScaledIntegerNodeImpl::scaledMinimum(), e57::ScaledIntegerNodeImpl::scaledValue(), e57::StructureNodeImpl::set(), e57::VectorNodeImpl::set(), e57::StructureNodeImpl::StructureNodeImpl(), e57::IntegerNodeImpl::value(), e57::StringNodeImpl::value(), e57::FloatNodeImpl::value(), e57::BlobNodeImpl::write(), and e57::CompressedVectorNodeImpl::writer().
|
pure virtual |
Implemented in e57::StructureNodeImpl, e57::StringNodeImpl, e57::ScaledIntegerNodeImpl, e57::IntegerNodeImpl, e57::FloatNodeImpl, e57::CompressedVectorNodeImpl, and e57::BlobNodeImpl.
Referenced by checkBuffers().
| ImageFileImplSharedPtr NodeImpl::destImageFile | ( | ) |
don't checkImageFileOpen
Definition at line 126 of file NodeImpl.cpp.
References destImageFile_.
Referenced by e57::BlobNodeImpl::BlobNodeImpl(), checkImageFileOpen(), e57::CompressedVectorNodeImpl::reader(), e57::StructureNodeImpl::set(), e57::CompressedVectorNodeImpl::setCodecs(), e57::CompressedVectorNodeImpl::setPrototype(), e57::BlobNodeImpl::write(), and e57::CompressedVectorNodeImpl::writer().
|
virtual |
don't checkImageFileOpen
Reimplemented in e57::VectorNodeImpl, e57::StructureNodeImpl, e57::StringNodeImpl, e57::ScaledIntegerNodeImpl, e57::IntegerNodeImpl, e57::FloatNodeImpl, e57::CompressedVectorNodeImpl, and e57::BlobNodeImpl.
Definition at line 372 of file NodeImpl.cpp.
References elementName_, QtCompat::endl(), isAttached_, pathName(), and e57::space().
Referenced by e57::BlobNodeImpl::dump(), e57::CompressedVectorNodeImpl::dump(), e57::FloatNodeImpl::dump(), e57::IntegerNodeImpl::dump(), e57::ScaledIntegerNodeImpl::dump(), e57::StringNodeImpl::dump(), e57::StructureNodeImpl::dump(), and e57::VectorNodeImpl::dump().
| ustring NodeImpl::elementName | ( | ) | const |
Definition at line 119 of file NodeImpl.cpp.
References checkImageFileOpen(), and elementName_.
Referenced by relativePathName(), e57::StructureNodeImpl::set(), and setParent().
| bool NodeImpl::findTerminalPosition | ( | const NodeImplSharedPtr & | target, |
| uint64_t & | countFromLeft | ||
| ) |
don't checkImageFileOpen
Recursively visit child nodes
Recursively visit child nodes
Definition at line 313 of file NodeImpl.cpp.
References e57::StructureNodeImpl::childCount(), e57::E57_BLOB, e57::E57_COMPRESSED_VECTOR, e57::E57_FLOAT, e57::E57_INTEGER, e57::E57_SCALED_INTEGER, e57::E57_STRING, e57::E57_STRUCTURE, e57::E57_VECTOR, and type().
|
virtual |
This is common virtual function for terminal E57 element types: Integer, ScaledInteger, Float, Blob. The non-terminal types override this virtual function. Only absolute pathNames make any sense here, because the terminal types can't have children, so relative pathNames are illegal.
Forward call to the non-terminal root node
Reimplemented in e57::StructureNodeImpl.
Definition at line 233 of file NodeImpl.cpp.
References pathName().
|
protected |
don't checkImageFileOpen
Definition at line 182 of file NodeImpl.cpp.
Referenced by e57::StructureNodeImpl::lookup(), and e57::StructureNodeImpl::set().
| ustring NodeImpl::imageFileName | ( | ) | const |
| bool NodeImpl::isAttached | ( | ) | const |
Definition at line 132 of file NodeImpl.cpp.
References checkImageFileOpen(), and isAttached_.
Referenced by e57::CompressedVectorNodeImpl::reader(), e57::BlobNodeImpl::write(), and e57::CompressedVectorNodeImpl::writer().
|
pure virtual |
Implemented in e57::StructureNodeImpl, e57::StringNodeImpl, e57::ScaledIntegerNodeImpl, e57::IntegerNodeImpl, e57::FloatNodeImpl, e57::CompressedVectorNodeImpl, and e57::BlobNodeImpl.
Referenced by checkBuffers().
| bool NodeImpl::isRoot | ( | ) | const |
Definition at line 52 of file NodeImpl.cpp.
References checkImageFileOpen(), and parent_.
Referenced by e57::StructureNodeImpl::lookup(), parent(), pathName(), relativePathName(), and e57::StructureNodeImpl::writeXml().
| bool NodeImpl::isTypeConstrained | ( | ) |
don't checkImageFileOpen A node is type constrained if any of its parents is an homo VECTOR or COMPRESSED_VECTOR with more than one child
We have a parent since we are not root
Downcast to shared_ptr<VectorNodeImpl>
If homogenous vector and have more than one child, then can't change them
Can't make any type changes to CompressedVector prototype. ??? what if hasn't been written to yet
Didn't find any constraining VECTORs or COMPRESSED_VECTORs in path above us, so our type is not constrained.
Definition at line 195 of file NodeImpl.cpp.
References e57::E57_COMPRESSED_VECTOR, and e57::E57_VECTOR.
Referenced by e57::StructureNodeImpl::set().
|
pure virtual |
|
inlineprotectedvirtual |
Reimplemented in e57::StructureNodeImpl.
Definition at line 88 of file NodeImpl.h.
| NodeImplSharedPtr NodeImpl::parent | ( | ) |
If is root, then has self as parent (by convention)
Definition at line 59 of file NodeImpl.cpp.
References checkImageFileOpen(), isRoot(), and parent_.
Referenced by setParent().
| ustring NodeImpl::pathName | ( | ) | const |
Definition at line 74 of file NodeImpl.cpp.
References checkImageFileOpen(), elementName_, isRoot(), and parent_.
Referenced by checkBuffers(), e57::BlobNodeImpl::checkLeavesInSet(), e57::CompressedVectorNodeImpl::checkLeavesInSet(), e57::FloatNodeImpl::checkLeavesInSet(), e57::IntegerNodeImpl::checkLeavesInSet(), e57::ScaledIntegerNodeImpl::checkLeavesInSet(), e57::StringNodeImpl::checkLeavesInSet(), dump(), e57::FloatNodeImpl::FloatNodeImpl(), get(), e57::StructureNodeImpl::get(), e57::IntegerNodeImpl::IntegerNodeImpl(), e57::BlobNodeImpl::isDefined(), e57::CompressedVectorNodeImpl::isDefined(), e57::FloatNodeImpl::isDefined(), e57::IntegerNodeImpl::isDefined(), e57::ScaledIntegerNodeImpl::isDefined(), e57::StringNodeImpl::isDefined(), e57::StructureNodeImpl::isDefined(), e57::StructureNodeImpl::lookup(), e57::BlobNodeImpl::read(), e57::ScaledIntegerNodeImpl::ScaledIntegerNodeImpl(), set(), e57::StructureNodeImpl::set(), e57::VectorNodeImpl::set(), e57::CompressedVectorNodeImpl::setCodecs(), setParent(), e57::CompressedVectorNodeImpl::setPrototype(), and e57::BlobNodeImpl::write().
| ustring NodeImpl::relativePathName | ( | const NodeImplSharedPtr & | origin, |
| ustring | childPathName = ustring() |
||
| ) | const |
Got to top and didn't find origin, must be error
Assemble relativePathName from right to left, recursively
Definition at line 93 of file NodeImpl.cpp.
References checkImageFileOpen(), e57::E57_ERROR_INTERNAL, E57_EXCEPTION2, elementName(), elementName_, isRoot(), and parent_.
Referenced by e57::BlobNodeImpl::checkLeavesInSet(), e57::FloatNodeImpl::checkLeavesInSet(), e57::IntegerNodeImpl::checkLeavesInSet(), e57::ScaledIntegerNodeImpl::checkLeavesInSet(), and e57::StringNodeImpl::checkLeavesInSet().
|
virtual |
If get here, then tried to call set(fields...) on NodeImpl that wasn't a StructureNodeImpl, so that's an error
Reimplemented in e57::StructureNodeImpl.
Definition at line 263 of file NodeImpl.cpp.
References e57::E57_ERROR_BAD_PATH_NAME, and E57_EXCEPTION1.
|
virtual |
This is common virtual function for terminal E57 element types: Integer, ScaledInteger, Float, Blob. The non-terminal types override this virtual function. Only absolute pathNames make any sense here, because the terminal types can't have children, so relative pathNames are illegal.
Forward call to the non-terminal root node
Reimplemented in e57::StructureNodeImpl.
Definition at line 248 of file NodeImpl.cpp.
References pathName().
|
virtual |
Non-terminal node types (Structure, Vector, CompressedVector) will override this virtual function, to mark their children, codecs, prototypes
Reimplemented in e57::StructureNodeImpl, and e57::CompressedVectorNodeImpl.
Definition at line 139 of file NodeImpl.cpp.
References isAttached_.
Referenced by setParent().
| void NodeImpl::setParent | ( | NodeImplSharedPtr | parent, |
| const ustring & | elementName | ||
| ) |
don't checkImageFileOpen
First check if our parent_ is already set, throw E57_ERROR_ALREADY_HAS_PARENT The isAttached_ condition is to catch two errors: 1) if user attempts to use the ImageFile root as a child (e.g. root.set("x", root)) 2) if user attempts to reuse codecs or prototype trees of a CompressedVectorNode ??? what if CV not attached yet?
??? does caller do setParent first, so state is not messed up when throw?
If parent is attached then we are attached (and all of our children)
Definition at line 155 of file NodeImpl.cpp.
References e57::E57_ERROR_ALREADY_HAS_PARENT, E57_EXCEPTION2, elementName(), elementName_, isAttached_, parent(), parent_, pathName(), and setAttachedRecursive().
|
pure virtual |
Implemented in e57::VectorNodeImpl, e57::StructureNodeImpl, e57::StringNodeImpl, e57::ScaledIntegerNodeImpl, e57::IntegerNodeImpl, e57::FloatNodeImpl, e57::CompressedVectorNodeImpl, and e57::BlobNodeImpl.
Referenced by findTerminalPosition().
|
pure virtual |
|
protected |
Definition at line 94 of file NodeImpl.h.
Referenced by checkImageFileOpen(), destImageFile(), imageFileName(), e57::StructureNodeImpl::lookup(), e57::BlobNodeImpl::read(), e57::CompressedVectorNodeImpl::reader(), e57::StructureNodeImpl::set(), e57::BlobNodeImpl::write(), and e57::CompressedVectorNodeImpl::writer().
|
protected |
Definition at line 96 of file NodeImpl.h.
Referenced by dump(), elementName(), pathName(), relativePathName(), setParent(), e57::BlobNodeImpl::writeXml(), e57::CompressedVectorNodeImpl::writeXml(), e57::FloatNodeImpl::writeXml(), e57::IntegerNodeImpl::writeXml(), e57::ScaledIntegerNodeImpl::writeXml(), e57::StringNodeImpl::writeXml(), e57::StructureNodeImpl::writeXml(), and e57::VectorNodeImpl::writeXml().
|
protected |
Definition at line 97 of file NodeImpl.h.
Referenced by dump(), isAttached(), setAttachedRecursive(), e57::CompressedVectorNodeImpl::setAttachedRecursive(), e57::StructureNodeImpl::setAttachedRecursive(), and setParent().
|
protected |
Definition at line 95 of file NodeImpl.h.
Referenced by isRoot(), parent(), pathName(), relativePathName(), and setParent().