/[ascend]/trunk/pygtk/ascpy.i
ViewVC logotype

Diff of /trunk/pygtk/ascpy.i

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1698 by jpye, Mon Dec 17 00:45:59 2007 UTC revision 1699 by jpye, Sat Jan 5 02:49:48 2008 UTC
# Line 9  Line 9 
9  %include <python/std_except.i>  %include <python/std_except.i>
10  %include <python/std_vector.i>  %include <python/std_vector.i>
11  %include <python/std_map.i>  %include <python/std_map.i>
12    %include <python/std_set.i>
13    
14  %{  %{
15  #include "library.h"  #include "library.h"
# Line 118  public: Line 119  public:
119  %template(StringVector) std::vector<std::string>;  %template(StringVector) std::vector<std::string>;
120  %template(IntStringMap) std::map<int,std::string>;  %template(IntStringMap) std::map<int,std::string>;
121  %template(AnnotationVector) std::vector<Annotation>;  %template(AnnotationVector) std::vector<Annotation>;
122    %template(UnitsVector) std::vector<UnitsM>;
123    %template(TypeSet) std::set<Type>;
124    
125  %rename(Instance) Instanc;  %rename(Instance) Instanc;
126  %rename(Name) Nam;  %rename(Name) Nam;
# Line 171  Reporter *getReporter(); Line 174  Reporter *getReporter();
174    
175  class UnitsM;  class UnitsM;
176    
177  class Dimensions{  %include "dimensions.h"
 public:  
     static const unsigned MAX_DIMS;  
     static const std::string getBaseUnit(const unsigned &);  
   
     const bool operator==(const Dimensions &) const;  
     const bool operator!=(const Dimensions &) const;  
     const bool operator<(const Dimensions &) const;  
     Dimensions(const Dimensions &);  
     const bool isWild() const;  
     const bool isDimensionless() const;  
     const short getFractionNumerator(const unsigned &) const;  
     const short getFractionDenominator(const unsigned &) const;  
 };  
   
178  %include "units.h"  %include "units.h"
179    
180  %extend UnitsM{  %extend UnitsM{
# Line 202  public: Line 191  public:
191      of the time you will want to use custom units in place of these, eg      of the time you will want to use custom units in place of these, eg
192      'N' instead of 'kg*m/s^2'.      'N' instead of 'kg*m/s^2'.
193  */  */
194    
195    %rename(__str__) Dimensions::toString;
196    
197  %extend Dimensions{  %extend Dimensions{
198      %pythoncode {      %pythoncode {
199            
200            def __str__(self):
201                return self.toString()
202    
203          def getDefaultUnits(self):          def getDefaultUnits(self):
204              """Return the default (SI) units for a specific set of dimensions."""              """Return the default (SI) units for a specific set of dimensions."""

Legend:
Removed from v.1698  
changed lines
  Added in v.1699

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22