Perspective3D_api
Documentation Perspective3D
perspective_types.h
Aller à la documentation de ce fichier.
1 
19 #ifndef PERSPECTIVE_TYPES_H
20 #define PERSPECTIVE_TYPES_H
21 
22 #include "perspective_sys.h"
23 #include "perspective_def.h"
24 #include <vector> // std::vector
25 
26 namespace Perspective3D
27 {
29  enum class resultat_gen3d_t : pulong
30  {
32  PGEN_NUL = 0,
34  PGEN_OK = 1,
62  PGEN_ERR_VUEHAUT_NULLE = 16384,
68  PGEN_ERR_CONVERSION3D = 131072,
70  PGEN_ERR_GENERATION3D = 262144
71  };
73 
74 
76  {
78  PMODE_NUL=0,
85  };
87 
88 
89  enum class vues2D_t : pushort
90  {
92  VUERREUR=0,
94  VUENUL=1,
96  VUEFACE=2,
98  VUECOTE=4,
100  VUEHAUT=8,
102  VUEMULT=16
103  };
105 
106 
107  enum class axesOrthos3D_t : pushort
108  {
110  ORTHO_NUL=0,
112  ORTHO_X=1,
114  ORTHO_Y=2,
116  ORTHO_Z=4,
118  ORTHO_X_N=8,
120  ORTHO_Y_N=16,
122  ORTHO_Z_N=32
123  };
125 
126 
128  {
129  EXPORT_DXF_NUL=0,
140  };
142 
143 
146  typedef std::vector<int> PStdVectInts;
147 
151  typedef pint32 pident;
152 
154  enum class normevues_t : pushort
155  {
156  NORME_VUES_NUL=0,
161  };
163 
164  namespace i18n
165  {
167  enum class lang_p3d_t : pushort
168  {
170  P3D_LANG_FR=0,
173  };
175  #define P3D_LANG_DEFAUT Perspective3D::i18n::lang_p3d_t::P3D_LANG_EN
176  }
177 
179  enum class infos3d_t : pushort
180  {
181  INUL=0,
182  ITOUT=1,
184  IDPOINTS=2,
186  IDLIGNES=4,
188  ICOORDSPOINTS=8,
190  IVECTEURNORM=16,
192  IVALNORMAUX=32,
194  IDSURFACES=64,
196  IDCOURBES=128,
198  IDSPHERES=256
199  };
201 
202 
203  enum class params_gen3d_t : pushort
204  {
205  PGEN3DNUL=0,
207  DIVISION_SURF=1,
226  };
228 
229 
230  enum class proprietes_3d_t : puint8
231  {
235  };
237 
238 
239  enum class proprietes_2d_t : puint8
240  {
243  };
245 
246 
247  typedef puint8 Poctet_t;
248 
252  class DLL_API Ppoint2D : public PBase
253  {
254  public:
255  inline explicit Ppoint2D(pfloat x_=COORD0, pfloat y_=COORD0) {x=x_; y=y_;}
256 
257  inline void defX(pfloat x_) { x=x_; }
258  inline void defY(pfloat y_) { y=y_; }
259  inline void defXY(pfloat x_, pfloat y_) { x=x_, y=y_; }
260  inline pfloat X() const { return x; }
261  inline pfloat Y() const { return y; }
262  inline pfloat &refX() { return x; }
263  inline pfloat &refY() { return y; }
264 
265  inline Ppoint2D &operator+=(const pfloat s) { x+=s; y+=s; return *this; }
266  inline Ppoint2D &operator-=(const pfloat s) { x-=s; y-=s; return *this; }
267  inline Ppoint2D &operator*=(const pfloat s) { x*=s; y*=s; return *this; }
268  inline Ppoint2D &operator/=(const pfloat s) { x/=s; y/=s; return *this; }
269  inline Ppoint2D &operator*=(const Ppoint2D &v) { x*=v.X(); y*=v.Y(); return *this; }
270  inline Ppoint2D &operator/=(const Ppoint2D &v) { x/=v.X(); y/=v.Y(); return *this; }
271  inline Ppoint2D &operator+=(const Ppoint2D &v) { x+=v.X(); y+=v.Y(); return *this; }
272  inline Ppoint2D &operator-=(const Ppoint2D &v) { x-=v.X(); y-=v.Y(); return *this;}
273 
274  inline Ppoint2D operator+(const pfloat s) const { return Ppoint2D(x+s, y+s); }
275  inline Ppoint2D operator-(const pfloat s) const { return Ppoint2D(x-s, y-s); }
276  inline Ppoint2D operator*(const pfloat s) const { return Ppoint2D(x*s, y*s); }
277  inline Ppoint2D operator/(const pfloat s) const { return Ppoint2D(x/s, y/s); }
278  inline Ppoint2D operator*(const Ppoint2D &v) const { return Ppoint2D(x*v.X(), y*v.Y()); }
279  inline Ppoint2D operator/(const Ppoint2D &v) const { return Ppoint2D(x/v.X(), y/v.Y()); }
280  inline Ppoint2D operator+(const Ppoint2D &v) const { return Ppoint2D(x+v.X(), y+v.Y()); }
281  inline Ppoint2D operator-(const Ppoint2D &v) const { return Ppoint2D(x-v.X(), y-v.Y()); }
282 
286  void normalise();
287 
291  inline Ppoint2D norme(const Ppoint2D &v2) const
292  {
293  Ppoint2D r(v2.x - x, v2.y - y);
294  r.normalise();
295  return r;
296  }
297 
301  inline bool operator<(const Ppoint2D& v) const
302  {
303  if (CompareED(x, v.x))
304  {
305  if (CompareED(y, v.y)) // Egalitée
306  {
307  return false;
308  }
309  return (y < v.y);
310  }
311  return (x < v.x);
312  }
313 
317  inline bool operator!=(const Ppoint2D &v) const { return !CompareED(x, v.x) || !CompareED(y, v.y); }
318 
322  inline bool operator==(const Ppoint2D &v) const { return CompareED(x, v.x) && CompareED(y, v.y); }
323 
328  inline pfloat Distance2(const Ppoint2D &p) const { return ( POW2(POSITIFD(x - p.X())) + POW2(POSITIFD(y - p.Y())) ); }
329 
333  inline Ppoint2D centre(const Ppoint2D &p) const { return Perspective3D::Ppoint2D( ((x+p.x)*0.5), ((y+p.y)*0.5 ) ); }
334 
339  inline pfloat Distance(const Ppoint2D &p) const { return RCARREF(Distance2(p)); }
340 
344  inline pfloat dot(const Ppoint2D &v) const { return (X()*v.X()) + (Y()*v.Y()); }
345 
346  inline pfloat at(puint i) const
347  {
348  return (i==0) ? x : ((i==1) ? y : -1);
349  }
350 
351  inline static size_t numDim() { return 2; }
352 
353  protected:
356  };
357 
361  typedef std::vector<Ppoint2D> PStdVectPoints2D;
362 
366  class DLL_API PPixel : public PBase
367  {
368  public:
369  inline explicit PPixel() : r(0), v(0), b(0), alpha(255) { }
370  inline explicit PPixel(Poctet_t r_, Poctet_t v_, Poctet_t b_, Poctet_t a=255) : r(r_), v(v_), b(b_), alpha(a) { }
371  inline explicit PPixel(puint32 v) { defIRVB(v); }
372 
373  inline PPixel(const PPixel &p) : r(p.r), v(p.v), b(p.b), alpha(p.alpha) { } /* Constructeur de copie. */
374 
375  inline bool Nulle() const { return (!r && !v && !b); }
376  inline void defNulle() { r=v=b=0; }
377 
378  inline bool operator==(const PPixel &c) const { return ((r == c.R()) && (v == c.V()) && (b == c.B())); }
379 
380  inline Poctet_t R() const { return r; }
381  inline Poctet_t V() const { return v; }
382  inline Poctet_t B() const { return b; }
383 
384  inline Poctet_t Alpha() const { return alpha; }
385 
386  inline void defR(Poctet_t rouge) { r=rouge; }
387  inline void defV(Poctet_t vert) { v=vert; }
388  inline void defB(Poctet_t bleu) { b=bleu; }
389  inline void defRVB(Poctet_t rouge, Poctet_t vert, Poctet_t bleu) { r=rouge; v=vert; b=bleu; }
390  inline void defRVBA(Poctet_t rouge, Poctet_t vert, Poctet_t bleu, Poctet_t opacite) { r=rouge; v=vert; b=bleu; alpha=opacite; }
391  inline void defAlpha(Poctet_t a) { alpha=a; }
392 
393  inline puint32 RVBi() const { return (( (static_cast<puint32>(r)) << 16 ) | ( (static_cast<puint32>(v)) << 8 ) | ( (static_cast<puint32>(b)) & 0xff )); }
394  inline void defIRVB(puint32 i) { r = (i >> 16) & 0xff; v = (i >> 8) & 0xff; b = (i) & 0xff; alpha = (i >> 24); }
395 
396  void toHSV(pfloat *val_h, pfloat *val_s, pfloat *val_v) const;
397  void toHSV(pfloat hsv[]) const;
398 
399  void fromHSV(pfloat val_h, pfloat val_s, pfloat val_v);
400  void fromHSV(const pfloat hsv[]);
401 
402  protected:
403  Poctet_t r, v, b;
405  };
406 
410  typedef std::vector<PPixel> PStdVectPixels;
411 
415  class DLL_API PPointPixel : public PBase
416  {
417  public:
418  inline explicit PPointPixel(pint x_, pint y_) : x(x_), y(y_) { }
419  inline explicit PPointPixel() : x(0), y(0) { }
420 
421  inline pint X() const { return x; }
422  inline pint Y() const { return y; }
423 
424  inline void defX(pint x_) { x=x_; }
425  inline void defY(pint y_) { y=y_; }
426  inline void defXY(pint x_, pint y_) { x=x_; y=y_; }
427 
428  inline bool Nul() const { return !x && !y; }
429 
430  inline bool operator==(const PPointPixel &p) const
431  { return (x == p.x) && (y == p.y); }
432 
433  inline bool operator!=(const PPointPixel &p) const
434  { return (x != p.x) || (y != p.y); }
435 
436  inline Ppoint2D Point2D() const
437  {
438  return Ppoint2D(pfloat(x), pfloat(y));
439  }
440 
441  protected:
442  pint x, y;
443  };
444 
448  typedef std::vector<PPointPixel> PStdVectPointsPixels;
449 
453  class DLL_API PCouleur_RAL // : public PBase
454  {
455  public:
460  const char *nom;
461  };
462 
466  class DLL_API PCouleur : public PPixel
467  {
468  public:
469  inline explicit PCouleur(): PPixel(), actif(true), div(false) { ; }
470  inline explicit PCouleur(const PPixel &p): PPixel(p), actif(true), div(false) { ; }
471 // inline explicit PCouleur(const PCouleur &c): r(c.r), v(c.v), b(c.b), actif(c.actif) { ; }
472  inline explicit PCouleur(const PCouleur_RAL &ral, bool actif_=true) : PPixel(ral.r, ral.v, ral.b), actif(actif_), div(false) { ; }
473  inline explicit PCouleur(Poctet_t rouge, Poctet_t vert, Poctet_t bleu, bool actif_=true) : PPixel(rouge, vert, bleu), actif(actif_), div(false) { ; }
474  inline explicit PCouleur(Poctet_t gris, bool actif_=true) : PPixel(gris, gris, gris), actif(actif_), div(false) { ; }
475 
476  explicit PCouleur(const vues2D_t vue);
477 
478  inline bool operator==(const PCouleur &c) const { return ((r == c.R()) && (v == c.V()) && (b == c.B())); }
479 
480  inline bool Actif() const { return actif; }
481  inline void defActif(bool a=true) { actif=a; }
482  inline PCouleur Inverse() const { const Poctet_t maxchar=255; return PCouleur(maxchar-r, maxchar-v, maxchar-b, actif); }
483 
484  inline PPixel Pixel() const { return PPixel(r, v, b, alpha); }
485 
486  PCouleur Restaure();
487  PCouleur Div();
488  PCouleur Div2();
489 
490  protected:
491  bool actif;
492  bool div;
493  };
494 
512  {
513  ParametresPerspective(pfloat tolerance=0.001, pint arrondi_dessin=3, pint divisionscercles=24, vues2D_t projections=vues2D_t::VUEFACE|vues2D_t::VUECOTE|vues2D_t::VUEHAUT, infos3d_t informations=infos3d_t::INUL, pint tailletexte3d=8, bool filaire_uniquement=false, bool multithreading=false, params_gen3d_t parametres3d=params_gen3d_t::PGEN3DNUL, puint taille_surfaces=256, normevues_t norme_vues=normevues_t::NORME_VUES_ISO, puint id_ral=9010, const pint8 *licence=nullptr, puint64 salage_licence=0) :
514  Tolerance(tolerance), Arrondi_dessin(arrondi_dessin), Divisionscercles(divisionscercles), Projections(projections), Informations(informations), Tailletexte3d(tailletexte3d), TailleDiagoUniforme(0), Filaire_uniquement(filaire_uniquement), MultiThreading(multithreading), Parametres3d(parametres3d), Taille_surfaces(taille_surfaces), Norme_vues(norme_vues), Id_ral(id_ral), Licence(licence), SalageLicence(salage_licence)
515  {
516  ;
517  }
518 
532  const pint8 *Licence;
534  };
535 
536 #ifdef SUPPORT_VISION2D
537 
541  {
542  puint SeuilActivation; /* Seuil d'activation des pixels (de 0 à 255) */
543  bool ContourSegments; /* Type de réduction (contour extérieur ou rétrécissement) */
544  PPixel CouleurTrace; /* Couleur du tracé. */
545  pfloat EpsilonCoords; /* Distance d'approximation pour considérer deux coordonnées comme semblables (version précise). */
546  pfloat ToleranceCoords1; /* Distance d'approximation pour considérer deux coordonnées comme semblables (version moyennement précise). */
547  pfloat ToleranceCoords2; /* Distance d'approximation pour considérer deux coordonnées comme semblables (version très approximative). */
548  pfloat ToleranceAngles; /* Différence d'approximation pour considérer deux angles comme semblables. */
550  pfloat ToleranceCourbure; /* Tolérance pour contrôle de la courbure par rapport aux segments représentant la courbe. */
551  pfloat ToleranceJointuresCentreCourbes; /* Tolérance de contrôle du centre pour joindre deux courbes. */
552  pfloat DeltaCourbesMin; /* Delta minimum pour accepter un arc de courbe. */
553  pfloat DeltaCourbesMax; /* Delta maximum pour accepter un arc de courbe. */
554  pfloat ToleranceNorms; /* Seuil de tolérance à appliquer pour la comparaison des vecteurs normaux. */
557  pfloat TailleGrille; /* Taille de la grille pour l'alignement des entités (optionnel) */
558  const pint8 *Licence;
560  };
561 
564  {
566  V2D_OK=0,
568  V2D_ASSEMBLAGE=1,
574  V2D_ERR_GROUPE=8,
580  V2D_TRACE_NUL=64
581  };
583 
584 #endif // SUPPORT_VISION2D
585 
591  class DLL_API PImage : public PBase
592  {
593  friend class PImagePriv;
594 
595  public:
596  explicit PImage(puint largeur_, puint hauteur_);
597  explicit PImage(puint largeur_, puint hauteur_, pushort bpp_, const Poctet_t *oct, bool dealloc_memoire=false);
598 
602  explicit PImage(const char *n);
603 
607  explicit PImage(const std::string &n);
608 
612  explicit PImage(const PStdVectPointsPixels &trajet, pfloat echelle=1.0, pint marge=10, const PPixel &couleur_fond=PPixel(255, 255, 255, 255));
613 
617  PImage(const PImage &img);
618 
619  ~PImage();
620 
624  bool ExportPNG(const char *n) const;
625 
629  bool ExportJPEG(const char *n) const;
630 
634  pushort TaillePixels() const { return bpp; }
635 
639  puint Hauteur() const { return hauteur; }
640 
644  puint Largeur() const { return largeur; }
645 
649  puint Taille() const;
650 
654  puint NombrePixels() const;
655 
659  const PPixel Pixel(pint i) const;
660 
664  const PPixel Pixel(pint x, pint y) const;
665 
669  inline bool Valide() const { return valide; }
670 
674  PImage& operator=(const PImage &img);
675 
679  PImage Copie() const;
680 
681  protected:
682  puint Pos(pint x, pint y) const;
683 
685  puint hauteur, largeur;
687  Poctet_t const *tampon_oct; /* Cas où l'on englobe un tableau statique */
688  bool valide;
689  mutable bool dealloc;
690  };
691 
695  class DLL_API PBaseId : public PBase
696  {
697  public:
698  inline PBaseId(pident id_) : id(id_) { }
699 
703  inline pident Id() const { return id; }
704 
708  inline void defId(pident i) { id=i; }
709 
713  inline bool IdNul() const { return id == IDNUL; }
714 
715  protected:
716  pident id; /* Identifiant de l'entité, doit pour chaque type valoir la position dans le vecteur d'entités (il est donc unique si il n'est pas nul) */
717  };
718 
722  class DLL_API PEntite : public PBaseId
723  {
724  public:
725  inline PEntite(pident id_) : PBaseId(id_), attributs(0) { }
726  inline PEntite(pident id_, puint16 attr) : PBaseId(id_), attributs(attr) { }
727 
728  inline puint16 Attributs() const { return attributs; }
729  inline puint16 &AttributsRef() { return attributs; }
730  inline void ReinitAttributs() { attributs = 0; }
731  inline void defAttributs(puint16 att) { attributs=att; }
732 
733  inline void AjoutAttribut(puint16 attr) { attributs |= attr; }
734  inline void RetireAttribut(puint16 attr) { attributs ^= attr; }
735  inline bool ValideAttribut(puint16 attr) const { return attributs & attr; }
736 
737  inline void AjoutAttributId(puint16 id) { AjoutAttribut(1<<id); }
738  inline void RetireAttributId(puint16 id) { RetireAttribut(1<<id); }
739  inline bool ValideAttributId(puint16 id) const { return ValideAttribut(1<<id); }
740 
741  protected:
742  puint16 attributs; /* Les attributs sont spécifiques à une allocation, ils ne seront pas copiés via les opérateurs de copie. */
743  };
744 
745  /* <2D> */
749  class DLL_API PEnt2D : public PEntite
750  {
751  public:
752  inline PEnt2D(): PEntite(IDNUL), vue(vues2D_t::VUENUL), proprietes(proprietes_2d_t::PROPRIETE_2D_NUL), couleur(PCouleur()) {}
753  inline PEnt2D(pident i): PEntite(i), vue(vues2D_t::VUENUL), proprietes(proprietes_2d_t::PROPRIETE_2D_NUL), couleur(PCouleur()) {}
754 
755  inline PEnt2D(pident i, vues2D_t v, bool c, const PCouleur&cl) : PEntite(i), vue(v), proprietes(proprietes_2d_t::PROPRIETE_2D_NUL), couleur(cl)
756  { defCache(c); }
757 
758  inline vues2D_t Vue() const { return vue; }
759  inline void defVue(vues2D_t v) { vue=v; }
760 
761  inline bool Cache() const { return proprietes & proprietes_2d_t::PROPRIETE_2D_CACHE; }
762  inline void defCache(bool c) { if (c != Cache()) { proprietes = ((c) ? (proprietes | proprietes_2d_t::PROPRIETE_2D_CACHE) : (proprietes ^ proprietes_2d_t::PROPRIETE_2D_CACHE)); } }
763 
764  inline PCouleur &Couleur() { return couleur; }
765  inline const PCouleur &CouleurConst() const { return couleur; }
766  inline void defCouleur(const PCouleur &c) { couleur=c; }
767 
768  inline void defProprietes(proprietes_2d_t props) { proprietes = props; }
769  inline proprietes_2d_t Proprietes() const { return proprietes; }
770 
771  protected:
772  vues2D_t vue; /* Vue sur laquelle a été dessinée l'entité. */
773  proprietes_2d_t proprietes; /* Proprietes. */
775  };
776 
780  class DLL_API Pligne2D: public PEnt2D
781  {
782  public:
783  inline Pligne2D(): PEnt2D(), p1(), p2(), point(false) { ; }
784 
785  inline Pligne2D(const Ppoint2D &p1_, const Ppoint2D &p2_, pident id_=IDNUL, bool cache_=false, bool point_=false, const PCouleur&c=PCouleur()) : PEnt2D(), p1(p1_), p2(p2_), point(point_)
786  {
787  defId(id_);
788  defCache(cache_); defCouleur(c);
789  }
790 
791  inline Pligne2D(const Pligne2D &l) : PEnt2D(l.Id(), l.Vue(), l.Cache(), l.CouleurConst()), p1(l.p1), p2(l.p2), point(l.point) { ; }
792 
793  inline Pligne2D& operator=(const Pligne2D &l)
794  {
795  defId(l.Id()); defVue(l.Vue());
796  defCache(l.Cache()); defCouleur(l.CouleurConst());
797  p1 = l.p1; p2 = l.p2; point = l.point;
798  return *this;
799  }
800 
801  inline Ppoint2D &P1() { return p1; }
802  inline const Ppoint2D &P1Const() const { return p1; }
803  inline void defP1(const Ppoint2D &p) { p1=p; }
804  inline void defP1(pfloat x, pfloat y) { p1.defXY(x, y); }
805 
806  inline Ppoint2D &P2() { return p2; }
807  inline const Ppoint2D &P2Const() const { return p2; }
808  inline void defP2(const Ppoint2D &p) { p2=p; }
809  inline void defP2(pfloat x, pfloat y) { p2.defXY(x, y);}
810 
811  inline bool Point() const { return point; }
812  inline void defPoint(bool p) { point=p; }
813 
814  inline pfloat Longueur2() const
815  {
816  return p1.Distance2(p2);
817  }
818 
819  inline pfloat Longueur() const
820  {
821  return p1.Distance(p2);
822  }
823 
824  bool Nulle() const;
825 
826  protected:
828  bool point; /* true si la ligne représente un point */
829  };
830 
834  typedef std::vector<Pligne2D> PStdVectLignes2D;
835 
839  class DLL_API Prect2D : public PEnt2D
840  {
841  public:
842  Prect2D(const Prect2D &r);
843  Prect2D(bool init_cadre_englobage=true);
844  Prect2D(const Ppoint2D &p1_, const Ppoint2D &p2_);
845  Prect2D(pfloat p1x, pfloat p1y, pfloat p2x, pfloat p2y);
846  Prect2D& operator=(const Prect2D &r);
847 
848  inline void defPmin(const Ppoint2D &p) { pmin = p; }
849  inline void defPmax(const Ppoint2D &p) { pmax = p; }
850 
851  inline const Ppoint2D &Pmin() const { return pmin; }
852  inline const Ppoint2D &Pmax() const { return pmax; }
853 
854 // inline const Ppoint2D &P1() const { return pmin; }
855 // inline Ppoint2D P2() const { return Ppoint2D(pmin.X()+Largeur(), pmin.Y()); }
856 // inline const Ppoint2D &P3() const { return pmax; }
857 // inline Ppoint2D P4() const { return Ppoint2D(pmin.X(), pmin.Y()+Hauteur()); }
858 
859  inline const Ppoint2D &P1() const { return pmin; }
860  inline Ppoint2D P2() const { return Ppoint2D(pmax.X(), pmin.Y()); }
861  inline const Ppoint2D &P3() const { return pmax; }
862  inline Ppoint2D P4() const { return Ppoint2D(pmin.X(), pmax.Y()); }
863 
864  inline pfloat Largeur() const { return pmax.X()-pmin.X(); }
865  inline pfloat Hauteur() const { return pmax.Y()-pmin.Y(); }
866 
867  inline pfloat Diago() const { return RCARREF(Largeur()*Largeur() + Hauteur()*Hauteur()); }
868 
869  inline Ppoint2D Centre() const { return Ppoint2D((pmin.X()+(Largeur()*.5)), (pmin.Y()+(Hauteur()*.5))); }
870 
871  bool ContientPoint(const Ppoint2D &p) const;
872  /* Le point est contenu dans le rectangle ? */
873 
874  bool CollisionRects(const Prect2D &r) const;
875  /* r au moins partiellement (1 sommet minimum) dans ce rectangle ? */
876 
877  bool CollisionRects2(const Prect2D &r) const;
878  /* r au moins partiellement (1 sommet minimum) dans ce rectangle ? (avec tolérance) */
879 
880  bool CollisionRectsX(const Prect2D &r, const pfloat tolerance) const;
881  /* r au moins partiellement (1 sommet minimum) dans ce rectangle ? (avec tolérance) */
882 
883  bool ContientBordRect(const Prect2D &r) const;
884  /* r au moins partiellement (2 sommets minimum) dans ce rectangle ? */
885 
886  bool ContientTotalementRect(const Prect2D &r) const;
887  /* r totalement englobé par ce rectangle ? */
888 
889  pfloat Distance(const Ppoint2D &p) const;
890  pfloat Distance(const Prect2D &r) const;
891  void InvY();
892 
893  void InitEnglobage();
894 
895  void EnglobePoint(const Ppoint2D &p);
896  /* Assigne les coordonnées du point si l'une d'entre elle dépasse p1 ou p2.
897  Utilisé pour gérer la boite englobante d'une suite de points. */
898 
899  bool Nul() const;
900 
901  inline void EnglobeLigne(const Pligne2D &l)
902  /* Comme EnglobePoint, mais avec une suite de lignes. */
903  {
904  EnglobePoint(l.P1Const());
905  EnglobePoint(l.P2Const());
906  }
907 
908  inline void EnglobeRect(const Prect2D &r)
909  /* Englobe r dans ce rectangle. */
910  {
911  EnglobePoint(r.Pmin());
912  EnglobePoint(r.Pmax());
913  }
914 
915  void Dilate(pfloat x, pfloat y);
916  /* Effectue un décalage sur la boite englobante (pour l'agrandir ou la rétrécir si les valeurs sont positives ou négatives. */
917 
918  void Dilate(pfloat xy);
919 
920  void RedefOrigineEnglobage(pfloat x, pfloat y);
921 
922  inline bool ValideEnglobage() const { return (pmin.X() < pmax.X() && pmin.Y() < pmax.Y()); }
923 
924  inline pfloat Aire() const { return Largeur()*Hauteur(); }
925 
926  protected:
928  Ppoint2D pmin, pmax;
929  };
930 
934  typedef std::vector<Prect2D> PStdVectRect2D;
935 
939  class DLL_API Pellipse2D: public PEnt2D
940  {
941  public:
942  inline Pellipse2D(): PEnt2D(), centre(), lg(COORD0), ht(COORD0), angle1(COORD0), angle2(COORD0), rotation(0.), ferme(true) { ; }
943 
944  inline Pellipse2D(const Pellipse2D &e) : PEnt2D(e.Id(), e.Vue(), e.Cache(), e.CouleurConst()),
945  centre(e.centre), lg(e.lg), ht(e.ht), angle1(e.angle1), angle2(e.angle2), rotation(e.rotation), ferme(e.ferme) { ; }
946 
947  inline Pellipse2D(const Ppoint2D &centre_, pfloat lg_, pfloat ht_, pfloat angle1_, pfloat angle2_, pfloat rotation_=0., pident id_=IDNUL, bool cache_=false):
948  PEnt2D(id_), ferme(true)
949  {
950  ferme = CompareE(POSITIFD(angle2_-angle1_), 360.);
951  centre=centre_; lg=lg_; ht=ht_; angle1=angle1_; angle2=angle2_; rotation=rotation_; defCache(cache_);
952 // vue = vues2D_t::VUENUL;
953  }
954 
955  inline Pellipse2D& operator=(const Pellipse2D &e)
956  {
957  defId(e.Id()); defVue(e.Vue()); defCache(e.Cache()); defCouleur(e.CouleurConst());
958  centre = e.centre; lg = e.lg; ht = e.ht; angle1 = e.angle1; angle2 = e.angle2; rotation = e.rotation; ferme = e.ferme;
959  return *this;
960  }
961 
962  inline bool Ferme() const { return ferme; }
963  inline void defFerme(bool f) { ferme=f; }
964 
965  inline pfloat Rotation() const { return rotation; }
966  inline void defRotation(pfloat r) { rotation=r; }
967 
968  inline pfloat Angle1() const { return angle1; }
969  inline void defAngle1(pfloat a) { angle1=a; }
970 
971  inline pfloat Angle2() const { return angle2; }
972  inline void defAngle2(pfloat a) { angle2=a; }
973 
974  inline pfloat Lg() const { return lg; }
975  inline void defLg(pfloat l) { lg=l; }
976 
977  inline pfloat Ht() const { return ht; }
978  inline void defHt(pfloat h) { ht=h; }
979 
980  inline Ppoint2D &Centre() { return centre; }
981  inline const Ppoint2D &CentreConst() const { return centre; }
982  inline void defCentre(const Ppoint2D &c) { centre = c; }
983 
984  Prect2D rectangle() const;
985 
986  protected:
987  Ppoint2D centre; /* Centre. */
988  pfloat lg; /* Longueur (diamètre sens horizontal). */
989  pfloat ht; /* Hauteur (diamètre sens vertical, même valeur que lg pour un cercle. */
990  pfloat angle1; /* Premier angle, 0 pour un cercle complet. */
991  pfloat angle2; /* Second angle, 360 pour un cercle complet. */
992  pfloat rotation; /* Angle de rotation global. */
993  bool ferme;
994  };
995 
999  typedef std::vector<Pellipse2D> PStdVectEllipses2D;
1000 
1004  class DLL_API PTexte2D: public PEnt2D
1005  {
1006  public:
1007  PTexte2D();
1008  PTexte2D(const PTexte2D &t);
1009  PTexte2D(const char *texte_, const Ppoint2D &position_, pfloat taille_, pfloat rotation_);
1010  PTexte2D& operator=(const PTexte2D &t);
1011  ~PTexte2D();
1012 
1013  inline const Ppoint2D &Position() const { return position; }
1014  inline void defPosition(const Ppoint2D &p) { position.defXY(p.X(), p.Y()); }
1015  inline void defPositionX(pfloat x) { position.defX(x); }
1016  inline void defPositionY(pfloat y) { position.defY(y); }
1017 
1018  inline pfloat TailleTexte() const { return taille; }
1019  inline void defTailleTexte(pfloat t) { taille=t; }
1020 
1021  inline pfloat Rotation() const { return rotation; }
1022  inline void defRotation(pfloat r) { rotation=r; }
1023 
1024  puint DefTexte(const char *s);
1025 
1026  void Suppr(); /* Supprime le contenu du texte. Libère la mémoire de la chaîne de caractères ! */
1027 
1028  inline const char *Texte() const { return texte; }
1029  inline puint LongueurTexte() const { return longueur_txt; }
1030 
1031  protected:
1032  char *texte;
1037  };
1038 
1042  typedef std::vector<PTexte2D> PStdVectTextes2D;
1043 
1047  class DLL_API PGroupeEnts2D : public PBase
1048  {
1049  friend class PGroupeEnts2DPriv;
1050 
1051  public:
1052  PGroupeEnts2D();
1053  ~PGroupeEnts2D();
1054 
1058  void Vide();
1059 
1063  bool Valide() const;
1064 
1068  pint CompteurEntites() const;
1069 
1074  inline const PStdVectLignes2D &ListeLignes() const
1075  {
1076  return *listelignes;
1077  }
1078 
1083  inline const PStdVectEllipses2D &ListeEllipses() const
1084  {
1085  return *listeellipses;
1086  }
1087 
1092  inline const PStdVectTextes2D &ListeTextes() const
1093  {
1094  return *listetextes;
1095  }
1096 
1101  inline const PStdVectPoints2D &ListePoints() const
1102  {
1103  return *listepoints;
1104  }
1105 
1106  protected:
1111  };
1112 
1116  typedef std::vector<PGroupeEnts2D *> PStdVectGroupeEnts2D;
1117 
1121  class DLL_API PScene2D : public PBase
1122  {
1123  friend class PScene2DPriv;
1124 
1125  public:
1126  PScene2D();
1127 
1128  ~PScene2D();
1129 
1133  bool ImportDXF(const std::string &fichier, bool ignore_non_imprimable=false, bool nouveau_groupe=false);
1134 
1135 #ifdef SUPPORT_VISION2D
1136 
1139  resultat_vision2d_t ImportImage(const PImage &img, const ParametresVision &parametres, pfloat origine_x=0.0, pfloat origine_y=0.0, bool nouveau_groupe=false);
1140 #endif // SUPPORT_VISION2D
1141 
1145  bool ExportDXF(const std::string &fichier) const;
1146 
1151  pint Avancement() const;
1152 
1156  void Vide();
1157 
1161  bool ValideScene() const;
1162 
1166  bool AjoutGroupe();
1167 
1171  pint AjoutLigne(const Pligne2D &ligne);
1172 
1176  pint AjoutEllipse(const Pellipse2D &ellipse);
1177 
1181  pint AjoutTexte(const PTexte2D &texte);
1182 
1186  pint AjoutPoint(const Ppoint2D &position);
1187 
1193  bool LiberationImport();
1194 
1198  const PStdVectGroupeEnts2D &Groupes() const;
1199 
1203  const PGroupeEnts2D *DernierGroupe() const;
1204 
1208  bool SupprimeDernierGroupe();
1209 
1213  bool RestaureDernierGroupe();
1214 
1218  pint CompteurEntites() const;
1219 
1220  protected:
1223 
1224  private:
1225  int type_import;
1226  void *ptr_import;
1227  };
1228 
1229  /* </2D> */
1230 
1231  /* <23D> */
1235  class DLL_API PEnt23D : public PEntite
1236  {
1237  public:
1238  inline PEnt23D(pident id_, proprietes_3d_t props): PEntite(id_), proprietes(props), couleur() { ; }
1239  inline PEnt23D(const PCouleur &c, pident id_, proprietes_3d_t props): PEntite(id_), proprietes(props), couleur(c) { ; }
1240  inline PEnt23D(): PEntite(IDNUL), proprietes(proprietes_3d_t::PROPRIETE_3D_NUL), couleur() { ; }
1241 
1242  inline const PCouleur &CouleurConst() const { return couleur; }
1243  inline PCouleur &Couleur() { return couleur; }
1244  inline void defCouleur(const PCouleur &c) { couleur=c; }
1245 
1246  inline void defProprietes(proprietes_3d_t props) { proprietes = props; }
1247  inline proprietes_3d_t Proprietes() const { return proprietes; }
1248 
1249  inline bool Courbe() const
1250  {
1251  return proprietes & proprietes_3d_t::PROPRIETE_3D_COURBE;
1252  }
1253 
1254  inline void defCourbe(bool etat)
1255  {
1256  if (etat != Courbe())
1257  {
1258  proprietes = (etat) ? (proprietes | proprietes_3d_t::PROPRIETE_3D_COURBE) : (proprietes ^ proprietes_3d_t::PROPRIETE_3D_COURBE);
1259  }
1260  }
1261 
1262  inline bool Trou() const
1263  {
1264  return proprietes & proprietes_3d_t::PROPRIETE_3D_TROU;
1265  }
1266 
1267  inline void defTrou(bool etat)
1268  {
1269  if (etat != Trou())
1270  {
1271  proprietes = (etat) ? (proprietes | proprietes_3d_t::PROPRIETE_3D_TROU) : (proprietes ^ proprietes_3d_t::PROPRIETE_3D_TROU);
1272  }
1273  }
1274 
1275  protected:
1278  };
1279 
1283  class DLL_API Pvec3 : public PBaseId
1284  {
1285  public:
1286  inline Pvec3(): PBaseId(IDNUL), x(COORD0), y(COORD0), z(COORD0) { ; }
1287  inline Pvec3(pfloat x_, pfloat y_, pfloat z_) : PBaseId(IDNUL), x(x_), y(y_), z(z_) { ; }
1288  inline Pvec3(pfloat x_, pfloat y_, pfloat z_, pident id_) : PBaseId(id_), x(x_), y(y_), z(z_) { ; }
1289  inline Pvec3(const Pvec3 &p1, const Pvec3 &p2) : PBaseId(IDNUL), x(p2.x-p1.x), y(p2.y-p1.y), z(p2.z-p1.z) { ; }
1290 
1291  Pvec3(const Ppoint2D &p1, pfloat z_=0., vues2D_t vue=vues2D_t::VUEFACE);
1292  Pvec3(const Ppoint2D &f, const Ppoint2D &c, const Ppoint2D &h);
1293 
1294  inline Pvec3(const Pvec3 &p) : PBaseId(p.id), x(p.x), y(p.y), z(p.z) { ; } /* Constructeur de copie. */
1295 
1296  Pvec3& operator=(const Pvec3 &p);
1297 
1298  inline Pvec3 &operator+=(const pfloat s) { x+=s; y+=s; z+=s; return *this; }
1299  inline Pvec3 &operator-=(const pfloat s) { x-=s; y-=s; z-=s; return *this; }
1300  inline Pvec3 &operator*=(const pfloat s) { x*=s; y*=s; z*=s; return *this; }
1301  inline Pvec3 &operator/=(const pfloat s) { x/=s; y/=s; z/=s; return *this; }
1302  inline Pvec3 &operator*=(const Pvec3 &v) { x*=v.x; y*=v.y; z*=v.z; return *this; }
1303  inline Pvec3 &operator/=(const Pvec3 &v) { x/=v.x; y/=v.y; z/=v.z; return *this; }
1304  inline Pvec3 &operator+=(const Pvec3 &v) { x+=v.x; y+=v.y; z+=v.z; return *this; }
1305  inline Pvec3 &operator-=(const Pvec3 &v) { x-=v.x; y-=v.y; z-=v.z; return *this;}
1306 
1307  inline Pvec3 operator+(const pfloat s) const { return Pvec3(x+s, y+s, z+s); }
1308  inline Pvec3 operator-(const pfloat s) const { return Pvec3(x-s, y-s, z-s); }
1309  inline Pvec3 operator*(const pfloat s) const { return Pvec3(x*s, y*s, z*s); }
1310  inline Pvec3 operator/(const pfloat s) const { return Pvec3(x/s, y/s, z/s); }
1311  inline Pvec3 operator*(const Pvec3 &v) const { return Pvec3(x*v.x, y*v.y, z*v.z); }
1312  inline Pvec3 operator/(const Pvec3 &v) const { return Pvec3(x/v.x, y/v.y, z/v.z); }
1313  inline Pvec3 operator+(const Pvec3 &v) const { return Pvec3(x+v.x, y+v.y, z+v.z); }
1314  inline Pvec3 operator-(const Pvec3 &v) const { return Pvec3(x-v.x, y-v.y, z-v.z); }
1315 
1319  inline bool operator!=(const Pvec3 &v) const { return !CompareED(x, v.x) || !CompareED(y, v.y) || !CompareED(z, v.z); }
1320 
1324  inline bool operator==(const Pvec3 &v) const
1325  {
1326  return ( CompareED(x, v.x) && CompareED(y, v.y) && CompareED(z, v.z) );
1327  }
1328 
1332  inline bool operator<(const Pvec3& v) const
1333  {
1334  if (CompareED(x, v.x))
1335  {
1336  if (CompareED(y, v.y))
1337  {
1338  if (CompareED(z, v.z)) // Egalitée
1339  return false;
1340  return (z < v.z);
1341  }
1342  return (y < v.y);
1343  }
1344  return (x < v.x);
1345  }
1346 
1350  inline Pvec3 centre(const Pvec3 &v) const { return (v + *this) * 0.5; }
1351 
1355  inline Pvec3 cross(const Pvec3 &v) const { return Pvec3((Y()*v.Z()) - (Z()*v.Y()), (Z()*v.X()) - (X()*v.Z()), (X()*v.Y()) - (Y()*v.X())); }
1356 
1360  inline pfloat dot(const Pvec3 &v) const { return (X()*v.X()) + (Y()*v.Y()) + (Z()*v.Z()); }
1361 
1365  inline pfloat magnitude() const { return RCARREF(POW2(X()) + POW2(Y()) + POW2(Z())); }
1366 
1370  inline pfloat Distance2(const Pvec3 &p) const { return ( POW2(POSITIFD(x - p.X())) + POW2(POSITIFD(y - p.Y())) + POW2(POSITIFD(z - p.Z())) ); }
1371 
1375  inline pfloat Distance (const Pvec3 &p) const { return RCARREF(Distance2(p)); }
1376 
1380  inline pfloat lg2() const { return (X()*X()) + (Y()*Y()) + (Z()*Z()); }
1381 
1385  inline pfloat lg() const { return RCARREF(lg2()); }
1386 
1390  Pvec3 inv() const;
1391 
1395  void inv();
1396 
1400  void normalise();
1401 
1406  bool norme();
1407 
1413  Pvec3 echelle(const Pvec3 &origine, const Pvec3 &vecteur_echelle);
1414 
1419  Pvec3 norm(const Pvec3 &origine) const;
1420 
1425  Pvec3 vect(const Pvec3 &origine) const;
1426 
1430  inline pfloat X() const { return x; }
1431 
1435  inline void defX(pfloat x_) { x=x_; }
1436 
1440  inline pfloat Y() const { return y; }
1441 
1445  inline void defY(pfloat y_) { y=y_; }
1446 
1450  inline pfloat Z() const { return z; }
1451 
1455  inline void defZ(pfloat z_) { z=z_; }
1456 
1460  inline void defCoords(pfloat x_=COORD0, pfloat y_=COORD0, pfloat z_=COORD0) { x=x_; y=y_; z=z_; }
1461 
1465  inline void defCoords(const Pvec3 &p) { x=p.x; y=p.y; z=p.z; }
1466 
1470  bool defCoords2D(const Ppoint2D &p2d, vues2D_t vue);
1471 
1475  bool defCoords2D(const Ppoint2D &p2d, vues2D_t vue, pfloat z);
1476 
1480  bool defCoords2D(const Pvec3 &p3d, vues2D_t vue);
1481 
1485  bool AjoutCoords2D(const Ppoint2D &p2d, vues2D_t vue);
1486 
1490  Ppoint2D Point2D(vues2D_t vue) const;
1491 
1492  inline bool CoordNul() const { return CompareE(x, COORD0) && CompareE(y, COORD0) && CompareE(z, COORD0); }
1493  inline bool Nul() const { return id==IDNUL && CoordNul(); }
1494 
1495  inline pfloat at(pint i) const
1496  {
1497  return (i==0) ? x : ((i==1) ? y : ((i==2) ? z : -1));
1498  }
1499 
1500  inline static size_t numDim() { return 3; }
1501 
1502  protected:
1503  pfloat x, y, z;
1504  };
1505 
1510  {
1511  public:
1513 
1514  inline Ppoint3D_min(const Pvec3 &v): PEnt23D(v.Id(), proprietes_3d_t::PROPRIETE_3D_NUL), vec(v) { ; }
1515 
1516  inline Ppoint3D_min(pfloat x_, pfloat y_, pfloat z_, pident id_=IDNUL): PEnt23D(id_, proprietes_3d_t::PROPRIETE_3D_NUL), vec(x_, y_, z_, id_) { ; }
1517  inline Ppoint3D_min(pfloat x_, pfloat y_, pfloat z_, const PCouleur &cl, pident id_=IDNUL): PEnt23D(cl, id_, proprietes_3d_t::PROPRIETE_3D_NUL), vec(x_, y_, z_, id_) { ; }
1518 
1519  inline Ppoint3D_min(const Ppoint3D_min &p1, const Ppoint3D_min &p2) : PEnt23D(IDNUL, proprietes_3d_t::PROPRIETE_3D_NUL), vec(p1.vec, p2.vec) { ; }
1520 
1521  inline Ppoint3D_min(const Ppoint3D_min &p) : PEnt23D(p.couleur, p.id, p.proprietes), vec(p.vec) { ; } /* Constructeur de copie. */
1522 
1524  {
1525  defId(p.Id());
1526  defCouleur(p.CouleurConst());
1527  defProprietes(p.Proprietes());
1528  vec = p.vec;
1529  return *this;
1530  }
1531 
1532  inline void defId(pident id_)
1533  {
1534  id = id_;
1535  vec.defId(id_);
1536  }
1537 
1538  inline const Pvec3& Vec3() const
1539  {
1540  return vec;
1541  }
1542 
1544  {
1545  return vec;
1546  }
1547 
1551  inline bool operator!=(const Ppoint3D_min &v) const { return vec != v.vec; }
1552 
1556  inline bool operator==(const Ppoint3D_min &v) const
1557  {
1558  return vec == v.vec;;
1559  }
1560 
1564  inline bool operator<(const Ppoint3D_min& v) const
1565  {
1566  return (vec < v.vec);
1567  }
1568 
1572  inline pfloat X() const { return vec.X(); }
1573 
1577  inline void defX(pfloat x_) { vec.defX(x_); }
1578 
1582  inline pfloat Y() const { return vec.Y(); }
1583 
1587  inline void defY(pfloat y_) { vec.defY(y_); }
1588 
1592  inline pfloat Z() const { return vec.Z(); }
1593 
1597  inline void defZ(pfloat z_) { vec.defZ(z_); }
1598 
1602  inline void defCoords(pfloat x_=COORD0, pfloat y_=COORD0, pfloat z_=COORD0) { vec.defCoords(x_, y_, z_); }
1603 
1607  inline void defCoords(const Ppoint3D_min &p) { vec.defCoords(p.vec); }
1608 
1612  inline pfloat Distance2(const Ppoint3D_min &p) const { return vec.Distance2(p.vec); }
1613 
1617  inline pfloat Distance (const Ppoint3D_min &p) const { return vec.Distance(p.vec); }
1618 
1619  inline bool CoordNul() const { return vec.CoordNul(); }
1620 
1621  inline bool Nul() const { return id==IDNUL && CoordNul(); }
1622 
1623  inline pfloat at(pint i) const
1624  {
1625  return (vec.at(i));
1626  }
1627 
1628  inline static size_t numDim() { return 3; }
1629 
1630  protected:
1632  };
1633 
1644  class DLL_API PMat4x4_data : public PBase
1645  {
1646  public:
1650  inline PMat4x4_data()
1651  {
1652  identite();
1653  data_m[16] = 0;
1654  }
1655 
1659  inline PMat4x4_data(const pfloat *m)
1660  {
1661  def(m);
1662  data_m[16] = 0;
1663  }
1664 
1668  inline PMat4x4_data(const PMat4x4_data &copie)
1669  {
1670  def(copie.data());
1671  data_m[16] = 0;
1672  }
1673 
1677  inline PMat4x4_data(const Pvec3 &axe_x, const Pvec3 &axe_y, const Pvec3 &axe_z, const Pvec3 &position)
1678  {
1679  defAxeX(axe_x);
1680  defAxeY(axe_y);
1681  defAxeZ(axe_z);
1682  defPosition(position);
1683  data_m[16] = 0;
1684  }
1685 
1689  void lookAt(const Pvec3 &origine_abs, const Pvec3 &destination_abs, const Pvec3 &up);
1690 
1691  void lookAt(const Pvec3 &origine_abs, const Pvec3 &destination_abs);
1692 
1696  inline void def(const pfloat *m)
1697  {
1698  data_m[0] = m[0]; data_m[1] = m[1]; data_m[2] = m[2]; data_m[3] = m[3];
1699  data_m[4] = m[4]; data_m[5] = m[5]; data_m[6] = m[6]; data_m[7] = m[7];
1700  data_m[8] = m[8]; data_m[9] = m[9]; data_m[10]= m[10]; data_m[11]= m[11];
1701  data_m[12]= m[12]; data_m[13]= m[13]; data_m[14]= m[14]; data_m[15]= m[15];
1702  }
1703 
1707  inline void defColonne(puint index, pfloat m1, pfloat m2, pfloat m3, pfloat m4)
1708  {
1709  if (index < 4)
1710  {
1711  const puint idt = index * 4;
1712  data_m[idt] = m1; data_m[idt + 1] = m2; data_m[idt + 2] = m3; data_m[idt + 3] = m4;
1713  }
1714  }
1715 
1716  inline void defAxeX(const Pvec3 &axe)
1717  {
1718  defColonne(0, axe.X(), axe.Y(), axe.Z(), 0);
1719  }
1720 
1721  inline void defAxeY(const Pvec3 &axe)
1722  {
1723  defColonne(1, axe.X(), axe.Y(), axe.Z(), 0);
1724  }
1725 
1726  inline void defAxeZ(const Pvec3 &axe)
1727  {
1728  defColonne(2, axe.X(), axe.Y(), axe.Z(), 0);
1729  }
1730 
1731  inline void defPosition(const Pvec3 &position)
1732  {
1733  defColonne(3, position.X(), position.Y(), position.Z(), 1);
1734  }
1735 
1739  inline void identite()
1740  {
1741  data_m[0] = data_m[5] = data_m[10] = data_m[15] = 1.0;
1742  data_m[1] = data_m[2] = data_m[3] = data_m[4] = data_m[6] = data_m[7] = data_m[8] = data_m[9] = data_m[11] = data_m[12] = data_m[13] = data_m[14] = 0.0;
1743  }
1744 
1748  inline const pfloat *data() const
1749  {
1750  return data_m;
1751  }
1752 
1756  inline const pfloat& at(puint i) const
1757  {
1758  return data_m[i < 16 ? i : 16];
1759  }
1760 
1764  inline pfloat& at(puint i)
1765  {
1766  return data_m[i < 16 ? i : 16];
1767  }
1768 
1772  static inline puint size()
1773  {
1774  return 16;
1775  }
1776 
1777  private:
1778  pfloat data_m[17];
1779  };
1780 
1784  typedef std::vector<Pvec3> PStdVectPoint3D_min;
1785 
1790  {
1791  public:
1792  inline Ppoint3D(const Pvec3 &p) : Ppoint3D_min(p),
1793  connexion_lignes(0), id_connexion_courbe(IDNUL) { ; }
1794 
1795  inline Ppoint3D(const Ppoint3D_min &p) : Ppoint3D_min(p),
1796  connexion_lignes(0), id_connexion_courbe(IDNUL) { ; }
1797 
1798  inline Ppoint3D(const Ppoint3D &p) : Ppoint3D_min(p.X(), p.Y(), p.Z(), p.CouleurConst(), p.Id()),
1799  connexion_lignes(p.connexion_lignes), id_connexion_courbe(p.id_connexion_courbe)
1800  {
1801  defProprietes(p.Proprietes());
1802  }
1803 
1804  inline Ppoint3D(): connexion_lignes(0), id_connexion_courbe(IDNUL) { ; }
1805 
1806  inline Ppoint3D(pfloat x_, pfloat y_, pfloat z_, pident id_=IDNUL, bool ellipse_=false): Ppoint3D_min(x_, y_, z_, id_),
1807  connexion_lignes(0), id_connexion_courbe(IDNUL)
1808  {
1809  defCourbe(ellipse_);
1810  }
1811 
1812  inline Ppoint3D& operator=(const Ppoint3D &p)
1813  {
1814  defId(p.Id()); defCouleur(p.CouleurConst()); defCoords(p.X(), p.Y(), p.Z());
1815  defProprietes(p.Proprietes());
1816  connexion_lignes = p.connexion_lignes; id_connexion_courbe=p.id_connexion_courbe;
1817  return *this;
1818  }
1819 
1820  inline void defId(pident id_)
1821  {
1822  id = id_;
1823  vec.defId(id_);
1824  }
1825 
1826  inline pident IdConnexionCourbe() const { return id_connexion_courbe; }
1827  inline void defIdConnexionCourbe(pident id) { id_connexion_courbe=id; }
1828 
1829  inline puint ConnexionLignes() const { return connexion_lignes; }
1830  inline void IncConnexionLignes() { ++connexion_lignes; }
1831 
1832  protected:
1835  };
1836 
1840  typedef std::vector<Ppoint3D> PStdVectPoint3D;
1841 
1845  class DLL_API Pligne3D: public PEnt23D
1846  {
1847  public:
1848  inline Pligne3D(): PEnt23D(), norml(), jointure_trou(false) { ; }
1849 
1850  inline Pligne3D(const Pligne3D &l) : PEnt23D(l.CouleurConst(), l.Id(), l.Proprietes()),
1851  p1p(l.p1p), p2p(l.p2p), norml(l.norml), jointure_trou(l.jointure_trou)
1852  {
1853  ;
1854  }
1855 
1856  inline Pligne3D(const Ppoint3D &p1_, const Ppoint3D &p2_, pident id_=IDNUL, bool ellipse_=false): PEnt23D(),
1857  p1p(p1_), p2p(p2_), norml(Pvec3()), jointure_trou(false)
1858  {
1859  defId(id_); defCourbe(ellipse_);
1860  }
1861 
1862  inline Pligne3D& operator=(const Pligne3D &l)
1863  {
1864  defProprietes(l.Proprietes());
1865  defId(l.Id()); defCouleur(l.CouleurConst());
1866  p1p = l.p1p; p2p = l.p2p; norml = l.norml; jointure_trou = l.jointure_trou;
1867  return *this;
1868  }
1869 
1870  inline const Ppoint3D &P1Const() const { return p1p; }
1871  inline const Ppoint3D &P2Const() const { return p2p; }
1872 
1873  inline const Pvec3 &V1Const() const { return p1p.Vec3(); }
1874  inline const Pvec3 &V2Const() const { return p2p.Vec3(); }
1875 
1876  inline Ppoint3D &P1() { return p1p; }
1877  inline Ppoint3D &P2() { return p2p; }
1878  inline void defP1(const Ppoint3D &p) { p1p=p; defId(IDNUL); } /* Si on change un point, l'id n'est plus fiable. */
1879  inline void defP2(const Ppoint3D &p) { p2p=p; defId(IDNUL); }
1880 
1881  inline void defPoints(const Ppoint3D &p1, const Ppoint3D &p2) { p1p=p1; p2p=p2; defId(IDNUL); }
1882 
1883  inline void defCourbe(bool e)
1884  {
1885  PEnt23D::defCourbe(e);
1886  p1p.defCourbe(e); p2p.defCourbe(e);
1887  }
1888 
1889  inline bool ConnexionTrou() const { return Trou(); }
1890  inline void defConnexionTrou(bool c) { defTrou(c); }
1891 
1892  inline bool JointureTrou() const { return jointure_trou; }
1893  inline void defJointureTrou(bool c) { jointure_trou = c; }
1894 
1895  const Pvec3 &NormL() const { return norml; }
1896  void defNormL(const Pvec3 &n) { norml=n; }
1897 
1898  inline pfloat Longueur2() const { return p1p.Distance2(p2p); } /* Longueur de la ligne au carré */
1899  inline pfloat Longueur() const { return p1p.Distance(p2p); } /* Longueur de la ligne. */
1900 
1901  inline bool Nulle() const { return (p1p == p2p); }
1902 
1906  inline bool operator==(const Pligne3D &l) const
1907  {
1908  return ( ((p1p == l.p1p) && (p2p == l.p2p)) || ((p1p == l.p2p) && (p2p == l.p1p)) );
1909  }
1910 
1914  inline bool operator<(const Pligne3D& l) const
1915  {
1916  if (p1p < p2p)
1917  { return ( (p1p < l.p1p) && (p1p < l.p2p) ); }
1918  return ( (p2p < l.p1p) && (p2p < l.p2p) );
1919  }
1920 
1921  protected:
1926  };
1927 
1931  typedef std::vector<Pligne3D> PStdVectLigne3D;
1932 
1933  /* </23D> */
1934 
1935  /* <3D> */
1939  class DLL_API PEnt3D: public PEnt23D
1940  {
1941  public:
1942  inline PEnt3D(): PEnt23D(IDNUL, proprietes_3d_t::PROPRIETE_3D_NUL), actif(true) { ; }
1943  inline PEnt3D(const PCouleur &c, pident i, bool a) : PEnt23D(c, i, proprietes_3d_t::PROPRIETE_3D_NUL), actif(a) { ; }
1944 
1945  inline bool Actif() const { return actif; }
1946  inline void defActif(bool a) { actif=a; }
1947 
1948  protected:
1949  bool actif;
1950  };
1951 
1955  class DLL_API PEnt3DExt: public PEnt3D
1956  {
1957  public:
1958  inline PEnt3DExt(): PEnt3D(), norm() { ; }
1959  inline PEnt3DExt(const PCouleur &c, pident i, const Pvec3 &n, bool a) : PEnt3D(c, i, a), norm(n) { ; }
1960 
1961  inline const Pvec3 &Norm() const { return norm; }
1962  inline Pvec3 &NormNonConst() { return norm; }
1963 
1964  inline void defNorm(const Pvec3 &n) { norm=n; }
1965  inline void defNorm(pfloat x, pfloat y, pfloat z) { norm.defCoords(x, y, z); }
1966 
1967  protected:
1969  };
1970 
1974  class DLL_API PSegment3D : public PEnt3D
1975  {
1976  friend class PSegment3DPriv;
1977 
1978  public:
1979  inline PSegment3D(): PEnt3D(), v1(), v2(), courbe(false) { ; }
1980  PSegment3D(const PSegment3D &tr);
1981  PSegment3D(const Pvec3 &p1, const Pvec3 &p2, PCouleur const &couleur_=PCouleur(), bool courbe_=false, pident id_=IDNUL);
1982  PSegment3D& operator=(const PSegment3D &tr);
1983 
1984  inline bool Courbe() const
1985  {
1986  return courbe;
1987  }
1988 
1992  inline const Pvec3 &V1() const { return v1; }
1993 
1997  inline const Pvec3 &V2() const { return v2; }
1998 
1999  protected:
2002  bool courbe;
2003  };
2004 
2008  typedef std::vector<PSegment3D> PStdVectSegments3D;
2009 
2013  class DLL_API PSommet3D : public PEnt3DExt
2014  {
2015  friend class PSommet3DPriv;
2016 
2017  public:
2018  inline PSommet3D() : PEnt3DExt(), v1() { ; }
2019 
2020  PSommet3D(const PSommet3D &tr);
2021 
2022  PSommet3D(const Pvec3 &p1, const Pvec3 &norm=Pvec3(0,0,0), PCouleur const &couleur_=PCouleur());
2023 
2024  PSommet3D& operator=(const PSommet3D &tr);
2025 
2026  void defId(pident id_);
2027 
2031  inline const Pvec3 &V1() const { return v1; }
2032 
2033  protected:
2035  };
2036 
2040  typedef std::vector<PSommet3D> PStdVectSommets3D;
2041 
2046  {
2047  friend class Ptriangle3DPriv;
2048 
2049  public:
2050  inline Ptriangle3D(): PEnt3DExt(), v1(), v2(), v3() { ; }
2051 
2052  Ptriangle3D(const Ptriangle3D &tr);
2053 
2054  Ptriangle3D(const Pvec3 &p1, const Pvec3 &p2, const Pvec3 &p3, const Pvec3 norm_=Pvec3(), PCouleur const &couleur_=PCouleur(), pident id_=IDNUL);
2055 
2056  Ptriangle3D& operator=(const Ptriangle3D &tr);
2057 
2061  inline const Pvec3 &V1() const { return v1; }
2062 
2066  inline const Pvec3 &V2() const { return v2; }
2067 
2071  inline const Pvec3 &V3() const { return v3; }
2072 
2073  protected:
2077  };
2078 
2082  typedef std::vector<Ptriangle3D> PStdVectTriangles3D;
2083 
2097  class DLL_API PCube3D : public PBase
2098  {
2099  public:
2103  PCube3D();
2104 
2108  PCube3D(const Pvec3 &p_min, const Pvec3 p_max);
2109 
2113  PCube3D(const PCube3D &c);
2114 
2118  void ReinitEnglobage();
2119 
2123  bool ValideEnglobage() const;
2124 
2128  void EnglobeSommet(const Pvec3 &p);
2129 
2133  inline void EnglobeSommet(const Ppoint3D_min &p)
2134  {
2135  EnglobeSommet(p.Vec3());
2136  }
2137 
2141  bool ContientSommet(const Pvec3 &p) const;
2142 
2146  inline bool ContientSommet(const Ppoint3D_min &p) const
2147  {
2148  return ContientSommet(p.Vec3());
2149  }
2150 
2154  bool ContientSommet(pfloat x, pfloat y, pfloat z) const;
2155 
2159  bool Collision(const PCube3D &c) const;
2160 
2164  bool Collision2(const PCube3D &c) const;
2165 
2169  void Decalage(const Pvec3 &d);
2170 
2174  void Echelle(pfloat e);
2175 
2180  inline Pvec3 P1() const { return v_min; }
2181  inline Pvec3 P2() const { return Pvec3(v_max.X(), v_min.Y(), v_min.Z()); }
2182  inline Pvec3 P3() const { return Pvec3(v_max.X(), v_max.Y(), v_min.Z()); }
2183  inline Pvec3 P4() const { return Pvec3(v_min.X(), v_max.Y(), v_min.Z()); }
2184 
2185  inline Pvec3 P5() const { return Pvec3(v_min.X(), v_min.Y(), v_max.Z()); }
2186  inline Pvec3 P6() const { return Pvec3(v_max.X(), v_min.Y(), v_max.Z()); }
2187  inline Pvec3 P7() const { return v_max; }
2188  inline Pvec3 P8() const { return Pvec3(v_min.X(), v_max.Y(), v_max.Z()); }
2189 
2190  inline Pvec3 Centre() const { return (v_min+v_max)*.5; }
2191 
2192  inline const Pvec3 &PMin() const { return v_min; }
2193  inline const Pvec3 &PMax() const { return v_max; }
2194 
2195  pfloat CoordMin() const;
2196  pfloat CoordMax() const;
2197  pfloat LDiagonale() const;
2198 
2199  void Dilate(pfloat x, pfloat y, pfloat z);
2200  void Dilate(pfloat xyz);
2201 
2202  protected:
2203  Pvec3 v_min, v_max;
2204  };
2205 
2209  class DLL_API PTexte3D : public PEnt3D
2210  {
2211  friend class PTexte3DPriv;
2212 
2213  public:
2214  PTexte3D();
2215 
2216  explicit PTexte3D(const PTexte3D &txt);
2217 
2218  PTexte3D(const wchar_t *s, puint nb_chars, pfloat pos_x, pfloat pos_y, pfloat pos_z, const PCouleur &couleur, const pfloat taille, bool centrer=false);
2219 
2221  {
2222  return vertices;
2223  }
2224 
2228  bool CollisionTextes(const PTexte3D &txt) const;
2229 
2230  const Pvec3 &Origine() const { return origine; }
2231 
2232  protected:
2233 // Pvec3 v_min, v_max;
2237  };
2238 
2242  typedef std::vector<PTexte3D> PStdVectTexte3D;
2243 
2248  {
2249  friend class PSurface3DPriv;
2250 
2251  public:
2252  inline PSurface3D() : contour(nullptr), triangles(nullptr), centre(), rayon(0) { ; }
2253 // ~PSurface3D();
2254 
2255  void Alloc();
2256  void Dealloc();
2257  bool ValideAllocaction() const;
2258 
2259  void Copie(const PSurface3D &source);
2260  PSurface3D& operator=(const PSurface3D &s);
2261 
2262  void defId(pident id_);
2263 
2264  inline const PStdVectSegments3D &ContourConst() const { return *contour; }
2265  inline const PStdVectTriangles3D &TrianglesConst() const { return *triangles; }
2266 
2267  puint NTriangles() const;
2268  puint NSommets() const;
2269 
2270  void defTrianglesActif(bool etat);
2271 
2272  inline const Pvec3 &Centre() const { return centre; }
2273  inline pfloat Rayon() const { return rayon; }
2274 
2275  private:
2276  PStdVectSegments3D *contour; /* Lignes correspondantes au contour de la surface. */
2277  PStdVectTriangles3D *triangles; /* Triangles de la surface (après triangulation). */
2278  Pvec3 centre; /* Centre de la surface. */
2279  pfloat rayon; /* Rayon de la surface (delta maximum depuis le centre) pour le traitement des collisions. */
2280  };
2281 
2285  typedef std::vector<PSurface3D> PStdVectSurfaces3D;
2286 
2290  typedef std::vector<pident> PStdSolide3D;
2291 
2295  class DLL_API PSolide3D : public PEnt3D
2296  {
2297  friend class PSolide3DPriv;
2298 
2299  public:
2300  PSolide3D();
2301 
2302  inline const PStdSolide3D &Surfaces() const { return solide; }
2303 
2304  inline pint NombreSurfaces() const { return solide.size(); }
2305 
2306  inline pident IdSurface(puint i) const
2307  {
2308  if (i < solide.size()) { return solide[i]; }
2309  return IDNUL;
2310  }
2311 
2312  private:
2313  PStdSolide3D solide;
2314  };
2315 
2319  typedef std::vector<PSolide3D> PStdVectSolide3D;
2320 
2324  class DLL_API Pmaillage3D : public PBase
2325  {
2326  friend class Pmaillage3DPriv;
2327  friend class PScene3D;
2328 
2329  public:
2330  Pmaillage3D();
2331 
2332  ~Pmaillage3D();
2333 
2338  Pmaillage3D(const Pmaillage3D &mesh);
2339 
2343  void Vide();
2344 
2349  bool ImporteMaillage(const Pmaillage3D &mesh, const PMat4x4_data &mat_data=PMat4x4_data());
2350 
2354  bool ImportSTL(const char *chemin, puint id_couleur_ral=9010, bool fusion_triangles=false, bool *interrupteur=nullptr, pulong *avancement=nullptr, pfloat *echelle_tmp=nullptr);
2355 
2359  bool ConversionScene2D(PScene2D &scene2d, const PMat4x4_data matrice=PMat4x4_data(), const PCouleur &couleur=PCouleur(180, 180, 180, true)) const;
2360 
2364  bool Transform(const PMat4x4_data &mat_data);
2365 
2369  bool AssigneDimensions(pfloat &x, pfloat &y, pfloat &z) const;
2370 
2374  inline const PStdVectSegments3D &Filaire() const { return *filaire; }
2375 
2379  inline const PStdVectSommets3D &Sommets() const { return *sommets; }
2380 
2384  inline const PStdVectSurfaces3D &Surfaces() const { return *surfaces; }
2385 
2391  bool GenereArbresRecherche();
2392 
2397  pident SommetProche(const Pvec3 &p, pfloat *distance2=nullptr) const;
2398 
2403  pident SegmentProche(const Pvec3 &p, pfloat *distance2=nullptr) const;
2404 
2409  pident SurfaceProche(const Pvec3 &p, pfloat *distance2=nullptr) const;
2410 
2411  private:
2412  PStdVectSegments3D *filaire; /* Modèle filaire */
2413  PStdVectSommets3D *sommets; /* Sommets (points) des vertices) */
2414  PStdVectSurfaces3D *surfaces; /* Vecteur de surfaces, chacun des élément contient un nombre indéterminé de points représentant une surface. */
2415  void *arbre_sommets;
2416  void *arbre_filaire;
2417  void *arbre_surfaces;
2418  };
2419 
2423  class DLL_API PScene3D : public PBase
2424  {
2425  friend class PScene3DPriv;
2426 
2427  public:
2428  PScene3D();
2429 
2434  PScene3D(const PScene3D &scene);
2435 
2436  ~PScene3D();
2437 
2441  void Vide();
2442 
2447  bool ImporteScene3D(const PScene3D &scene, const PMat4x4_data &mat_data=PMat4x4_data());
2448 
2452  bool ImportSTL(const char *chemin, puint id_couleur_ral, bool fusion_triangles=false, bool *interrupteur=nullptr, pulong *avancement=nullptr);
2453 
2457  bool Transform(const PMat4x4_data &mat_data);
2458 
2462  PImage GenerationVignette(puint taille_vignette=128, vues2D_t vue=vues2D_t::VUEMULT) const;
2463 
2467  void Verrouille() const;
2468 
2472  void DeVerrouille() const;
2473 
2477  bool GenereArbresRecherche();
2478 
2483  bool Export(const char *nom_fichier) const;
2484 
2491  bool ExportDXF(const char *nom_fichier, params_export_dxf_t parametres_export=params_export_dxf_t::EXPORT_DXF_SOLIDE_MESH|params_export_dxf_t::EXPORT_DXF_SOLIDE_MESH_GROUPE) const;
2492 
2499  bool ExportSTL(const char *nom_fichier, bool separe_solides=false) const;
2500 
2507  bool ExportAMF(const char *nom_fichier, bool compression=true) const;
2508 
2514  bool Export3DS(const char *nom_fichier) const;
2515 
2522  bool ExportCollada(const char *nom_fichier, bool export_couleur_solides=false) const;
2523 
2529  bool ExportPLY(const char *nom_fichier) const;
2530 
2537  bool ExportOBJ(const char *nom_fichier, bool groupe_solides=false) const;
2538 
2544  bool ExportX3D(const char *nom_fichier) const;
2545 
2549  inline const Pmaillage3D &Maillage() const { return *mesh; }
2550 
2554  inline const PStdVectSegments3D &Projections() const { return *projections; }
2555 
2559  inline PStdVectTriangles3D &Developpe() const { return *developpe; }
2560 
2564  inline const PStdVectTriangles3D &Divers() const { return *divers; }
2565 
2569  inline const PStdVectSolide3D &Solides() const { return *solides; }
2570 
2574  inline const PStdVectTexte3D &Textes3D() const { return *textes; }
2575 
2579  PSommet3D &Sommet(puint id) const;
2580 
2584  PSegment3D &Segment(puint id) const;
2585 
2589  PSurface3D &Surface(puint id) const;
2590 
2594  PSolide3D &Solide(puint id) const;
2595 
2599  PTexte3D &Texte(puint id) const;
2600 
2604  inline puint CouleurRAL() const { return id_ral; }
2605 
2609  inline const Pvec3 &Centre() const { return centre; }
2610 
2614  inline pulong TempsGeneration() const { return temps_generation; }
2615 
2619  inline pfloat DimX() const { return dimx; }
2620 
2624  inline pfloat DimY() const { return dimy; }
2625 
2629  inline pfloat DimZ() const { return dimz; }
2630 
2634  inline pfloat Echelle() const { return echelle; }
2635 
2636 
2637  inline pfloat EchelleDeveloppe() const { return echelle_developpe; }
2638 
2642  inline puint NbSurfaces() const { return mesh->Surfaces().size(); }
2643 
2644  private:
2645  Pmaillage3D *mesh;
2646  PStdVectSegments3D *projections; /* Modèle filaire des entités à l'origine 2D projetés autour du modèle. */
2647  PStdVectTriangles3D *developpe; /* Modèle développé (strictement 2D en principe) */
2648  PStdVectTriangles3D *divers; /* Modèle divers, affiche toutes informations autre que celles ci-dessus. */
2649  PStdVectSolide3D *solides; /* Ensemble des solides. */
2650  PStdVectTexte3D *textes; /* Vecteurs des textes 3D. */
2651  Pvec3 centre; /* Décalages à appliquer pour placer l'objet 3D au centre de la scène. */
2652  pulong temps_generation; /* Temps écoulé pour la génération du mesh. */
2653  pfloat echelle; /* Echelle à appliquer pour voir le modèle entier avec une taille maximum de 1. */
2654  pfloat echelle_developpe; /* Echelle d'affichage spécifique pour le développé. */
2655  puint id_ral;
2656  pfloat dimx;
2657  pfloat dimy;
2658  pfloat dimz;
2659  };
2660 
2661  /* </3D> */
2662 
2663 } // namespace Perspective3D
2664 
2665 #endif // PERSPECTIVE_TYPES_H
Pvec3 & operator/=(const pfloat s)
Definition: perspective_types.h:1301
const Ppoint2D & P3() const
Definition: perspective_types.h:861
void defIdConnexionCourbe(pident id)
Definition: perspective_types.h:1827
pfloat ToleranceAngles
Definition: perspective_types.h:548
pint NombreSurfaces() const
Definition: perspective_types.h:2304
std::vector< Pellipse2D > PStdVectEllipses2D
PStdVectEllipses2D Vecteur d&#39;ellipses 2D.
Definition: perspective_types.h:999
std::vector< PSommet3D > PStdVectSommets3D
PStdVectSommets3D Vecteur de sommets.
Definition: perspective_types.h:2040
pint Arrondi_dessin
Definition: perspective_types.h:520
pfloat Angle1() const
Definition: perspective_types.h:968
void EnglobeSommet(const Ppoint3D_min &p)
EnglobeSommet Adapte le delta du cube pour inclure le sommet donné en argument.
Definition: perspective_types.h:2133
Point 3D (base).
Definition: perspective_types.h:1509
bool Nul() const
Definition: perspective_types.h:1493
bool courbe
Definition: perspective_types.h:2002
pfloat DimZ() const
DimZ Renvoi la taille de la scène en Z.
Definition: perspective_types.h:2629
pfloat ToleranceCoords1
Definition: perspective_types.h:546
pfloat at(pint i) const
Definition: perspective_types.h:1623
const Ppoint2D & Pmax() const
Definition: perspective_types.h:852
void defP1(const Ppoint3D &p)
Definition: perspective_types.h:1878
pint32 pident
Identifiants des entitées.
Definition: perspective_types.h:151
Pvec3(const Pvec3 &p1, const Pvec3 &p2)
Definition: perspective_types.h:1289
pfloat Z() const
Renvoi la coordonée Z.
Definition: perspective_types.h:1592
pfloat Longueur() const
Definition: perspective_types.h:819
Pvec3 & Vec3NonConst()
Definition: perspective_types.h:1543
PMat4x4_data(const pfloat *m)
Constructeur (copie depuis un tampon de nombres flottants).
Definition: perspective_types.h:1659
pfloat magnitude() const
magnitude Distance à l&#39;origine.
Definition: perspective_types.h:1365
void RetireAttribut(puint16 attr)
Definition: perspective_types.h:734
const Pvec3 & Origine() const
Definition: perspective_types.h:2230
void defCoords(const Ppoint3D_min &p)
Assigne les coordonnées.
Definition: perspective_types.h:1607
Ppoint3D_min(const Pvec3 &v)
Definition: perspective_types.h:1514
void normalise()
Normalise le vecteur.
pfloat Echelle() const
Echelle Renvoi l&#39;echelle à appliquer sur le solide pour le rendre normé à 1.
Definition: perspective_types.h:2634
Ppoint2D & operator*=(const pfloat s)
Definition: perspective_types.h:267
std::vector< int > PStdVectInts
PStdVectInts Vecteur d&#39;entiers.
Definition: perspective_types.h:146
pident Id() const
Definition: perspective_types.h:703
bool operator!=(const Ppoint3D_min &v) const
operator != Comparaison entre deux points avec l&#39;Epsilon fixe.
Definition: perspective_types.h:1551
Pvec3 & operator*=(const Pvec3 &v)
Definition: perspective_types.h:1302
Ppoint3D_min(const Ppoint3D_min &p)
Definition: perspective_types.h:1521
const pint8 * Licence
Definition: perspective_types.h:558
const PStdVectSurfaces3D & Surfaces() const
SurfacesConst Renvoi les surfaces du modèle.
Definition: perspective_types.h:2384
bool MultiThreading
Definition: perspective_types.h:527
void defV(Poctet_t vert)
Definition: perspective_types.h:387
Pvec3 operator/(const pfloat s) const
Definition: perspective_types.h:1310
PEnt2D(pident i)
Definition: perspective_types.h:753
void defP1(const Ppoint2D &p)
Definition: perspective_types.h:803
bool actif
Definition: perspective_types.h:491
PEnt23D(pident id_, proprietes_3d_t props)
Definition: perspective_types.h:1238
pfloat DeltaCourbesMax
Definition: perspective_types.h:553
const Pvec3 & V1Const() const
Definition: perspective_types.h:1873
void defNormL(const Pvec3 &n)
Definition: perspective_types.h:1896
void def(const pfloat *m)
Assignation du tampon de la matrice.
Definition: perspective_types.h:1696
PPointPixel()
Definition: perspective_types.h:419
pfloat Angle2() const
Definition: perspective_types.h:971
PPixel()
Definition: perspective_types.h:369
Pvec3 P1() const
Recupère les sommets du cube selon leur id:
Definition: perspective_types.h:2180
Pligne2D()
Definition: perspective_types.h:783
Représente un pixel.
Definition: perspective_types.h:366
Espace de nom de l&#39;API 3D.
Definition: perspective_api.h:101
pfloat X() const
Renvoi la coordonée X.
Definition: perspective_types.h:1572
pfloat ToleranceNorms
Definition: perspective_types.h:554
bool operator==(const PCouleur &c) const
Definition: perspective_types.h:478
std::vector< Pligne2D > PStdVectLignes2D
PStdVectLignes2D Vecteur de lignes 2D.
Definition: perspective_types.h:834
const pfloat * data() const
Renvoi le pointeur vers le tampon de la matrice.
Definition: perspective_types.h:1748
PCouleur Inverse() const
Definition: perspective_types.h:482
bool CoordNul() const
Definition: perspective_types.h:1492
pfloat lg
Definition: perspective_types.h:988
void defFerme(bool f)
Definition: perspective_types.h:963
std::vector< PTexte3D > PStdVectTexte3D
PStdVectTexte3D Vecteur de textes 3D.
Definition: perspective_types.h:2242
void defCoords(pfloat x_=COORD0, pfloat y_=COORD0, pfloat z_=COORD0)
Assigne les coordonnées.
Definition: perspective_types.h:1460
Pvec3 P7() const
Definition: perspective_types.h:2187
Ppoint3D_min()
Definition: perspective_types.h:1512
pfloat Longueur() const
Definition: perspective_types.h:1899
Pvec3 & operator*=(const pfloat s)
Definition: perspective_types.h:1300
Ppoint2D operator/(const Ppoint2D &v) const
Definition: perspective_types.h:279
std::vector< PGroupeEnts2D * > PStdVectGroupeEnts2D
PStdVectGroupeEnts2D Vecteur de groupe d&#39;entités 2D.
Definition: perspective_types.h:1116
pfloat X() const
Definition: perspective_types.h:260
pident IdConnexionCourbe() const
Definition: perspective_types.h:1826
Pellipse2D(const Pellipse2D &e)
Definition: perspective_types.h:944
int8_t pint8
Definition: perspective_sys.h:628
bool ContourSegments
Definition: perspective_types.h:543
axesOrthos3D_t
Definition: perspective_types.h:107
void defRotation(pfloat r)
Definition: perspective_types.h:966
Pvec3 & operator/=(const Pvec3 &v)
Definition: perspective_types.h:1303
proprietes_2d_t proprietes
Definition: perspective_types.h:773
const PStdVectSegments3D & Projections() const
Projections Renvoi le modèle des projections.
Definition: perspective_types.h:2554
static size_t numDim()
Definition: perspective_types.h:1628
PCouleur(const PPixel &p)
Definition: perspective_types.h:470
Pvec3 P5() const
Definition: perspective_types.h:2185
const PStdVectSegments3D & ContourConst() const
Definition: perspective_types.h:2264
Scène 2D.
Definition: perspective_types.h:1121
void defRVBA(Poctet_t rouge, Poctet_t vert, Poctet_t bleu, Poctet_t opacite)
Definition: perspective_types.h:390
void defP2(const Ppoint3D &p)
Definition: perspective_types.h:1879
pint Divisionscercles
Definition: perspective_types.h:521
Pvec3 P2() const
Definition: perspective_types.h:2181
void RetireAttributId(puint16 id)
Definition: perspective_types.h:738
pfloat taille
Definition: perspective_types.h:1035
pfloat DeltaCourbesMin
Definition: perspective_types.h:552
void defNulle()
Definition: perspective_types.h:376
#define POSITIFD
Definition: perspective_def.h:82
resultat_vision2d_t
Definition: perspective_types.h:563
const PStdVectPoints2D & ListePoints() const
Liste dee points.
Definition: perspective_types.h:1101
void defR(Poctet_t rouge)
Definition: perspective_types.h:386
Scène3D, contient l&#39;ensemble des éléments générés.
Definition: perspective_types.h:2423
bool ValideAttribut(puint16 attr) const
Definition: perspective_types.h:735
Ppoint2D operator-(const pfloat s) const
Definition: perspective_types.h:275
void defNorm(const Pvec3 &n)
Definition: perspective_types.h:1964
const PStdVectEllipses2D & ListeEllipses() const
Liste des ellipses (ou toutes entitées courbe).
Definition: perspective_types.h:1083
Pvec3 P4() const
Definition: perspective_types.h:2183
vues2D_t vue
Definition: perspective_types.h:772
bool operator==(const PPixel &c) const
Definition: perspective_types.h:378
puint Id_ral
Definition: perspective_types.h:531
Pvec3()
Definition: perspective_types.h:1286
Ppoint2D & operator-=(const Ppoint2D &v)
Definition: perspective_types.h:272
puint8 Poctet_t
Definition: perspective_types.h:247
Ppoint2D norme(const Ppoint2D &v2) const
Renvoi le vecteur normal du point courant vers le point v2.
Definition: perspective_types.h:291
pfloat DimX() const
DimX Renvoi la taille de la scène en X.
Definition: perspective_types.h:2619
Pvec3 operator+(const Pvec3 &v) const
Definition: perspective_types.h:1313
void defY(pfloat y_)
Definition: perspective_types.h:258
Type de base pour toutes les entités graphiques Perspective3D.
Definition: perspective_types.h:722
void defP1(pfloat x, pfloat y)
Definition: perspective_types.h:804
Pvec3 norm
Definition: perspective_types.h:1968
pfloat Y() const
Definition: perspective_types.h:261
#define DLL_API
Attribut de classe ou méthode exportée par l&#39;API (GCC, Clang ou MSVC). Donc importé côté client...
Definition: perspective_sys.h:524
Ppoint3D(const Pvec3 &p)
Definition: perspective_types.h:1792
void defAttributs(puint16 att)
Definition: perspective_types.h:731
void defY(pfloat y_)
Assigne la coordonée Y.
Definition: perspective_types.h:1445
pfloat DeltaAnglesCourbesMax
Definition: perspective_types.h:556
Définition d&#39;un texte 2D.
Definition: perspective_types.h:1004
bool Actif() const
Definition: perspective_types.h:480
Type de base pour les entitées 2D->3D.
Definition: perspective_types.h:1235
const PStdVectTexte3D & Textes3D() const
Textes3D Renvoi la liste des textes 3D.
Definition: perspective_types.h:2574
PCouleur()
Definition: perspective_types.h:469
Pvec3 operator/(const Pvec3 &v) const
Definition: perspective_types.h:1312
void defActif(bool a=true)
Definition: perspective_types.h:481
pint x
Definition: perspective_types.h:442
pfloat angle2
Definition: perspective_types.h:991
Type de base pour les entitées strictement 3D (version étendue avec vecteur normal).
Definition: perspective_types.h:1955
Définition ellipse, arc ou cercle 2D.
Definition: perspective_types.h:939
void defPosition(const Ppoint2D &p)
Definition: perspective_types.h:1014
Définition d&#39;un sommet (destiné à l&#39;affichage 3D).
Definition: perspective_types.h:2013
Définition d&#39;un texte 3D divisé en vertices.
Definition: perspective_types.h:2209
void defTailleTexte(pfloat t)
Definition: perspective_types.h:1019
Ppoint2D operator*(const Ppoint2D &v) const
Definition: perspective_types.h:278
Lignes 3D.
Definition: perspective_types.h:1845
bool ConnexionTrou() const
Definition: perspective_types.h:1889
void defPoint(bool p)
Definition: perspective_types.h:812
params_gen3d_t Parametres3d
Definition: perspective_types.h:528
3 coordonnées (base pour les points et vecteurs 3D).
Definition: perspective_types.h:1283
void defAngle1(pfloat a)
Definition: perspective_types.h:969
Définition d&#39;une ligne 2D.
Definition: perspective_types.h:780
PPointPixel(pint x_, pint y_)
Definition: perspective_types.h:418
PEnt3DExt(const PCouleur &c, pident i, const Pvec3 &n, bool a)
Definition: perspective_types.h:1959
bool IdNul() const
Definition: perspective_types.h:713
bool actif
Definition: perspective_types.h:1949
Pvec3 origine
Definition: perspective_types.h:2234
bool operator<(const Ppoint3D_min &v) const
operator < Comparaison entre deux points avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:1564
void defCourbe(bool e)
Definition: perspective_types.h:1883
const PStdVectSolide3D & Solides() const
Solides Renvoi la liste des solides.
Definition: perspective_types.h:2569
bool CadreEnglobe
Definition: perspective_types.h:927
Ppoint2D Centre() const
Definition: perspective_types.h:869
std::vector< Pvec3 > PStdVectPoint3D_min
PStdVectPoint3D_min Vecteur de points 3D (version légère).
Definition: perspective_types.h:1784
bool operator==(const Pvec3 &v) const
operator == Comparaison entre deux points avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:1324
pfloat Distance(const Ppoint3D_min &p) const
Distance Distance par rapport à un autre point.
Definition: perspective_types.h:1617
PCube3D cube_texte
Definition: perspective_types.h:2235
PSegment3D()
Definition: perspective_types.h:1979
bool jointure_trou
Definition: perspective_types.h:1925
static puint size()
Renvoi le nombre d&#39;éléments dans la matrice.
Definition: perspective_types.h:1772
Ppoint2D pmin
Definition: perspective_types.h:928
pfloat at(puint i) const
Definition: perspective_types.h:346
Définition d&#39;un triangle à base de vertices (destiné à l&#39;affichage 3D).
Definition: perspective_types.h:2045
#define PENUM_DECL_OPS(NOM)
Definition: perspective_def.h:331
pfloat Distance(const Pvec3 &p) const
Distance Distance par rapport à un autre point.
Definition: perspective_types.h:1375
void defAlpha(Poctet_t a)
Definition: perspective_types.h:391
pfloat Lg() const
Definition: perspective_types.h:974
Pvec3 & operator-=(const pfloat s)
Definition: perspective_types.h:1299
Ppoint3D_min(const Ppoint3D_min &p1, const Ppoint3D_min &p2)
Definition: perspective_types.h:1519
pfloat ht
Definition: perspective_types.h:989
puint SeuilActivation
Definition: perspective_types.h:542
void defCoords(pfloat x_=COORD0, pfloat y_=COORD0, pfloat z_=COORD0)
Assigne les coordonnées.
Definition: perspective_types.h:1602
Pvec3 v1
Definition: perspective_types.h:2034
PCouleur & Couleur()
Definition: perspective_types.h:1243
#define CompareED(a, b)
Definition: perspective_def.h:324
puint Hauteur() const
Renvoi la hauteur de l&#39;image.
Definition: perspective_types.h:639
const Pvec3 & PMin() const
Definition: perspective_types.h:2192
pushort bpp
Definition: perspective_types.h:684
const Ppoint2D & CentreConst() const
Definition: perspective_types.h:981
void defZ(pfloat z_)
Assigne la coordonée Z.
Definition: perspective_types.h:1597
Poctet_t Alpha() const
Definition: perspective_types.h:384
void defPositionY(pfloat y)
Definition: perspective_types.h:1016
Ppoint2D operator-(const Ppoint2D &v) const
Definition: perspective_types.h:281
uint16_t puint16
Definition: perspective_sys.h:631
Ppoint2D & operator+=(const pfloat s)
Definition: perspective_types.h:265
const char * nom
Definition: perspective_types.h:460
pfloat ToleranceCourbure
Definition: perspective_types.h:550
static size_t numDim()
Definition: perspective_types.h:1500
pulong TempsGeneration() const
TempsGeneration Renvoi le tremps de génération (en millisecondes).
Definition: perspective_types.h:2614
Ppoint2D P2() const
Definition: perspective_types.h:860
pint y
Definition: perspective_types.h:442
pident IdSurface(puint i) const
Definition: perspective_types.h:2306
void defConnexionTrou(bool c)
Definition: perspective_types.h:1890
Ppoint2D operator+(const Ppoint2D &v) const
Definition: perspective_types.h:280
const PStdVectTextes2D & ListeTextes() const
Liste des textes.
Definition: perspective_types.h:1092
bool ValideEnglobage() const
Definition: perspective_types.h:922
pfloat rotation
Definition: perspective_types.h:1036
pfloat X() const
Renvoi la coordonée X.
Definition: perspective_types.h:1430
pfloat rotation
Definition: perspective_types.h:992
puint64 SalageLicence
Definition: perspective_types.h:533
bool Nulle() const
Definition: perspective_types.h:1901
signed int pint
Types entiers.
Definition: perspective_sys.h:611
pint Y() const
Definition: perspective_types.h:422
Pvec3 Centre() const
Definition: perspective_types.h:2190
void defActif(bool a)
Definition: perspective_types.h:1946
puint longueur_txt
Definition: perspective_types.h:1033
Ppoint2D operator*(const pfloat s) const
Definition: perspective_types.h:276
ParametresPerspective Paramètres de la bibliothèque Perspective.
Definition: perspective_types.h:511
Ppoint3D_min & operator=(const Ppoint3D_min &p)
Definition: perspective_types.h:1523
PStdVectGroupeEnts2D * contenu_scene
Definition: perspective_types.h:1221
const pint8 * Licence
Definition: perspective_types.h:532
void defId(pident i)
Assignation de l&#39;id d&#39;une entité.
Definition: perspective_types.h:708
Représente les coordonnés un pixel.
Definition: perspective_types.h:415
Pvec3(pfloat x_, pfloat y_, pfloat z_)
Definition: perspective_types.h:1287
void ReinitAttributs()
Definition: perspective_types.h:730
Pellipse2D()
Definition: perspective_types.h:942
void defHt(pfloat h)
Definition: perspective_types.h:978
normevues_t
Definition: perspective_types.h:154
puint32 RVBi() const
Definition: perspective_types.h:393
bool ferme
Definition: perspective_types.h:993
bool operator!=(const PPointPixel &p) const
Definition: perspective_types.h:433
pushort TaillePixels() const
Renvoi la taille de chaque pixel en octets (typiquement 3 pour RVB ou 4 pour RVBA).
Definition: perspective_types.h:634
vues2D_t
Definition: perspective_types.h:89
const Pvec3 & Norm() const
Definition: perspective_types.h:1961
PStdVectSegments3D vertices
Definition: perspective_types.h:2236
pfloat TailleTexte() const
Definition: perspective_types.h:1018
const Pvec3 & V3() const
V3 Accès au premier sommet du triangle.
Definition: perspective_types.h:2071
pfloat y
Definition: perspective_types.h:1503
pfloat lg2() const
lg2 Longueur du vecteur au carré à l&#39;origine.
Definition: perspective_types.h:1380
bool Nul() const
Definition: perspective_types.h:1621
Pvec3 v3
Definition: perspective_types.h:2076
proprietes_2d_t Proprietes() const
Definition: perspective_types.h:769
const Pvec3 & V1() const
V1 Accès au premier sommet du segment.
Definition: perspective_types.h:1992
const Pvec3 & V2() const
V2 Accès au premier sommet du triangle.
Definition: perspective_types.h:2066
void defX(pfloat x_)
Assigne la coordonée X.
Definition: perspective_types.h:1435
const Ppoint2D & Position() const
Definition: perspective_types.h:1013
unsigned long long pulong
Definition: perspective_sys.h:616
PStdVectTriangles3D & Developpe() const
Developpe Renvoi le modèle des développés (cas particulier, en principe pour afficher uniquement de l...
Definition: perspective_types.h:2559
pfloat Rotation() const
Definition: perspective_types.h:965
Pvec3 P3() const
Definition: perspective_types.h:2182
const PStdSolide3D & Surfaces() const
Definition: perspective_types.h:2302
Pvec3 v2
Definition: perspective_types.h:2001
Pligne3D()
Definition: perspective_types.h:1848
PPixel CouleurTrace
Definition: perspective_types.h:544
pfloat ToleranceJointures
Definition: perspective_types.h:549
std::vector< PSurface3D > PStdVectSurfaces3D
PStdVectSurfaces3D Vecteur de surfaces.
Definition: perspective_types.h:2285
bool operator<(const Pvec3 &v) const
operator < Comparaison entre deux points avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:1332
bool Filaire_uniquement
Definition: perspective_types.h:526
void defId(pident id_)
Definition: perspective_types.h:1820
void defIRVB(puint32 i)
Definition: perspective_types.h:394
void defAxeX(const Pvec3 &axe)
Definition: perspective_types.h:1716
pfloat & refY()
Definition: perspective_types.h:263
#define IDNUL
Definition: perspective_def.h:237
pident id
Definition: perspective_types.h:716
void defCourbe(bool etat)
Definition: perspective_types.h:1254
PCouleur(const PCouleur_RAL &ral, bool actif_=true)
Definition: perspective_types.h:472
PGroupeEnts2D Défini un groupe d&#39;entités 2D.
Definition: perspective_types.h:1047
void defId(pident id_)
Definition: perspective_types.h:1532
const Pvec3 & Centre() const
Definition: perspective_types.h:2272
Pligne2D(const Pligne2D &l)
Definition: perspective_types.h:791
puint NbSurfaces() const
NbSurfaces Renvoi le nombre de surfaces dans la scène.
Definition: perspective_types.h:2642
void defPmax(const Ppoint2D &p)
Definition: perspective_types.h:849
uint64_t puint64
Definition: perspective_sys.h:635
PEnt2D()
Definition: perspective_types.h:752
bool JointureTrou() const
Definition: perspective_types.h:1892
void defXY(pfloat x_, pfloat y_)
Definition: perspective_types.h:259
PEnt3DExt()
Definition: perspective_types.h:1958
pfloat TailleGrille
Definition: perspective_types.h:557
void defCouleur(const PCouleur &c)
Definition: perspective_types.h:766
const pfloat & at(puint i) const
Accès à un élément de la matrice (const).
Definition: perspective_types.h:1756
Poctet_t alpha
Definition: perspective_types.h:404
bool Courbe() const
Definition: perspective_types.h:1984
bool Cache() const
Definition: perspective_types.h:761
void defAxeZ(const Pvec3 &axe)
Definition: perspective_types.h:1726
void defXY(pint x_, pint y_)
Definition: perspective_types.h:426
void AjoutAttributId(puint16 id)
Definition: perspective_types.h:737
Pvec3 & operator-=(const Pvec3 &v)
Definition: perspective_types.h:1305
Couleur du nuancier RAL classique.
Definition: perspective_types.h:453
Pvec3 P6() const
Definition: perspective_types.h:2186
Poctet_t V() const
Definition: perspective_types.h:381
Définition d&#39;un maillage 3D.
Definition: perspective_types.h:2324
Ppoint2D & operator/=(const Ppoint2D &v)
Definition: perspective_types.h:270
Ptriangle3D()
Definition: perspective_types.h:2050
std::vector< Ppoint3D > PStdVectPoint3D
PStdVectPoint3D Vecteur pour les points 3D (version lourde).
Definition: perspective_types.h:1840
pfloat lg() const
lg Longueur du vecteur à l&#39;origine.
Definition: perspective_types.h:1385
bool dealloc
Definition: perspective_types.h:689
pfloat Distance2(const Ppoint2D &p) const
Distance2 Distance au carré entre deux points.
Definition: perspective_types.h:328
Pvec3 v1
Definition: perspective_types.h:2000
const PStdVectSegments3D & Filaire() const
FilaireConst Renvoi les vertices du modèle filaire.
Definition: perspective_types.h:2374
Ppoint2D position
Definition: perspective_types.h:1034
Définition d&#39;un point 3D (version lourde, avec quelques propriétés additionnelles).
Definition: perspective_types.h:1789
Couleurs 32 bits.
Definition: perspective_types.h:466
void defRotation(pfloat r)
Definition: perspective_types.h:1022
bool Trou() const
Definition: perspective_types.h:1262
int32_t pint32
Definition: perspective_sys.h:632
void defX(pint x_)
Definition: perspective_types.h:424
proprietes_2d_t
Definition: perspective_types.h:239
void defX(pfloat x_)
Assigne la coordonée X.
Definition: perspective_types.h:1577
puint16 & AttributsRef()
Definition: perspective_types.h:729
void defP2(pfloat x, pfloat y)
Definition: perspective_types.h:809
ParametresPerspective(pfloat tolerance=0.001, pint arrondi_dessin=3, pint divisionscercles=24, vues2D_t projections=vues2D_t::VUEFACE|vues2D_t::VUECOTE|vues2D_t::VUEHAUT, infos3d_t informations=infos3d_t::INUL, pint tailletexte3d=8, bool filaire_uniquement=false, bool multithreading=false, params_gen3d_t parametres3d=params_gen3d_t::PGEN3DNUL, puint taille_surfaces=256, normevues_t norme_vues=normevues_t::NORME_VUES_ISO, puint id_ral=9010, const pint8 *licence=nullptr, puint64 salage_licence=0)
Definition: perspective_types.h:513
proprietes_3d_t Proprietes() const
Definition: perspective_types.h:1247
std::vector< PPointPixel > PStdVectPointsPixels
PStdVectPoints2D Vecteur de points de pixels.
Definition: perspective_types.h:448
Définition d&#39;un point 2D et de ses opérations.
Definition: perspective_types.h:252
Poctet_t R() const
Definition: perspective_types.h:380
pfloat Z() const
Renvoi la coordonée Z.
Definition: perspective_types.h:1450
const Pvec3 & Centre() const
Centre Renvoi le centre de la scène.
Definition: perspective_types.h:2609
Pligne3D & operator=(const Pligne3D &l)
Definition: perspective_types.h:1862
Poctet_t const * tampon_oct
Definition: perspective_types.h:687
const PStdVectTriangles3D & Divers() const
Divers Renvoi le modèle divers.
Definition: perspective_types.h:2564
bool operator==(const Pligne3D &l) const
operator == Comparaison entre deux lignes avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:1906
PEntite(pident id_, puint16 attr)
Definition: perspective_types.h:726
double pfloat
Definition: perspective_def.h:62
Ppoint2D Point2D() const
Definition: perspective_types.h:436
#define nullptr
Definition: perspective_sys.h:375
void defJointureTrou(bool c)
Definition: perspective_types.h:1893
Ppoint3D & P1()
Definition: perspective_types.h:1876
pfloat Y() const
Renvoi la coordonée Y.
Definition: perspective_types.h:1582
const Ppoint2D & P1() const
Definition: perspective_types.h:859
bool Point() const
Definition: perspective_types.h:811
params_export_dxf_t
Definition: perspective_types.h:127
Pvec3 operator-(const Pvec3 &v) const
Definition: perspective_types.h:1314
Pvec3 & NormNonConst()
Definition: perspective_types.h:1962
const Pvec3 & V2() const
V2 Accès au premier sommet du segment.
Definition: perspective_types.h:1997
Pligne2D(const Ppoint2D &p1_, const Ppoint2D &p2_, pident id_=IDNUL, bool cache_=false, bool point_=false, const PCouleur &c=PCouleur())
Definition: perspective_types.h:785
pint Tailletexte3d
Definition: perspective_types.h:524
puint16 Attributs() const
Definition: perspective_types.h:728
Definition: perspective_def.h:301
Ppoint3D(const Ppoint3D_min &p)
Definition: perspective_types.h:1795
void defColonne(puint index, pfloat m1, pfloat m2, pfloat m3, pfloat m4)
Assigne une colonne dans la matrice d&#39;après son index (0 < 4).
Definition: perspective_types.h:1707
Définition d&#39;un cube 3D orthogonal aux axes X, Y et Z.
Definition: perspective_types.h:2097
void defTrou(bool etat)
Definition: perspective_types.h:1267
Ppoint3D(pfloat x_, pfloat y_, pfloat z_, pident id_=IDNUL, bool ellipse_=false)
Definition: perspective_types.h:1806
Ppoint3D_min(pfloat x_, pfloat y_, pfloat z_, const PCouleur &cl, pident id_=IDNUL)
Definition: perspective_types.h:1517
vues2D_t Vue() const
Definition: perspective_types.h:758
Pvec3 norml
Definition: perspective_types.h:1924
pint X() const
Definition: perspective_types.h:421
std::vector< pident > PStdSolide3D
PStdSolide3D contient un ensemble de surfaces (d&#39;après leur ids)
Definition: perspective_types.h:2290
unsigned short pushort
Definition: perspective_sys.h:614
pfloat Longueur2() const
Definition: perspective_types.h:814
Classe d&#39;image 32 bits (RBVA). Peut gérer un tableau dynamique ou englober un tableau statique suivan...
Definition: perspective_types.h:591
void defPoints(const Ppoint3D &p1, const Ppoint3D &p2)
Definition: perspective_types.h:1881
Ppoint2D p2
Definition: perspective_types.h:827
pfloat & refX()
Definition: perspective_types.h:262
void AjoutAttribut(puint16 attr)
Definition: perspective_types.h:733
void EnglobeLigne(const Pligne2D &l)
Definition: perspective_types.h:901
pfloat at(pint i) const
Definition: perspective_types.h:1495
PPixel(const PPixel &p)
Definition: perspective_types.h:373
Macros préprocesseur de l&#39;API.
const Pvec3 & V2Const() const
Definition: perspective_types.h:1874
Matrice 4x4 basique. Aucun opérateur n&#39;est défini, elle n&#39;est utilisée que pour le transfert des donn...
Definition: perspective_types.h:1644
void defAxeY(const Pvec3 &axe)
Definition: perspective_types.h:1721
Ppoint2D & operator/=(const pfloat s)
Definition: perspective_types.h:268
pfloat angle1
Definition: perspective_types.h:990
Ppoint2D & operator*=(const Ppoint2D &v)
Definition: perspective_types.h:269
const Pvec3 & V1() const
V1 Accès au Sommet.
Definition: perspective_types.h:2031
Pvec3 operator*(const Pvec3 &v) const
Definition: perspective_types.h:1311
Ppoint2D(pfloat x_=COORD0, pfloat y_=COORD0)
Definition: perspective_types.h:255
Défini un solide (d&#39;après un ensemble d&#39;identifiants de surfaces 3D).
Definition: perspective_types.h:2295
const PCouleur & CouleurConst() const
Definition: perspective_types.h:1242
PStdVectGroupeEnts2D * corbeille_scene
Definition: perspective_types.h:1222
ParametresPerspective Paramètres de la bibliothèque Vision.
Definition: perspective_types.h:540
void defX(pfloat x_)
Definition: perspective_types.h:257
char * texte
Definition: perspective_types.h:1032
PCouleur couleur
Definition: perspective_types.h:774
Pvec3 operator*(const pfloat s) const
Definition: perspective_types.h:1309
std::vector< Ptriangle3D > PStdVectTriangles3D
PStdVectTriangles3D Vecteur de triangles.
Definition: perspective_types.h:2082
proprietes_3d_t proprietes
Definition: perspective_types.h:1276
Pvec3(const Pvec3 &p)
Definition: perspective_types.h:1294
#define POW2(X)
Definition: perspective_def.h:197
void defCoords(const Pvec3 &p)
Assigne les coordonnées.
Definition: perspective_types.h:1465
const Pmaillage3D & Maillage() const
Maillage Renvoi le modèle à afficher.
Definition: perspective_types.h:2549
pfloat EchelleDeveloppe() const
Definition: perspective_types.h:2637
PPixel(Poctet_t r_, Poctet_t v_, Poctet_t b_, Poctet_t a=255)
Definition: perspective_types.h:370
Poctet_t b
Definition: perspective_types.h:459
bool ValideAttributId(puint16 id) const
Definition: perspective_types.h:739
void defY(pint y_)
Definition: perspective_types.h:425
pushort id
Definition: perspective_types.h:456
void defRVB(Poctet_t rouge, Poctet_t vert, Poctet_t bleu)
Definition: perspective_types.h:389
bool Nul() const
Definition: perspective_types.h:428
void defB(Poctet_t bleu)
Definition: perspective_types.h:388
const Ppoint2D & Pmin() const
Definition: perspective_types.h:851
Ppoint3D_min(pfloat x_, pfloat y_, pfloat z_, pident id_=IDNUL)
Definition: perspective_types.h:1516
bool ContientSommet(const Ppoint3D_min &p) const
ContientSommet Contrôle si le sommet donné en argument est à l&#39;intérieur du cube. ...
Definition: perspective_types.h:2146
const PStdVectSommets3D & Sommets() const
SommetsConst Renvoi les sommets du modèle.
Definition: perspective_types.h:2379
PCouleur(Poctet_t gris, bool actif_=true)
Definition: perspective_types.h:474
Poctet_t r
Definition: perspective_types.h:457
unsigned int puint
Definition: perspective_sys.h:612
Poctet_t v
Definition: perspective_types.h:458
void defAngle2(pfloat a)
Definition: perspective_types.h:972
Pvec3 v1
Definition: perspective_types.h:2074
pfloat y
Definition: perspective_types.h:355
std::vector< PSolide3D > PStdVectSolide3D
PStdVectSolide3D Vecteur de solides.
Definition: perspective_types.h:2319
void defZ(pfloat z_)
Assigne la coordonée Z.
Definition: perspective_types.h:1455
PMat4x4_data()
Constructeur (identité)
Definition: perspective_types.h:1650
resultat_gen3d_t
Definition: perspective_types.h:29
bool Valide() const
Contrôle si l&#39;image a été considérée comme valide après génération ou chargement. ...
Definition: perspective_types.h:669
pfloat x
Definition: perspective_types.h:354
bool div
Definition: perspective_types.h:492
proprietes_3d_t
Definition: perspective_types.h:230
void defPosition(const Pvec3 &position)
Definition: perspective_types.h:1731
void defVue(vues2D_t v)
Definition: perspective_types.h:759
PEnt23D(const PCouleur &c, pident id_, proprietes_3d_t props)
Definition: perspective_types.h:1239
bool operator!=(const Pvec3 &v) const
operator != Comparaison entre deux points avec l&#39;Epsilon fixe.
Definition: perspective_types.h:1319
Rectangle 2D, principalement pour faire des boites englobantes.
Definition: perspective_types.h:839
PPixel Pixel() const
Definition: perspective_types.h:484
puint64 SalageLicence
Definition: perspective_types.h:559
pfloat Ht() const
Definition: perspective_types.h:977
Pligne3D(const Ppoint3D &p1_, const Ppoint3D &p2_, pident id_=IDNUL, bool ellipse_=false)
Definition: perspective_types.h:1856
Ppoint2D centre
Definition: perspective_types.h:987
puint largeur
Definition: perspective_types.h:685
PMat4x4_data(const PMat4x4_data &copie)
Constructeur (copie).
Definition: perspective_types.h:1668
Ppoint2D centre(const Ppoint2D &p) const
centre Renvoi le centre entre deux sommets.
Definition: perspective_types.h:333
pfloat Rayon() const
Definition: perspective_types.h:2273
PEnt3D()
Definition: perspective_types.h:1942
puint16 attributs
Definition: perspective_types.h:742
Pligne2D & operator=(const Pligne2D &l)
Definition: perspective_types.h:793
void defProprietes(proprietes_2d_t props)
Definition: perspective_types.h:768
Ppoint3D(const Ppoint3D &p)
Definition: perspective_types.h:1798
bool operator!=(const Ppoint2D &v) const
operator != Comparaison entre deux points avec l&#39;Epsilon fixe.
Definition: perspective_types.h:317
pfloat & at(puint i)
Accès à un élément de la matrice.
Definition: perspective_types.h:1764
bool Nulle() const
Definition: perspective_types.h:375
bool operator==(const Ppoint3D_min &v) const
operator == Comparaison entre deux points avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:1556
pfloat EpsilonCoords
Definition: perspective_types.h:545
pfloat Rotation() const
Definition: perspective_types.h:1021
Ppoint2D & operator-=(const pfloat s)
Definition: perspective_types.h:266
pfloat Distance2(const Ppoint3D_min &p) const
Distance2 Distance au carré par rapport à un autre point.
Definition: perspective_types.h:1612
PSommet3D()
Definition: perspective_types.h:2018
void identite()
Assigne à la matrice l&#39;identité.
Definition: perspective_types.h:1739
puint connexion_lignes
Definition: perspective_types.h:1833
PStdVectTextes2D * listetextes
Definition: perspective_types.h:1109
bool operator<(const Ppoint2D &v) const
operator < Comparaison entre deux points avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:301
Ppoint2D p1
Definition: perspective_types.h:827
void defCentre(const Ppoint2D &c)
Definition: perspective_types.h:982
Ppoint2D & operator+=(const Ppoint2D &v)
Definition: perspective_types.h:271
PStdVectPixels * pixels
Definition: perspective_types.h:686
std::vector< Pligne3D > PStdVectLigne3D
PStdVectLigne3D Vecteur de lignes 3D.
Definition: perspective_types.h:1931
pfloat Hauteur() const
Definition: perspective_types.h:865
void EnglobeRect(const Prect2D &r)
Definition: perspective_types.h:908
infos3d_t Informations
Definition: perspective_types.h:523
infos3d_t
Definition: perspective_types.h:179
const PCouleur & CouleurConst() const
Definition: perspective_types.h:765
Détection de la plateforme.
const Ppoint3D & P1Const() const
Definition: perspective_types.h:1870
void defY(pfloat y_)
Assigne la coordonée Y.
Definition: perspective_types.h:1587
params_gen3d_t
Definition: perspective_types.h:203
pfloat Longueur2() const
Definition: perspective_types.h:1898
void defNorm(pfloat x, pfloat y, pfloat z)
Definition: perspective_types.h:1965
void defCouleur(const PCouleur &c)
Definition: perspective_types.h:1244
PEnt23D()
Definition: perspective_types.h:1240
Pellipse2D(const Ppoint2D &centre_, pfloat lg_, pfloat ht_, pfloat angle1_, pfloat angle2_, pfloat rotation_=0., pident id_=IDNUL, bool cache_=false)
Definition: perspective_types.h:947
Pvec3(pfloat x_, pfloat y_, pfloat z_, pident id_)
Definition: perspective_types.h:1288
void defCache(bool c)
Definition: perspective_types.h:762
vues2D_t Projections
Definition: perspective_types.h:522
Pellipse2D & operator=(const Pellipse2D &e)
Definition: perspective_types.h:955
Pvec3 & operator+=(const pfloat s)
Definition: perspective_types.h:1298
PBaseId(pident id_)
Definition: perspective_types.h:698
void defPositionX(pfloat x)
Definition: perspective_types.h:1015
bool point
Definition: perspective_types.h:828
const PStdVectLignes2D & ListeLignes() const
Liste des segments.
Definition: perspective_types.h:1074
#define RCARREF
Definition: perspective_def.h:73
pfloat ToleranceJointuresCentreCourbes
Definition: perspective_types.h:551
#define COORD0
Definition: perspective_def.h:240
const char * Texte() const
Definition: perspective_types.h:1028
pfloat Distance2(const Pvec3 &p) const
Distance2 Distance au carré par rapport à un autre point.
Definition: perspective_types.h:1370
PStdVectPoints2D * listepoints
Definition: perspective_types.h:1110
Pvec3 vec
Definition: perspective_types.h:1631
pfloat ToleranceCoords2
Definition: perspective_types.h:547
pfloat DeltaAnglesCourbesMin
Definition: perspective_types.h:555
bool Actif() const
Definition: perspective_types.h:1945
pfloat dot(const Pvec3 &v) const
dot Produit scalaire.
Definition: perspective_types.h:1360
lang_p3d_t
Definition: perspective_types.h:167
bool CoordNul() const
Definition: perspective_types.h:1619
Ppoint2D operator+(const pfloat s) const
Definition: perspective_types.h:274
Défini une surface 3D à partir d&#39;un ensemble de sous-lignes représentant son contour.
Definition: perspective_types.h:2247
Ppoint2D P4() const
Definition: perspective_types.h:862
modeperspective_t
Definition: perspective_types.h:75
Ppoint2D & P1()
Definition: perspective_types.h:801
Ppoint3D p1p
Definition: perspective_types.h:1922
puint Taille_surfaces
Definition: perspective_types.h:529
std::vector< PPixel > PStdVectPixels
PStdVectPoints2D Vecteur de pixels.
Definition: perspective_types.h:410
bool operator==(const PPointPixel &p) const
Definition: perspective_types.h:430
Pvec3 cross(const Pvec3 &v) const
cross Produit vectoriel.
Definition: perspective_types.h:1355
puint CouleurRAL() const
Couleur Renvoi la couleur de préférence pour afficher la scène.
Definition: perspective_types.h:2604
void defProprietes(proprietes_3d_t props)
Definition: perspective_types.h:1246
Pvec3 centre(const Pvec3 &v) const
centre Renvoi le centre entre deux sommets.
Definition: perspective_types.h:1350
puint ConnexionLignes() const
Definition: perspective_types.h:1829
puint Largeur() const
Renvoi la largeur de l&#39;image.
Definition: perspective_types.h:644
Poctet_t B() const
Definition: perspective_types.h:382
Ppoint2D & P2()
Definition: perspective_types.h:806
Type de base pour les entitées 2D.
Definition: perspective_types.h:749
bool operator==(const Ppoint2D &v) const
operator == Comparaison entre deux points avec l&#39;Epsilon fixe.
Definition: perspective_types.h:322
std::vector< Ppoint2D > PStdVectPoints2D
PStdVectPoints2D Vecteur de points 2D.
Definition: perspective_types.h:361
pfloat z
Definition: perspective_types.h:1503
pfloat Aire() const
Definition: perspective_types.h:924
puint LongueurTexte() const
Definition: perspective_types.h:1029
pfloat Tolerance
Definition: perspective_types.h:519
std::vector< PSegment3D > PStdVectSegments3D
PStdVectSegments3D Vecteur de segments.
Definition: perspective_types.h:2008
Ppoint2D operator/(const pfloat s) const
Definition: perspective_types.h:277
void defLg(pfloat l)
Definition: perspective_types.h:975
Type de base pour les entitées strictement 3D.
Definition: perspective_types.h:1939
PSurface3D()
Definition: perspective_types.h:2252
uint32_t puint32
Definition: perspective_sys.h:633
const Ppoint3D & P2Const() const
Definition: perspective_types.h:1871
Définition d&#39;un segment de droite à base de vertices (destiné à l&#39;affichage 3D).
Definition: perspective_types.h:1974
const Pvec3 & V1() const
V1 Accès au premier sommet du triangle.
Definition: perspective_types.h:2061
Ppoint3D & P2()
Definition: perspective_types.h:1877
PEntite(pident id_)
Definition: perspective_types.h:725
PCouleur couleur
Definition: perspective_types.h:1277
pfloat x
Definition: perspective_types.h:1503
Type de base pour gérer les ids des entités graphiques.
Definition: perspective_types.h:695
Pvec3 operator+(const pfloat s) const
Definition: perspective_types.h:1307
const Ppoint2D & P2Const() const
Definition: perspective_types.h:807
bool Courbe() const
Definition: perspective_types.h:1249
Pvec3 P8() const
Definition: perspective_types.h:2188
normevues_t Norme_vues
Definition: perspective_types.h:530
std::vector< Prect2D > PStdVectRect2D
PStdVectRect2D Vecteur des rectangles 2D.
Definition: perspective_types.h:934
Pvec3 v_min
Definition: perspective_types.h:2203
const PStdVectTriangles3D & TrianglesConst() const
Definition: perspective_types.h:2265
PStdVectEllipses2D * listeellipses
Definition: perspective_types.h:1108
PMat4x4_data(const Pvec3 &axe_x, const Pvec3 &axe_y, const Pvec3 &axe_z, const Pvec3 &position)
Constructeur par définition des colonnes.
Definition: perspective_types.h:1677
const Pvec3 & NormL() const
Definition: perspective_types.h:1895
Pvec3 operator-(const pfloat s) const
Definition: perspective_types.h:1308
Ppoint3D & operator=(const Ppoint3D &p)
Definition: perspective_types.h:1812
bool valide
Definition: perspective_types.h:688
PCouleur & Couleur()
Definition: perspective_types.h:764
pfloat Distance(const Ppoint2D &p) const
Distance Distance entre deux points.
Definition: perspective_types.h:339
const Pvec3 & PMax() const
Definition: perspective_types.h:2193
bool operator<(const Pligne3D &l) const
operator < Comparaison entre deux lignes avec l&#39;Epsilon dynamique.
Definition: perspective_types.h:1914
Ppoint3D p2p
Definition: perspective_types.h:1923
puint TailleDiagoUniforme
Definition: perspective_types.h:525
PPixel(puint32 v)
Definition: perspective_types.h:371
pfloat Y() const
Renvoi la coordonée Y.
Definition: perspective_types.h:1440
Ppoint2D & Centre()
Definition: perspective_types.h:980
Pligne3D(const Pligne3D &l)
Definition: perspective_types.h:1850
Pvec3 & operator+=(const Pvec3 &v)
Definition: perspective_types.h:1304
PStdVectLignes2D * listelignes
Definition: perspective_types.h:1107
PCouleur(Poctet_t rouge, Poctet_t vert, Poctet_t bleu, bool actif_=true)
Definition: perspective_types.h:473
Poctet_t v
Definition: perspective_types.h:403
pfloat dot(const Ppoint2D &v) const
dot Produit scalaire.
Definition: perspective_types.h:344
static size_t numDim()
Definition: perspective_types.h:351
PEnt3D(const PCouleur &c, pident i, bool a)
Definition: perspective_types.h:1943
Pvec3 v2
Definition: perspective_types.h:2075
pfloat Largeur() const
Definition: perspective_types.h:864
std::vector< PTexte2D > PStdVectTextes2D
PStdVectTextes2D Vecteur de textes 2D.
Definition: perspective_types.h:1042
bool Ferme() const
Definition: perspective_types.h:962
void IncConnexionLignes()
Definition: perspective_types.h:1830
void defP2(const Ppoint2D &p)
Definition: perspective_types.h:808
PEnt2D(pident i, vues2D_t v, bool c, const PCouleur &cl)
Definition: perspective_types.h:755
#define CompareE(a, b)
Definition: perspective_def.h:321
Ppoint3D()
Definition: perspective_types.h:1804
void defPmin(const Ppoint2D &p)
Definition: perspective_types.h:848
const Pvec3 & Vec3() const
Definition: perspective_types.h:1538
uint8_t puint8
Definition: perspective_sys.h:629
const PStdVectSegments3D & Vertices() const
Definition: perspective_types.h:2220
pfloat Diago() const
Definition: perspective_types.h:867
const Ppoint2D & P1Const() const
Definition: perspective_types.h:802
pfloat DimY() const
DimY Renvoi la taille de la scène en Y (en principe l&#39;utilisateur n&#39;a pas à y toucher, Perspective s&#39;en chargera).
Definition: perspective_types.h:2624
pident id_connexion_courbe
Definition: perspective_types.h:1834