NLLIGO::CMaterial Class Reference

#include <ligo_material.h>


Detailed Description

A ligoscape material

Author:
Cyril 'Hulud' Corvazier

Nevrax France

Date:
2001

Definition at line 48 of file ligo_material.h.

Public Member Functions

bool build (const CZoneTemplate &tplt, const CLigoConfig &config, CLigoError &errors)
 Build method.

const CZoneEdgegetEdge () const
 Return the material edge.

void serial (NLMISC::IStream &s)
 Serial method.


Private Attributes

CZoneEdge _ZoneEdge


Member Function Documentation

bool NLLIGO::CMaterial::build const CZoneTemplate tplt,
const CLigoConfig config,
CLigoError errors
 

Build method.

Definition at line 38 of file ligo_material.cpp.

References _ZoneEdge, NLLIGO::CLigoError::clear(), NLLIGO::CZoneTemplate::getEdges(), NLLIGO::CLigoError::MainError, and uint.

00039 {
00040         // Clear errors
00041         errors.clear ();
00042 
00043         // Edge vector
00044         const std::vector<CZoneEdge> &edges = tplt.getEdges ();
00045 
00046         // This template should have 4 edges
00047         if (edges.size() != 4)
00048         {
00049                 errors.MainError = CLigoError::MustHave4Edges;
00050                 return false;
00051         }
00052 
00053         // The 1st edge must be symetrical
00054         if (!edges[0].isSymetrical (config, errors))
00055                 return false;
00056 
00057         // Error code
00058         bool ok = true;
00059 
00060         // The others must be the same edges
00061         uint edge;
00062         for (edge=1; edge<edges.size(); edge++)
00063         {
00064                 // The same edge ?
00065                 if (!edges[0].isTheSame (edges[edge], config, errors))
00066                 {
00067                         // Error
00068                         ok = false;
00069                 }
00070         }
00071 
00072         // Build ?
00073         if (ok)
00074         {
00075                 // Ok, build the material
00076                 _ZoneEdge = edges[0];
00077         }
00078 
00079         // Return error code
00080         return ok;
00081 }

const CZoneEdge& NLLIGO::CMaterial::getEdge  )  const [inline]
 

Return the material edge.

Definition at line 56 of file ligo_material.h.

References _ZoneEdge.

Referenced by NLLIGO::CTransition::build().

00056 { return _ZoneEdge; }

void NLLIGO::CMaterial::serial NLMISC::IStream s  ) 
 

Serial method.

Definition at line 85 of file ligo_material.cpp.

References _ZoneEdge, s, and uint32.

00086 {
00087         // Serial the main node
00088         s.xmlPush ("LIGO_MATERIAL");
00089 
00090                 // Serial the header
00091                 s.serialCheck ((uint32)'TMOL');
00092 
00093                 // Serial the version
00094                 /*sint ver =*/ s.serialVersion (0);
00095 
00096                 // Serial the zoneedge
00097                 s.xmlSerial (_ZoneEdge, "ZONE_EDGE");
00098 
00099         // Close the main node
00100         s.xmlPop ();
00101 }


Field Documentation

CZoneEdge NLLIGO::CMaterial::_ZoneEdge [private]
 

Definition at line 64 of file ligo_material.h.

Referenced by build(), getEdge(), and serial().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 12:47:58 2004 for NeL by doxygen 1.3.6