ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
StructureNodeImpl.h
Go to the documentation of this file.
1 /*
2  * Original work Copyright 2009 - 2010 Kevin Ackley (kackley@gwi.net)
3  * Modified work Copyright 2018 - 2020 Andy Maloney <asmaloney@gmail.com>
4  *
5  * Permission is hereby granted, free of charge, to any person or organization
6  * obtaining a copy of the software and accompanying documentation covered by
7  * this license (the "Software") to use, reproduce, display, distribute,
8  * execute, and transmit the Software, and to prepare derivative works of the
9  * Software, and to permit third-parties to whom the Software is furnished to
10  * do so, all subject to the following:
11  *
12  * The copyright notices in the Software and this entire statement, including
13  * the above license grant, this restriction and the following disclaimer,
14  * must be included in all copies of the Software, in whole or in part, and
15  * all derivative works of the Software, unless such copies or derivative
16  * works are solely in the form of machine-executable object code generated by
17  * a source language processor.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25  * DEALINGS IN THE SOFTWARE.
26  */
27 
28 #pragma once
29 
30 #include "NodeImpl.h"
31 
32 namespace e57
33 {
34 
35  class StructureNodeImpl : public NodeImpl
36  {
37  public:
39  ~StructureNodeImpl() override = default;
40 
41  NodeType type() const override;
42  bool isTypeEquivalent( NodeImplSharedPtr ni ) override;
43  bool isDefined( const ustring &pathName ) override;
44  void setAttachedRecursive() override;
45 
46  virtual int64_t childCount() const;
47 
48  virtual NodeImplSharedPtr get( int64_t index );
49  NodeImplSharedPtr get( const ustring &pathName ) override;
50 
51  virtual void set( int64_t index, NodeImplSharedPtr ni );
52  void set( const ustring &pathName, NodeImplSharedPtr ni, bool autoPathCreate = false ) override;
53  void set( const StringList &fields, unsigned level, NodeImplSharedPtr ni, bool autoPathCreate = false ) override;
54  virtual void append( NodeImplSharedPtr ni );
55 
56  void checkLeavesInSet( const StringSet &pathNames, NodeImplSharedPtr origin ) override;
57 
58  void writeXml( ImageFileImplSharedPtr imf, CheckedFile &cf, int indent,
59  const char *forcedFieldName = nullptr ) override;
60 
61 #ifdef E57_DEBUG
62  void dump( int indent = 0, std::ostream &os = std::cout ) const override;
63 #endif
64 
65  protected:
67  NodeImplSharedPtr lookup( const ustring &pathName ) override;
68 
69  std::vector<NodeImplSharedPtr> children_;
70  };
71 }
std::vector< PCLPointField > fields
ImageFileImplSharedPtr destImageFile()
Definition: NodeImpl.cpp:126
friend class StructureNodeImpl
Definition: NodeImpl.h:81
ustring pathName() const
Definition: NodeImpl.cpp:74
bool isTypeEquivalent(NodeImplSharedPtr ni) override
virtual NodeImplSharedPtr get(int64_t index)
NodeImplSharedPtr lookup(const ustring &pathName) override
virtual void set(int64_t index, NodeImplSharedPtr ni)
void setAttachedRecursive() override
std::vector< NodeImplSharedPtr > children_
NodeType type() const override
virtual int64_t childCount() const
void checkLeavesInSet(const StringSet &pathNames, NodeImplSharedPtr origin) override
~StructureNodeImpl() override=default
virtual void append(NodeImplSharedPtr ni)
bool isDefined(const ustring &pathName) override
void writeXml(ImageFileImplSharedPtr imf, CheckedFile &cf, int indent, const char *forcedFieldName=nullptr) override
void dump(int indent=0, std::ostream &os=std::cout) const override
void set(const StringList &fields, unsigned level, NodeImplSharedPtr ni, bool autoPathCreate=false) override
std::shared_ptr< class NodeImpl > NodeImplSharedPtr
Definition: Common.h:190
std::weak_ptr< class ImageFileImpl > ImageFileImplWeakPtr
Definition: Common.h:189
std::shared_ptr< class ImageFileImpl > ImageFileImplSharedPtr
Definition: Common.h:188
std::string ustring
UTF-8 encodeded Unicode string.
Definition: E57Format.h:54
std::set< std::string > StringSet
Definition: Common.h:194
NodeType
Identifiers for types of E57 elements.
Definition: E57Format.h:58
std::vector< std::string > StringList
Definition: Common.h:193