Commit 82e82989 authored by gilles's avatar gilles

Ajout de la classe LrGeometryFacet

parent 367c6295
This diff is collapsed.
/*****************************************************************************
* class LrGeometryFacet (specification) *
* *
* author : Gilles Subrenat *
* creation : Thursday, April 24 2008 (4/24/2008) *
* note : *
*---------------------------------------------------------------------------*
* $Id$
*---------------------------------------------------------------------------*
* Log : see end of file *
*****************************************************************************/
#ifndef LRGEOMETRYFACET_H
#define LRGEOMETRYFACET_H
#include <vector>
#include "LrPoint.h"
#include "LrGeometry.h"
class LrGeometryFacet : public LrGeometry
{
public:
// constructors and destructor
// ***************************
typedef LrGeometry Super;
LrGeometryFacet();
LrGeometryFacet(const LrGeometryFacet &source);
LrGeometryFacet * clone() const;
LrGeometryFacet(const std::vector<LrPoint> &points,
const std::vector<std::vector<int> > &facets);
virtual ~LrGeometryFacet();
// assignement operator(s)
// ***********************
LrGeometryFacet & operator = (const LrGeometryFacet &source);
// comparison operator(s)
// **********************
friend bool operator == (const LrGeometryFacet &lhs, const LrGeometryFacet &rhs);
friend bool operator != (const LrGeometryFacet &lhs, const LrGeometryFacet &rhs);
// accessors
// *********
int getNbPoints() const;
LrPoint getPoint(int n) const;
int getNbFacets() const;
std::vector<int> getFacet(int n) const;
// mère
// ****
virtual int getNbFragments() const;
virtual bool getIntersection(const LrRay &ray, LrHit *hit, int fragment,
Real minBound=0, Real maxBound=INFINITY) const;
virtual void getMinMax(LrPoint &min, LrPoint &max, int fragment) const;
virtual void getMinMax(LrPoint &min, LrPoint &max) const;
protected:
virtual void uv2xyz(Real u, Real v, LrPoint *point,
LrVector *normal, LrVector *tangent) const;
private:
// data
// ****
typedef std::vector<int> Facet;
std::vector<LrPoint> m_points;
std::vector<Facet> m_facets;
std::vector<LrVector> m_normals;
mutable bool m_minMaxOk;
mutable LrPoint m_min, m_max;
};
LrGeometryFacet genereGeoFacet();
LrGeometryFacet genereGeoFacetFile();
#endif
/*
#include "LrGeometryFacet.h"
LrMatrix mat_F = LrMatrix::translate(LrVector(0, 0, 0)) * LrMatrix::scale(10);
LrGeometryFacet geo_F = genereGeoFacetFile();
LrEntityElementary* facet_F = new LrEntityElementary(mat_F, &geo_F, opt_A);
list_entities.push_back(facet_F);
printf("image en cours ligne %3d/%d\n", l, m_image->getHeight());
*/
/*****************************************************************************
* $Log$
*****************************************************************************/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment