|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CZone Class ReferenceA landscape zone.
More...
#include <zone.h>
Collaboration diagram for NL3D::CZone:
[legend]List of all members.
Public Methods |
| CZone () |
| Constructor. More...
|
| ~CZone () |
| Destructor. More...
|
void | build (uint16 zoneId, const std::vector<CPatchInfo> &patchs, const std::vector<CBorderVertex> &borderVertices) |
| Build a zone. More...
|
void | build (const CZone &zone) |
| Build a copy of a zone. More...
|
void | retrieve (std::vector<CPatchInfo> &patchs, std::vector<CBorderVertex> &borderVertices) |
| Retrieve zone patchinfo. More...
|
void | debugBinds (FILE *f= stdout) |
| Debug a zone, print binds in display. More...
|
void | compile (CLandscape *landscape, TZoneMap &loadedZones) |
| Compile a zone. More...
|
void | release (TZoneMap &loadedZones) |
| Release a zone. More...
|
void | serial (NLMISC::IStream &f) |
| Load/save a zone. More...
|
void | changePatchTextureAndColor (sint numPatch, const std::vector<CTileElement> *tiles, const std::vector<CTileColor> *colors) |
| Update and refresh a patch texture. More...
|
const std::vector<CTileElement>& | getPatchTexture (sint numPatch) const |
| Get a patch texture. More...
|
const std::vector<CTileColor>& | getPatchColor (sint numPatch) const |
| Get a patch colors Return the color array. More...
|
CLandscape* | getLandscape () const |
| Get the landscape in which is placed this zone. More...
|
void | clip (const std::vector<CPlane> &pyramid) |
| Clip a zone. To know if must be rendered etc... A zone is IN if in BACK of at least one plane of the pyramid. More...
|
void | refine () |
| Refine a zone (if needed). More...
|
void | preRender (const std::vector<CPlane> &pyramid) |
| PreRender a zone (if needed). More...
|
void | renderFar0 () |
| Render pass (if needed). More...
|
void | renderFar1 () |
void | renderTile (sint pass) |
void | resetRenderFar () |
void | forceMergeAtTileLevel () |
| For changing TileMaxSubdivision. force tesselation to be under tile. More...
|
void | refineAll () |
| force Refine a zone. More...
|
const CVector& | getPatchBias () const |
float | getPatchScale () const |
bool | compiled () const |
uint16 | getZoneId () const |
sint | getNumPatchs () const |
const CAABBoxExt& | getZoneBB () const |
const CPatch* | getPatch (sint patch) const |
| Get a read only patch pointer. More...
|
const CPatchConnect* | getPatchConnect (sint patch) const |
| Get a read only patch connect pointer. More...
|
void | applyHeightField (const CLandscape &landScape) |
| apply a landscape heightfield on a zone (modification of Z control points values). More...
|
Private Types |
typedef NLMISC::CSmartPtr<
CTessBaseVertex> | PBaseVertex |
typedef std::vector<PBaseVertex> | TBaseVerticesVec |
Private Methods |
void | rebindBorder (TZoneMap &loadedZones) |
| Force border patchs (those who don't bind to current zone) to re bind() them, using new neighborood. More...
|
PBaseVertex | getBaseVertex (sint vert) const |
CPatch* | getPatch (sint patch) |
bool | patchOnBorder (const CPatchConnect &pc) const |
void | computeBBScaleBias (const CAABBox &bb) |
Private Attributes |
CLandscape* | Landscape |
uint16 | ZoneId |
bool | Compiled |
CAABBoxExt | ZoneBB |
CVector | PatchBias |
float | PatchScale |
sint32 | NumVertices |
TBaseVerticesVec | BaseVertices |
std::vector<CBorderVertex> | BorderVertices |
std::vector<CPatch> | Patchs |
std::vector<CPatchConnect> | PatchConnects |
bool | ComputeTileErrorMetric |
std::vector<CPlane> | CurrentPyramid |
sint | ClipResult |
Static Private Methods |
CPatch* | getZonePatch (TZoneMap &loadedZones, sint zoneId, sint patch) |
void | unbindAndMakeBindInfo (TZoneMap &loadedZones, CPatch &pa, CPatchConnect &pc, CPatch::CBindInfo edges[4]) |
void | unbindPatch (TZoneMap &loadedZones, CPatch &pa, CPatchConnect &pc) |
void | bindPatch (TZoneMap &loadedZones, CPatch &pa, CPatchConnect &pc) |
Friends |
class | CTessFace |
class | CPatch |
Detailed Description
A landscape zone.
There is 2 ways for building a zone:
- use build(). (then you can use serial to save the zone, don't need to compile() the zone).
- use serial() for loading this zone.
Before a zone may be rendered, it must be compile()-ed, to compile and bind patch, to make vertices etc...
NB: you must call release() before deleting a compiled zone. (else assert in destruction). -
Author(s):
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 216 of file 3d/zone.h.
Member Typedef Documentation
typedef std::vector<PBaseVertex> NL3D::CZone::TBaseVerticesVec [private]
|
|
Constructor & Destructor Documentation
Member Function Documentation
void NL3D::CZone::applyHeightField (
|
const CLandscape & landScape )
|
|
|
apply a landscape heightfield on a zone (modification of Z control points values).
NB: this is done in Landscape addZone(), before compile(). -
Parameters:
-
landScape
|
the landscape which gives Z delta values, for a x,y point. |
Definition at line 1034 of file 3d/zone.cpp. |
void NL3D::CZone::build (
|
const CZone & zone )
|
|
|
Build a copy of a zone.
This method do a copy of zone (should be builded but maybe not compiled).
NB: cannot build on a compiled zone. must release the zone before....
Definition at line 216 of file 3d/zone.cpp. |
|
Build a zone.
This method do:
- compress the patchs coordinates.
- build the patchs of the zone, but doesn't compile() them.
NB: cannot build on a compiled zone. must release the zone before....-
Parameters:
-
zoneId
|
the Unique ID of this zone. |
patchs
|
the PatchInfo of this zone. |
borderVertices
|
vertices connectivity for this zone. NB: borderVertices must contains the connectivity across zones. It is VERY IMPORTANT to setup zone corner connectivity too. A "corner borderVertex" may appear 3 times here. One for each other zone of the corner. |
Definition at line 77 of file 3d/zone.cpp.
Referenced by RPatchMesh::exportZone(). |
void NL3D::CZone::changePatchTextureAndColor (
|
sint numPatch,
|
|
const std::vector< CTileElement >* tiles,
|
|
const std::vector< CTileColor >* colors )
|
|
|
Update and refresh a patch texture.
Usefull for Tile edition. Even if patch is in tile mode, it is refreshed... -
Parameters:
-
numPatch
|
the index of patch in this zone which will receive his new texture. assert if bad id. |
tiles
|
the patch texture. assert if not of good size (OrderS*OrderT). Can be NULL if you don't want to change the patch texture. |
colors
|
the patch texture. assert if not of good size ((OrderS+1)*(OrderT+1)). Can be NULL if you don't want to change the patch colors. |
Definition at line 951 of file 3d/zone.cpp. |
void NL3D::CZone::clip (
|
const std::vector< CPlane >& pyramid )
|
|
|
Clip a zone. To know if must be rendered etc... A zone is IN if in BACK of at least one plane of the pyramid.
Definition at line 651 of file 3d/zone.cpp. |
|
Compile a zone.
Make it usable for clip()/refine()/render(). This method do:
- attach this to loadedZones.
- create/link the base vertices (internal..), according to present neigbor zones.
- compile() the patchs.
- bind() the patchs.
- rebindBorder() on neighbor zones.
A zone must keep a pointer on a landscape, for texture management. NB: assert if already compiled. assert if zone already exist in loadedZones.
Definition at line 330 of file 3d/zone.cpp. |
bool NL3D::CZone::compiled (
|
) const [inline]
|
|
void NL3D::CZone::computeBBScaleBias (
|
const CAABBox & bb ) [private]
|
|
void NL3D::CZone::debugBinds (
|
FILE * f = stdout )
|
|
|
Debug a zone, print binds in display.
Definition at line 1002 of file 3d/zone.cpp. |
void NL3D::CZone::forceMergeAtTileLevel (
|
)
|
|
|
For changing TileMaxSubdivision. force tesselation to be under tile.
Definition at line 933 of file 3d/zone.cpp. |
PBaseVertex NL3D::CZone::getBaseVertex (
|
sint vert ) const [inline, private]
|
|
CLandscape * NL3D::CZone::getLandscape (
|
) const [inline]
|
|
|
Get the landscape in which is placed this zone.
If no landscape, return NULL.
-
Returns:
-
the pointer of the landscape of the zone or NULL if the zone hasn't be compiled.
Definition at line 347 of file 3d/zone.h. |
sint NL3D::CZone::getNumPatchs (
|
) const [inline]
|
|
CPatch * NL3D::CZone::getPatch (
|
sint patch ) [inline, private]
|
|
const CPatch * NL3D::CZone::getPatch (
|
sint patch ) const [inline]
|
|
|
Get a read only patch pointer.
-
Parameters:
-
patch
|
the index of patch to get. |
-
Returns:
-
A patch pointer in read only.
Definition at line 386 of file 3d/zone.h. |
const CVector & NL3D::CZone::getPatchBias (
|
) const [inline]
|
|
const std::vector< CTileColor >& NL3D::CZone::getPatchColor (
|
sint numPatch ) const
|
|
|
Get a patch colors Return the color array.
-
Parameters:
-
numPatch
|
the index of patch in this zone which will get his colors. assert if bad id. |
return
|
The tiles the patch colors. The size should be (OrderS+1)*(OrderT+1). |
-
See also:
-
getPatch()
Definition at line 991 of file 3d/zone.cpp. |
|
Get a read only patch connect pointer.
-
Parameters:
-
patch
|
the index of patch to get. |
-
Returns:
-
A patch pointer in read only.
Definition at line 394 of file 3d/zone.h. |
float NL3D::CZone::getPatchScale (
|
) const [inline]
|
|
const std::vector< CTileElement >& NL3D::CZone::getPatchTexture (
|
sint numPatch ) const
|
|
|
Get a patch texture.
Return the tile array. -
Parameters:
-
numPatch
|
the index of patch in this zone which will get his texture. assert if bad id. |
return
|
The tiles the patch texture. The size should be OrderS*OrderT. |
-
See also:
-
getPatch()
Definition at line 980 of file 3d/zone.cpp. |
const CAABBoxExt & NL3D::CZone::getZoneBB (
|
) const [inline]
|
|
uint16 NL3D::CZone::getZoneId (
|
) const [inline]
|
|
bool NL3D::CZone::patchOnBorder (
|
const CPatchConnect & pc ) const [private]
|
|
void NL3D::CZone::preRender (
|
const std::vector< CPlane >& pyramid )
|
|
|
PreRender a zone (if needed).
Definition at line 864 of file 3d/zone.cpp. |
void NL3D::CZone::rebindBorder (
|
TZoneMap & loadedZones ) [private]
|
|
|
Force border patchs (those who don't bind to current zone) to re bind() them, using new neighborood.
no-op if zone is not compiled.
Definition at line 507 of file 3d/zone.cpp. |
void NL3D::CZone::refine (
|
)
|
|
|
Refine a zone (if needed).
Definition at line 784 of file 3d/zone.cpp. |
void NL3D::CZone::refineAll (
|
)
|
|
void NL3D::CZone::release (
|
TZoneMap & loadedZones )
|
|
|
Release a zone.
This method do:
- detach this zone to loadedZones.
- destroy/unlink the base vertices (internal..), according to present neigbor zones.
- unbind() the patchs.
- release() the patchs.
- rebindBorder() on neighbor zones.
NB: no-op if not compiled.
Definition at line 418 of file 3d/zone.cpp. |
void NL3D::CZone::renderFar0 (
|
)
|
|
void NL3D::CZone::renderFar1 (
|
)
|
|
void NL3D::CZone::renderTile (
|
sint pass )
|
|
void NL3D::CZone::resetRenderFar (
|
)
|
|
|
Retrieve zone patchinfo.
This method uncompress the patchs coordinates and all info into the patch info/borderVertices. Warning!!! Due to compression, data won't be the same as those given in build(). -
Parameters:
-
patchs
|
the PatchInfo of this zone. |
borderVertices
|
vertices connectivity for this zone. |
Definition at line 169 of file 3d/zone.cpp. |
|
Load/save a zone.
Save work even if zone is not compiled, but load must be done on a not compiled zone...
Definition at line 271 of file 3d/zone.cpp. |
Friends And Related Function Documentation
Member Data Documentation
std::vector< CBorderVertex > NL3D::CZone::BorderVertices [private]
|
|
sint NL3D::CZone::ClipResult [private]
|
|
bool NL3D::CZone::Compiled [private]
|
|
bool NL3D::CZone::ComputeTileErrorMetric [private]
|
|
std::vector< CPlane > NL3D::CZone::CurrentPyramid [private]
|
|
sint32 NL3D::CZone::NumVertices [private]
|
|
CVector NL3D::CZone::PatchBias [private]
|
|
std::vector< CPatchConnect > NL3D::CZone::PatchConnects [private]
|
|
float NL3D::CZone::PatchScale [private]
|
|
std::vector< CPatch > NL3D::CZone::Patchs [private]
|
|
CAABBoxExt NL3D::CZone::ZoneBB [private]
|
|
uint16 NL3D::CZone::ZoneId [private]
|
|
The documentation for this class was generated from the following files:
|
|