
##################
CgeoModelGenerator
##################

.. js:class:: cee.geo.CgeoModelGenerator

   Helper class for creating a Model from a .cgeo blob.
   
   The .cgeo blob is typically received from a web service or a local file.
   
   Usage:
   
   .. code-block:: javascript
   
      let geoModel = new cee.geo.GeometryModel();
      let modelGenerator = new cee.geo.CgeoModelGenerator(buffer, geoModel);
      modelGenerator.buildModel();
   
   \*\* CGEO format documentation \*\*
   
   
   ::
   
      Int     Magic Number (2072003)
      Int     TextureCount
      Int     PartCount
      
      Textures (TextureCount number of this block):
           Int Index : Zero based index
           Int Width : Width of texture in pixels (see note below about dimensions)
           Int Height : Height of texture in pixels (see note below about dimensions)
           Int WrapMode : 1: Clamp To Edge, 2: Repeat
           Int MinFilter : 1: Nearest, 2: Linear, 3: Nearest Mipmap Nearest, 
                           4: Nearest Mipmap Linear, 5: Linear Mipmap Nearest, 
                           6: Linear Mipmap Linear
           Int MagFilter : 1: Nearest, 2: Linear
           ubyte\*Width\*Height  pixelData : First pixel is lower left corner
      
      Parts (PartCount number of this block):
           Int     PartId
           Int     Color (r,g,b,a)
           Int     NumVertices
           Int     HasNormals (1=true, 0=false)
           Int     TextureIndex (-1 for none)
           Int     NumPrimitives 
           Int     VerticesPerPrimitive
      
           Vertices:
             3*float     vertex x,y,z
      
           Normals:
             3*float     vertex nx,ny,nz
      
           TextureCoordinates:
             2*float     vertex s,t
      
           Indices:
             <NumPrimitives*VerticesPerPrimitive>
      
   
   **Notes:**
   
   Texture dimensions: Generally we recommend using textures where the dimensions (height and width) are a power of two (2,4,8,16, etc). Non-POT2 texture are partially supported in WebGL, but requires the sampler to be configured without MipMaps and with wrap mode set to ClampToEdge.
   
   Color is r,g,b,a packet into one integer. Example with float colors (0..1 per component):
   
   
   ::
   
          int intOpacity = (int)(opacity*255.0f);
          int intColor = (int)(color.r()*255.0f)<<24 | (int)(color.g()*255.0f)<<16 | (int)(color.b()*255.0f)<<8 | intOpacity;
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~cee.geo.CgeoModelGenerator.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~cee.geo.CgeoModelGenerator.buildModel`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: cee.geo.CgeoModelGenerator.constructor

      .. rst-class:: sig-pretty-signature
      
         | CgeoModelGenerator(**cgeoBuffer**\ : *ArrayBuffer*\ , **geoModel**\ : :js:class:`GeometryModel <cee.geo.GeometryModel>`\ ): :js:class:`CgeoModelGenerator <cee.geo.CgeoModelGenerator>`
      
      Creates a new CgeoModelGenerator with the given input Cgeo array and output geometry model
      
      **Parameters**
      
      
         **cgeoBuffer**\ : *ArrayBuffer*
      
         **geoModel**\ : :js:class:`GeometryModel <cee.geo.GeometryModel>`
      
      
      **Returns**\ : :js:class:`CgeoModelGenerator <cee.geo.CgeoModelGenerator>`
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: cee.geo.CgeoModelGenerator.buildModel

      .. rst-class:: sig-pretty-signature
      
         | buildModel(**preserveSharpEdges**\ : *boolean*\ ?): *void*
      
      Adds parts to the input GeometryModel based on the content of the Cgeo array
      
      **Parameters**
      
      
         **preserveSharpEdges**\ : *boolean* = false
      
      
      **Returns**\ : *void*
      




