%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    polygonesCoordinate\pst-coxcoor.tex
%    Authors:      J.-G. Luque and M. Luque
%    Purpose:      Library pst-coxcoor.tex
%    Created:      02/02/2008
%    License:      LGPL
%    Project:      PST-Cox V1.00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright © 2008 Jean-Gabriel Luque, Manuel Luque.
% This work may be distributed and/or modified  under the condition of
% the Lesser GPL.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is part of PST-Cox V1.00.
%
%    PST-Cox V1.00 is free software: you can redistribute it and/or modify
%    it under the terms of the Lesser GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    PST-Cox V1.00 is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    Lesser GNU General Public License for more details.
%
%    You should have received a copy of the Lesser GNU General Public License
%    along with PST-Cox V1.00.  If not, see <http://www.gnu.org/licenses/>.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\fileversion{0.98 Beta}
\def\filedate{2008/14/01}

\message{`Pst-Coxeter-Coordinates' v\fileversion, \filedate\space
(Jean-Gabriel Luque and Manuel Luque)}

\csname PstCoxeterCoordinatesLoaded\endcsname
\let\PstCoxeterCoordinatesLoaded\endinput
% Require PSTricks and pst-xkey
\ifx\PSTnodeLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi
%
% Catcodes changes.
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax

\pst@addfams{pst-coxeter}
 %%% Parameter choice. Allows to choice the polytope. To each integer
 %%% 0<i<74 corresponds a polytope.
\define@key[psset]{pst-coxeter}{choice}{%
\pst@cntg=#1\relax \ifnum\pst@cntg>80 \typeout{choice < or = 80 and
not `\the\pst@cntg'. Value 1 forced.} \pst@cntg=1
 \fi
\edef\psk@pstCoxeter@choice{#1}}
\psset{choice=1}
%
%
% Graphical parameters
%
% Colors
% Color of Vertices
% Example: \CoxeterCoordinates[colorVertices=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorVertices}{%
\pst@getcolor{#1}\pscolorVertices}
% by default the color of the vertices is green
\psset{colorVertices=green}
% Color of centers
% Example: \CoxeterCoordinates[colorCenters=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorCenters}{%
\pst@getcolor{#1}\pscolorCenters}
 \psset{colorCenters=blue}
% Color of centers of the faces
% Example: \CoxeterCoordinates[colorCentersFaces=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorCentersFaces}{%
\pst@getcolor{#1}\pscolorCentersFaces}
 \psset{colorCentersFaces=red}
%
% Color of centers of the Cells
% Example: \CoxeterCoordinates[colorCentersCells=blue,choice=5]
\define@key[psset]{pst-coxeter}{colorCentersCells}{%
\pst@getcolor{#1}\pscolorCentersCells}
% by default the color of the centers is red.
\psset{colorCentersCells=magenta}
%
%
% Dot styles
% style of Vertices
% Example: \CoxeterCoordinates[styleVertices=*pentagon,P=5]
\def\psset@styleVertices#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleVertices `#1' not defined}\@eha}%
{\edef\psk@styleVertices{#1}}}
% by default the vertices are represented by a (empty) circle (styleVertices=o)
 \psset@styleVertices{o}
% style of Centers
% Example: \CoxeterCoordinates[styleCenters=*pentagon,choice=5]
\def\psset@styleCenters#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleCenters `#1' not defined}\@eha}%
{\edef\psk@styleCenters{#1}}}
% by default the vertices are represented by a disk (styleVertices=*)
 \psset@styleCenters{*}
%
% style of Centers of the faces
% Example: \CoxeterCoordinates[styleCentersFaces=*pentagon,choice=5]
%
\def\psset@styleCentersFaces#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleCentersFaces `#1' not defined}\@eha}%
{\edef\psk@styleCentersFaces{#1}}}
%
% by default the centers of the faces are represented by a disk (styleCentersFaces=*)
%
 \psset@styleCentersFaces{*}
 % style of Centers of the Cells
% Example: \CoxeterCoordinates[styleCentersCells=*pentagon,choice=5]
\def\psset@styleCentersCells#1{%
\@ifundefined{psds@#1}%
{\@pstrickserr{styleCentersCells `#1' not defined}\@eha}%
{\edef\psk@styleCentersCells{#1}}}
% by default the centers of the cells are represented by a disk (stylesCentersCells=*)
 \psset@styleCentersCells{*}
%
%
% Dot sizes
% Size of vertices
% Example: \CoxeterCoordinates[sizeVertices=0.1,choice=5]
\newdimen\pssizeVertices
\def\psset@sizeVertices#1{\pssetlength\pssizeVertices{#1}}
\psset@sizeVertices{0.05}
% Sizes of centers
% Example: \CoxeterCoordinates[sizeCenters=0.1,choice=5]
\newdimen\pssizeCenters
\def\psset@sizeCenters#1{\pssetlength\pssizeCenters{#1}}
\psset@sizeCenters{0.05}
%
% Sizes of centers of the faces
% Example: \CoxeterCoordinates[sizeCentersFaces=0.1,choice=5]
%
\newdimen\pssizeCentersFaces
\def\psset@sizeCentersFaces#1{\pssetlength\pssizeCentersFaces{#1}}
\psset@sizeCentersFaces{0.05}
%
% Sizes of centers of the cells
% Example: \CoxeterCoordinates[sizeCentersCells=0.1,choice=5]
%
\newdimen\pssizeCentersCells
\def\psset@sizeCentersCells#1{\pssetlength\pssizeCentersCells{#1}}
\psset@sizeCentersCells{0.05}%
%
\newif\ifPst@drawvertices
\define@key[psset]{pst-coxeter}{drawvertices}[true]{%
\@nameuse{Pst@drawvertices#1}}
%
\newif\ifPst@drawedges
\define@key[psset]{pst-coxeter}{drawedges}[true]{%
\@nameuse{Pst@drawedges#1}}
%
\newif\ifPst@drawcenters
\define@key[psset]{pst-coxeter}{drawcenters}[true]{%
\@nameuse{Pst@drawcenters#1}}
%
%
\newif\ifPst@drawcentersfaces
\define@key[psset]{pst-coxeter}{drawcentersfaces}[false]{%
\@nameuse{Pst@drawcentersfaces#1}}
%
%
\newif\ifPst@drawcenterscells
\define@key[psset]{pst-coxeter}{drawcenterscells}[false]{%
\@nameuse{Pst@drawcenterscells#1}}
%
\psset{drawvertices=true,drawedges=true,drawcenters=true}
%
%% Prologue for postscript
\pstheader{pst-coxeter.pro}
%
% definition if the macro \CoxeterCoordinates
%
\def\CoxeterCoordinates{\pst@object{CoxeterCoordinates}}
\def\CoxeterCoordinates@i{\@ifnextchar[{\CoxeterCoordinates@do}{\CoxeterCoordinates@do[]}}
\def\CoxeterCoordinates@do[#1]{{%
\psset{#1}%
\begin@ClosedObj
\addto@pscode{%
%
% List of the polytopes
% The option choice allows to choice the polytope
% Each values of choice corresponds to a variable cox***datas
% The variables cox***datas are defined in the file pst-coxcoor.pro
%
/choice \the\pst@cntg\space def
 choice 1 eq {cox233datas} if
 choice 2 eq {cox332datas} if
 choice 3 eq {cox333datas} if
 choice 4 eq {cox342datas} if
 choice 5 eq {cox344datas} if
 choice 6 eq {cox343datas} if
 choice 7 eq {cox434datas} if
 choice 8 eq {cox24333datas} if
 choice 9 eq {cox33333datas} if
 choice 10 eq {cox33342datas} if
 choice 11 eq {cox3333333datas} if
 choice 12 eq {cox382datas} if
 choice 13 eq {cox283datas} if
 choice 14 eq {cox353datas} if
 choice 15 eq {cox443datas} if
 choice 16 eq {cox432datas} if
 choice 17 eq {cox234datas} if
 choice 18 eq {cox264datas} if
 choice 19 eq {cox462datas} if
 choice 20 eq {cox535datas} if
 choice 21 eq {cox2103datas} if
 choice 22 eq {cox3102datas} if
 choice 23 eq {cox253datas} if
 choice 24 eq {cox352datas} if
 choice 25 eq {cox243datas} if
 choice 26 eq {cox23243datas} if
 choice 27 eq {cox34232datas} if
 choice 28 eq {cox3423232datas} if
 choice 29 eq {cox2323243datas} if
 choice 30 eq {cox23252datas} if
 choice 31 eq {cox25232datas} if
 choice 32 eq {cox2323242datas} if
 choice 33 eq {cox2423232datas} if
 choice 34 eq {cox2324232datas} if
 choice 35 eq {cox2323252datas} if
 choice 36 eq {cox2523232datas} if
 choice 37 eq {cox3523datas} if %
 choice 38 eq {cox5525datas} if
 choice 39 eq {cox2523datas} if
  choice 40 eq {cox3522datas} if
  choice 41 eq {cox31032datas} if
  choice 42 eq {cox21033datas} if
  choice 43 eq {cox3832datas} if
 choice 44 eq {cox2833datas} if
  choice 45 eq {cox562datas} if
  choice 46 eq {cox265datas} if
  choice 47 eq {cox4833datas} if
  choice 48 eq {cox3834datas} if
   choice 49 eq {cox552datas} if
  choice 50 eq {cox255datas} if
   choice 51 eq {cox51032datas} if
  choice 52 eq {cox21035datas} if
   choice 53 eq {cox532datas} if
  choice 54 eq {cox235datas} if
 choice 55 eq {cox542datas} if
  choice 56 eq {cox245datas} if
choice 57 eq {cox51033datas} if
  choice 58 eq {cox31035datas} if
  choice 59 eq {cox543datas} if
  choice 60 eq {cox345datas} if
choice 61 eq {cox533datas} if
  choice 62 eq {cox335datas} if
  choice 63 eq {cox5523datas} if
  choice 64 eq {cox3525datas} if
    choice 65 eq {cox252232datas} if
       choice 66 eq {cox232522datas} if
    choice 67 eq {cox252252datas} if
       choice 68 eq {cox252522datas} if
          choice 69 eq {cox263datas} if
       choice 70 eq {cox362datas} if
       choice 71 eq {cox25223232datas} if
       choice 72 eq {cox23232522datas} if
       choice 73 eq {cox23252252datas} if
      choice 74 eq {cox23252522datas} if
      choice 75 eq {cox25223252datas} if
      choice 76 eq {cox25225232datas} if
      choice 77 eq {cox25232522datas} if
      choice 78 eq {cox25252232datas} if
    choice 79 eq {cox25252252datas} if
    choice 80 eq {cox252252522datas} if
       %%%     <-- add new polytope here
 0 0 translate
 %%% Usefull definitions
/pscolorVertices {\pst@usecolor\pscolorVertices currentrgbcolor} def
/pscolorCenters {\pst@usecolor\pscolorCenters currentrgbcolor} def
 /pscolorCentersFaces {\pst@usecolor\pscolorCentersFaces currentrgbcolor} def
 /pscolorCentersCells {\pst@usecolor\pscolorCentersCells currentrgbcolor} def
/unit \pst@number\psunit\space def % pts -> cm
/unit \pst@number\psunit\space def % pts -> cm
1 setlinejoin
 %%%% Drawing the edges
\ifPst@drawedges
       0 1 NbrEdges 1 sub { % from 0 to nbedges-1 (draw all the edges)
      /CompteurVertices ED
      /CompteurIntermediaireSommets CompteurVertices NbrVerticesInAnEdge mul
      def
newpath ListePoints CompteurIntermediaireSommets get aload pop
  /Y exch def /X exch def
   X unit mul Y unit mul moveto
1 1 NbrVerticesInAnEdge 1 sub { % from 1 to nbvertices in an edge -1
    /CompteurEdges ED
ListePoints CompteurIntermediaireSommets CompteurEdges add get aload
pop
  /Y exch def /X exch def
   X unit mul Y unit mul lineto
  }
  for
closepath stroke } for \fi %
 %%%% Drawing of the Vertices
/DS \pst@number\pssizeVertices\space def
\@nameuse{psds@\psk@styleVertices}%
\ifPst@drawvertices
% We draw all the vertices of all edges
0 1 NbrEdges NbrVerticesInAnEdge mul 1 sub { % From 0 to nbEdges*NbVerticesInEdges-1
/CompteurEdges ED
  ListePoints CompteurEdges get aload pop
  /Y exch def /X exch def
  pscolorVertices
  X unit mul Y unit mul
  Dot
  stroke
} for
 \fi
%
% Drawing of the Centers of the Faces
%
/DS \pst@number\pssizeCentersFaces\space def
\@nameuse{psds@\psk@styleCentersFaces}%
\ifPst@drawcentersfaces
0 1 NbrFaces 1 sub{ % from 0 to NbrFaces-1
/CompteurFaces ED
  ListeFaces CompteurFaces get aload pop
  /Y exch def /X exch def
  pscolorCentersFaces
  X unit mul Y unit mul
 Dot
 stroke
} for
 \fi
%
% Drawing the centers of the Cells
%
/DS \pst@number\pssizeCentersCells\space def
\@nameuse{psds@\psk@styleCentersCells}%
\ifPst@drawcenterscells
0 1 NbrCells 1 sub{ % from 0 to nbCells-1
/CompteurCells ED
  ListeCells CompteurCells get aload pop
  /Y exch def /X exch def
  pscolorCentersCells
  X unit mul Y unit mul
  Dot
  stroke
} for \fi
%
% Drawing the centers of the Edges
%
 /DS \pst@number\pssizeCenters\space def
\@nameuse{psds@\psk@styleCenters}%
\ifPst@drawcenters
0 1 NbrEdges 1 sub { % from 0 to NbrEdges -1
      /CompteurVertices ED
      /CompteurIntermediaireSommets CompteurVertices NbrVerticesInAnEdge mul
      def
      /XM 0 def /YM 0 def
0 1 NbrVerticesInAnEdge 1 sub { %
    /CompteurEdges ED
  ListePoints CompteurEdges CompteurIntermediaireSommets add get aload pop
  /Y ED /X ED
  /XM XM X add def
  /YM YM Y add def
  }
  for
 pscolorCenters
  XM NbrVerticesInAnEdge div unit mul YM NbrVerticesInAnEdge div unit mul %1.5 0 360 arc
   Dot
  stroke
} for \fi
}%
\end@ClosedObj
}}
\catcode`\@=\PstAtCode\relax
\endinput
%%
%% END: pst-coxeter3.tex
