40 #ifndef _collisionshapemanager_cpp
41 #define _collisionshapemanager_cpp
43 #include "Physics/collisionshapemanager.h"
44 #include "Graphics/mesh.h"
45 #include "Graphics/meshmanager.h"
49 #include "Physics/collisionshape.h"
50 #include "Physics/boxcollisionshape.h"
51 #include "Physics/capsulecollisionshape.h"
52 #include "Physics/conecollisionshape.h"
53 #include "Physics/convexhullcollisionshape.h"
54 #include "Physics/cylindercollisionshape.h"
55 #include "Physics/multispherecollisionshape.h"
56 #include "Physics/spherecollisionshape.h"
57 #include "Physics/dynamicmeshcollisionshape.h"
58 #include "Physics/heightfieldcollisionshape.h"
59 #include "Physics/planecollisionshape.h"
60 #include "Physics/softcollisionshape.h"
61 #include "Physics/staticmeshcollisionshape.h"
62 #include "Physics/compoundcollisionshape.h"
65 #include "stringtool.h"
69 #include "btBulletDynamicsCommon.h"
70 #include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
71 #include "BulletCollision/CollisionShapes/btShapeHull.h"
72 #include "BulletCollision/Gimpact/btGImpactShape.h"
73 #include "ConvexBuilder.h"
74 #include "Internal/decompinterface.h.cpp"
75 #include <btBulletWorldImporter.h>
82 template<> Physics::CollisionShapeManager* Singleton<Physics::CollisionShapeManager>::SingletonPtr = NULL;
107 Ogre::SubMesh* subMesh = NULL;
108 Ogre::IndexData* IndexData = NULL;
109 Ogre::VertexData* VertexData = NULL;
110 Boole use32bitindexes =
false;
111 unsigned int triCount = 0;
112 unsigned int vCount = 0;
113 unsigned int iCount = 0;
114 Whole VertPrevSize = 0;
115 Whole IndiPrevSize = 0;
116 Ogre::Vector3* vertices = NULL;
117 unsigned long* indices = NULL;
118 Boole SharedVerts = myMesh->getSubMesh(0)->useSharedVertices;
122 for(
Whole X = 0 ; X < myMesh->getNumSubMeshes() ; X++ )
124 vCount += SharedVerts ? myMesh->sharedVertexData->vertexCount : myMesh->getSubMesh(X)->vertexData->vertexCount;
125 iCount += myMesh->getSubMesh(X)->indexData->indexCount;
128 vCount += SharedVerts ? myMesh->sharedVertexData->vertexCount : myMesh->getSubMesh(0)->vertexData->vertexCount;
129 iCount += myMesh->getSubMesh(0)->indexData->indexCount;
132 vertices =
new Ogre::Vector3[vCount];
133 indices =
new unsigned long[iCount];
136 for(
unsigned short int SubMeshIndex = 0 ; SubMeshIndex < myMesh->getNumSubMeshes() ; SubMeshIndex++ )
138 if( !UseAllSubmeshes && ( SubMeshIndex > 0 ) )
140 if( SharedVerts && (SubMeshIndex > 0) )
143 subMesh = myMesh->getSubMesh(SubMeshIndex);
144 IndexData = subMesh->indexData;
145 VertexData = SharedVerts ? myMesh->sharedVertexData : myMesh->getSubMesh(SubMeshIndex)->vertexData;
148 const Ogre::VertexElement* posElem = VertexData->vertexDeclaration->findElementBySemantic(Ogre::VES_POSITION);
150 Ogre::HardwareVertexBufferSharedPtr vBuffer = VertexData->vertexBufferBinding->getBuffer(posElem->getSource());
152 Ogre::HardwareIndexBufferSharedPtr iBuffer = IndexData->indexBuffer;
154 triCount += ( IndexData->indexCount / 3 );
157 unsigned char* vertex =
static_cast<unsigned char*
>(vBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
159 for (
size_t j = 0; j < VertexData->vertexCount; ++j, vertex += vBuffer->getVertexSize() )
161 posElem->baseVertexPointerToElement(vertex, &pReal);
162 Ogre::Vector3 pt(pReal[0], pReal[1], pReal[2]);
163 vertices[j + VertPrevSize] = pt;
166 size_t index_offset = 0;
167 use32bitindexes = (iBuffer->getType() == Ogre::HardwareIndexBuffer::IT_32BIT);
170 unsigned long* pLong =
static_cast<unsigned long*
>(iBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
171 unsigned short* pShort =
reinterpret_cast<unsigned short*
>(pLong);
173 if( use32bitindexes )
175 for (
size_t k = 0; k < triCount*3; ++k)
177 indices[index_offset+IndiPrevSize] = pLong[k];
181 for (
size_t k = 0; k < triCount*3; ++k)
183 indices[index_offset+IndiPrevSize] =
static_cast<unsigned long>(pShort[k]);
189 VertPrevSize+=VertexData->vertexCount;
190 IndiPrevSize+=IndexData->indexCount;
196 btTriangleMesh* trimesh =
new btTriangleMesh(use32bitindexes);
199 btVector3 vert0, vert1, vert2;
203 for (
unsigned int y=0; y<triCount; y++)
206 vert0.setValue(vertices[indices[i]].x, vertices[indices[i]].y, vertices[indices[i]].z);
207 vert1.setValue(vertices[indices[i+1]].x, vertices[indices[i+1]].y, vertices[indices[i+1]].z);
208 vert2.setValue(vertices[indices[i+2]].x, vertices[indices[i+2]].y, vertices[indices[i+2]].z);
211 trimesh->addTriangle(vert0, vert1, vert2);
224 switch(InternalShape->getShapeType())
226 case BOX_SHAPE_PROXYTYPE:
232 case CAPSULE_SHAPE_PROXYTYPE:
238 case CONE_SHAPE_PROXYTYPE:
244 case CONVEX_HULL_SHAPE_PROXYTYPE:
247 return ConvexHullShape;
250 case CYLINDER_SHAPE_PROXYTYPE:
253 return CylinderShape;
256 case MULTI_SPHERE_SHAPE_PROXYTYPE:
259 return MultiSphereShape;
262 case SPHERE_SHAPE_PROXYTYPE:
268 case GIMPACT_SHAPE_PROXYTYPE:
274 case TERRAIN_SHAPE_PROXYTYPE:
277 return HeightFieldShape;
280 case STATIC_PLANE_PROXYTYPE:
286 case SOFTBODY_SHAPE_PROXYTYPE:
289 return SoftBodyShape;
292 case TRIANGLE_MESH_SHAPE_PROXYTYPE:
298 case COMPOUND_SHAPE_PROXYTYPE:
318 if((*CS).second != Shape) {
330 else return (*CS).second;
397 btConvexShape *tmpshape =
new btConvexTriangleMeshShape(this->
CreateBulletTrimesh(ObjectMesh,UseAllSubmeshes));
398 btShapeHull *hull =
new btShapeHull(tmpshape);
399 btScalar margin = tmpshape->getMargin();
400 hull->buildHull(margin);
402 btConvexHullShape* convexShape =
new btConvexHullShape();
403 for (
int b=0;b<hull->numVertices();b++)
405 convexShape->addPoint(hull->getVertexPointer()[b]);
420 btGImpactMeshShape* gimpact =
new btGImpactMeshShape(this->
CreateBulletTrimesh(ObjectMesh,UseAllSubmeshes));
432 btBvhTriangleMeshShape* tmpshape =
new btBvhTriangleMeshShape(this->
CreateBulletTrimesh(ObjectMesh,UseAllSubmeshes),
true);
446 Ogre::SubMesh* subMesh = NULL;
447 Ogre::IndexData* indexData = NULL;
448 Ogre::VertexData* vertexData = NULL;
449 Boole use32bitindexes =
false;
450 unsigned int currtriCount = 0;
451 unsigned int triCount = 0;
452 unsigned int vCount = 0;
453 unsigned int iCount = 0;
454 Whole VertPrevSize = 0;
455 Whole IndiPrevSize = 0;
456 Boole SharedVerts = myMesh->getSubMesh(0)->useSharedVertices;
458 Whole* VertPerSubMesh = NULL;
462 VertPerSubMesh =
new Whole[myMesh->getNumSubMeshes()];
463 for(
Whole X = 0 ; X < myMesh->getNumSubMeshes() ; X++ )
465 vCount += SharedVerts ? myMesh->sharedVertexData->vertexCount : myMesh->getSubMesh(X)->vertexData->vertexCount;
466 iCount += myMesh->getSubMesh(X)->indexData->indexCount;
467 VertPerSubMesh[X] = SharedVerts ? myMesh->sharedVertexData->vertexCount : myMesh->getSubMesh(X)->vertexData->vertexCount;
470 vCount += SharedVerts ? myMesh->sharedVertexData->vertexCount : myMesh->getSubMesh(0)->vertexData->vertexCount;
471 iCount += myMesh->getSubMesh(0)->indexData->indexCount;
474 Ogre::Vector3* vertices =
new Ogre::Vector3[vCount];
475 unsigned int* indices =
new unsigned int[iCount];
477 for(
unsigned short int SubMeshIndex = 0 ; SubMeshIndex < myMesh->getNumSubMeshes() ; SubMeshIndex++ )
479 if( !UseAllSubmeshes && (SubMeshIndex > 0) )
481 if( SharedVerts && (SubMeshIndex > 0) )
484 subMesh = myMesh->getSubMesh(SubMeshIndex);
485 indexData = subMesh->indexData;
486 vertexData = SharedVerts ? myMesh->sharedVertexData : myMesh->getSubMesh(SubMeshIndex)->vertexData;
488 const Ogre::VertexElement* posElem = vertexData->vertexDeclaration->findElementBySemantic(Ogre::VES_POSITION);
489 Ogre::HardwareVertexBufferSharedPtr vBuffer = vertexData->vertexBufferBinding->getBuffer(posElem->getSource());
490 Ogre::HardwareIndexBufferSharedPtr iBuffer = indexData->indexBuffer;
491 currtriCount=indexData->indexCount/3;
492 triCount+=(indexData->indexCount/3);
494 unsigned char* vertex =
static_cast<unsigned char*
>(vBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
496 for(
size_t j = 0 ; j < vertexData->vertexCount ; j++, vertex += vBuffer->getVertexSize() )
498 posElem->baseVertexPointerToElement(vertex, &pReal);
499 vertices[j + VertPrevSize].x = *pReal++;
500 vertices[j + VertPrevSize].y = *pReal++;
501 vertices[j + VertPrevSize].z = *pReal++;
504 size_t index_offset = 0;
505 use32bitindexes = (iBuffer->getType() == Ogre::HardwareIndexBuffer::IT_32BIT);
507 unsigned long* pLong =
static_cast<unsigned long*
>(iBuffer->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
508 unsigned short* pShort =
reinterpret_cast<unsigned short*
>(pLong);
510 if( use32bitindexes )
512 for (
size_t k = 0; k < currtriCount*3; ++k)
514 if(SubMeshIndex > 0 && VertPerSubMesh) {
515 indices[index_offset+IndiPrevSize] = pLong[k] + VertPerSubMesh[SubMeshIndex];
517 indices[index_offset+IndiPrevSize] = pLong[k];
522 for(
size_t k = 0 ; k < currtriCount * 3 ; ++k )
524 if(SubMeshIndex > 0 && VertPerSubMesh) {
525 indices[index_offset+IndiPrevSize] = (
static_cast<unsigned long>(pShort[k])) + VertPerSubMesh[SubMeshIndex];
527 indices[index_offset+IndiPrevSize] =
static_cast<unsigned long>(pShort[k]);
534 VertPrevSize += vertexData->vertexCount;
535 IndiPrevSize += indexData->indexCount;
538 ConvexDecomposition::DecompDesc desc;
539 desc.mVcount = vertexData->vertexCount;
540 desc.mTcount = triCount;
541 desc.mVertices = &vertices[0].x;
542 desc.mIndices = &indices[0];
543 unsigned int maxv = 16;
544 float skinWidth = 0.0;
546 desc.mCpercent = CPercent;
547 desc.mPpercent = PPercent;
548 desc.mMaxVertices = maxv;
549 desc.mSkinWidth = skinWidth;
551 Internal::MezzConvexDecomposition decomp;
552 desc.mCallback = &decomp;
554 ConvexBuilder cb(desc.mCallback);
560 for (
int i=0;i<decomp.m_convexShapes.size();i++)
562 std::stringstream namestream;
563 namestream << Name <<
"Child" << i;
564 Vector3 centroid(decomp.m_convexCentroids[i]);
570 delete[] VertPerSubMesh;
593 if( ShapesRoot.
Empty() ) {
600 this->
CollisionShapes.insert( std::pair<String,CollisionShape*>(DeSerializedShape->
GetName(),DeSerializedShape) );
614 (*ShapeIt).second->ProtoSerialize( ShapesRoot );
633 for(
ShapeVectorIterator ShapeIt = ShapesToSave.begin() ; ShapeIt != ShapesToSave.end() ; ++ShapeIt )
635 (*ShapeIt)->ProtoSerialize( ShapesRoot );
648 btBulletWorldImporter Importer;
649 Ogre::DataStreamPtr Stream = Ogre::ResourceGroupManager::getSingleton().openResource(FileName,Group);
650 char* buffer =
new char[Stream->size()];
651 Stream->read((
void*)buffer, Stream->size());
652 if(!Importer.loadFileFromMemory(buffer, Stream->size()))
657 for(
Whole X = 0 ; X < Importer.getNumCollisionShapes() ; ++X )
659 btCollisionShape* Shape = Importer.getCollisionShapeByIndex(X);
660 const char* MaybeAName = Importer.getNameForPointer((
void*)Shape);
664 Name =
String(MaybeAName);
669 this->
CollisionShapes.insert( std::pair<String,CollisionShape*>(Name,NewShape) );
672 static Whole NameCount = 0;
682 btDefaultSerializer* BulletSerializer =
new btDefaultSerializer(1024*1024*5);
683 BulletSerializer->startSerialization();
687 BulletSerializer->registerNameForPointer((
void*)Shape->
_GetInternalShape(),(*it).first.c_str());
689 btChunk* chunk = BulletSerializer->allocate(len,1);
690 const char* structType = Shape->
_GetInternalShape()->serialize(chunk->m_oldPtr, BulletSerializer);
691 BulletSerializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,Shape->
_GetInternalShape());
693 BulletSerializer->finishSerialization();
694 FILE* f2 = fopen(FileName.c_str(),
"wb");
695 fwrite(BulletSerializer->getBufferPointer(),BulletSerializer->getCurrentBufferSize(),1,f2);
701 btDefaultSerializer* BulletSerializer =
new btDefaultSerializer(1024*1024*5);
702 BulletSerializer->startSerialization();
706 BulletSerializer->registerNameForPointer((
void*)Shape->
_GetInternalShape(),(*it)->GetName().c_str());
708 btChunk* chunk = BulletSerializer->allocate(len,1);
709 const char* structType = Shape->
_GetInternalShape()->serialize(chunk->m_oldPtr, BulletSerializer);
710 BulletSerializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,Shape->
_GetInternalShape());
712 BulletSerializer->finishSerialization();
713 FILE* f2 = fopen(FileName.c_str(),
"wb");
714 fwrite(BulletSerializer->getBufferPointer(),BulletSerializer->getCurrentBufferSize(),1,f2);
730 if( (*ShapeIt) == Shape ) {
742 this->
CollisionShapes.insert( std::pair<String,CollisionShape*>(NewName,Shape) );
795 {
delete ToBeDestroyed; }
This is the base class for all collision shapes.
virtual Whole GetNumStoredShapes()
Gets the number of stored shapes in this manager.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
Thrown when duplicates of teh same identity string exist.
A light-weight handle for manipulating attributes in DOM tree.
virtual void LoadAllShapesFromBinaryFile(const String &FileName, const String &Group)
Loads all shapes saved in an existing binary file, and stores them in this manager.
virtual ~DefaultCollisionShapeManagerFactory()
Class destructor.
Clear the contents of the file when opening. Note that this will also create the file if it's not fou...
A triangle mesh collsion shape based on a graphics mesh.
bool Boole
Generally acts a single bit, true or false.
virtual void LoadAllShapesFromXMLFile(const String &FileName, const String &Group)
Loads all shapes saved in an existing XML file, and stores them in this manager.
A physics shape comprised of multiple sphere's placed in local space.
ManagerType
A listing of Manager Types.
EntresolManager * CreateManager(const NameValuePairList &Params)
Creates a manager of the type represented by this factory.
CollisionShape * CreateShape(CollisionShape::ShapeType ShapeToCreate, const String &Name_, btCollisionShape *ShapeToModel)
Create A shape of a type and optionally model it after an example.
static const String ImplementationName
A String containing the name of this manager implementation.
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...
ShapeMapIterator EndCollisionShape()
Gets an Iterator to one passed the last CollisionShape in this manager.
ShapeVector::iterator ShapeVectorIterator
Vector Iterator type for CollisionShape instances stored by this class.
Thrown when and XML document is being parsed but is invalid.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
This class is used to check and modify the properties of a graphics mesh.
Thrown when we just have not coded a thing yet, but we knew what the API should look like...
virtual DynamicMeshCollisionShape * GenerateDynamicTriMesh(const String &Name, Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes=false)
Generates a mesh shape for dynamic objects.
A triangle mesh collsion shape based on a graphics mesh.
Ogre::MeshPtr _GetInternalMesh() const
Gets the internal Mesh pointer.
virtual void DestroyShape(CollisionShape *Shape)
Removes a shape from this manager and deletes it.
Declaration of FileStream.
virtual ~CollisionShapeManager()
Class destructor.
virtual String GetImplementationTypeName() const
This Allows any manager name to be sent to a stream. Primarily used for logging.
virtual void DestroyAllShapes()
Removes all shapes from the manager and then deletes them.
virtual btCollisionShape * _GetInternalShape() const
Gets the internal shape pointer this collision shape is based on.
A simple convex shape built from a low number of points in local space.
virtual void StoreShape(CollisionShape *Shape)
Stores a pre-made shape in this manager.
virtual void RemoveAllShapes()
Removes all shapes from the manager without deleting them.
ManagerBase::ManagerType GetManagerType() const
Gets the type of manager that is created by this factory.
bool Empty() const
Is this storing anything at all?
ParseResult Load(std::basic_istream< char, std::char_traits< char > > &stream, unsigned int options=ParseDefault, Encoding DocumentEncoding=EncodingAuto)
Load XML from a stream.
ShapeMap CollisionShapes
This stores the names and collision Shapes.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
std::vector< CollisionShape * > ShapeVector
Vector container type for CollisionShape storage by this class.
virtual void SaveAllStoredShapesToXMLFile(const String &FileName)
Takes all the shapes currently stored this manager and saves them to a XML file.
ShapeVector & GetUnnamedShapes()
Returns a vector of unnamed shapes stored in this manager.
This is returned to indicated there where no issues parsing the XML document.
void SetNameForUnnamedShape(const String &NewName, CollisionShape *Shape)
Assigns a name to an unnamed shape.
float Real
A Datatype used to represent a real floating point number.
virtual void SaveShapesToXMLFile(const String &FileName, ShapeVector &ShapesToSave)
Saves all shapes contained in a vector and saves them to a XML file.
void Save(Writer &WriterInstance, const Char8 *indent="\t", unsigned int flags=FormatDefault, Encoding DocumentEncoding=EncodingAuto) const
Save XML document to WriterInstance.
virtual CollisionShape * GetShape(const String &Name)
Gets a shape already stored in this manager.
bool SetValue(const Char8 *rhs)
Set the value of this.
static Boole SingletonValid()
Checks to see if the singleton pointer is valid.
virtual void SaveAllStoredShapesToBinaryFile(const String &FileName)
Takes all the shapes currently stored this manager and saves them to a binary file.
bool SetName(const Char8 *rhs)
Set the name of .
static MeshManager * GetSingletonPtr()
Fetches a pointer to the singleton.
This is the base class for all managers that do no describe properties of a single world...
Permit write operations on the stream.
Child node iterator (a bidirectional iterator over a collection of Node)
virtual void AddChildShape(CollisionShape *Child, const Vector3 &ChildLocation, const Quaternion &ChildRotation)
Adds a shape to this compound shape.
Thrown when there is an unknown issue with a file.
A light-weight handle for manipulating nodes in DOM tree.
iterator begin() const
Get a Child node iterator that references the first child Node.
iterator end() const
Get a Child node iterator that references one past the last child Node.
ProcessDepth Depth
The current process depth as interpretted by Main.
virtual void RemoveShape(CollisionShape *Shape)
Removes a shape from this manager without deleting it.
virtual CompoundCollisionShape * PerformConvexDecomposition(const String &Name, Graphics::Mesh *ObjectMesh, Whole Depth, Real CPercent, Real PPercent, Boole UseAllSubmeshes=false)
Generates a compound shape of Convex Hulls from a provided mesh.
The defintion of the Resource Manager.
Troubleshooting data intended to help troublshoot XML parsing errors.
virtual void Deinitialize()
Removes this manager from any necessary configuration so it can be safely disposed of...
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
virtual void SaveShapesToBinaryFile(const String &FileName, ShapeVector &ShapesToSave)
Saves all shapes contained in a vector and saves them to a binary file.
Thrown when the available information should have worked but failed for unknown reasons.
virtual ConvexHullCollisionShape * GenerateConvexHull(const String &Name, Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes=false)
Generates a Convex Hull from a provided mesh.
A collision shape for soft proxies.
ParseStatus Status
Parsing status ( see ParseStatus )
ShapeMap::const_iterator ConstShapeMapIterator
Const Map Iterator type for CollisionShape instances stored by this class.
A cylinder physics shape.
The root node of any xml hierarchy is a Document.
btTriangleMesh * CreateBulletTrimesh(Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes)
Creates a TriMesh to be used in TriMesh based collision shapes.
virtual StaticMeshCollisionShape * GenerateStaticTriMesh(const String &Name, Graphics::Mesh *ObjectMesh, Boole UseAllSubmeshes=false)
Generates a mesh shape for static objects.
virtual void _SetShapeName(const String &NewName)
Sets the name of this collision shape.
This is used to represent a point in space, or a vector through space.
Document declaration, i.e. ''.
This represents a stream to a file on disk using the C++ file stream API.
ShapeVector UnnamedShapes
Stores shapes that have not been given a name.
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
A Flat wall/floor of limitless size.
DefaultCollisionShapeManagerFactory()
Class constructor.
virtual ManagerBase::ManagerType GetInterfaceType() const
This returns the type of this manager.
CountedPtr< DataStream > DataStreamPtr
This is a convenience type for a data stream in a counted pointer.
ShapeMap::iterator ShapeMapIterator
Map Iterator type for CollisionShape instances stored by this class.
String GetManagerImplName() const
Gets the name of the manager that is created by this factory.
void DestroyManager(EntresolManager *ToBeDestroyed)
Destroys a Manager created by this factory.
This manager is for the storage of all shapes and creation of mesh shapes.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
ShapeMapIterator BeginCollisionShape()
Gets an Iterator to the first CollisionShape in this manager.
CollisionShape * WrapShape(const String &Name, btCollisionShape *InternalShape)
Creates a wrapper for an internal bullet shape.
std::string String
A datatype used to a series of characters.
A series of values that store hieght in a grid like fashion.
A collision shape composed of many other collision shapes placed and oriented in local space...
CollisionShapeManager()
Class constructor.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
virtual const String & GetName() const
Gets the name of this shape.
const unsigned int FormatIndent
Indent the nodes that are written to output stream with as many indentation strings as deep the node ...
Boole Initialized
Simple Boole indicating whether or not this manager has been initialized.