1 // File: Units_ShiftedUnit.cxx
2 // Created: Wed Nov 4 17:46:04 1992
3 // Author: Gilles DEBARBOUILLE
7 #include <Units_ShiftedUnit.ixx>
8 #include <Units_ShiftedToken.hxx>
9 #include <TCollection_AsciiString.hxx>
10 #include <TColStd_HSequenceOfHAsciiString.hxx>
12 //=======================================================================
13 //function : Units_ShiftedUnit
15 //=======================================================================
17 Units_ShiftedUnit::Units_ShiftedUnit(const Standard_CString aname,
18 const Standard_CString asymbol,
19 const Standard_Real avalue,
20 const Standard_Real amove,
21 const Handle(Units_Quantity)& aquantity)
22 : Units_Unit(aname,asymbol,avalue,aquantity)
27 //=======================================================================
28 //function : Units_ShiftedUnit
30 //=======================================================================
32 Units_ShiftedUnit::Units_ShiftedUnit(const Standard_CString aname,
33 const Standard_CString asymbol)
34 : Units_Unit(aname,asymbol)
37 //=======================================================================
38 //function : Units_ShiftedUnit
40 //=======================================================================
42 Units_ShiftedUnit::Units_ShiftedUnit(const Standard_CString aname)
46 //=======================================================================
49 //=======================================================================
51 void Units_ShiftedUnit::Move(const Standard_Real amove)
56 //=======================================================================
59 //=======================================================================
61 Standard_Real Units_ShiftedUnit::Move() const
66 //=======================================================================
69 //=======================================================================
71 Handle(Units_Token) Units_ShiftedUnit::Token() const
73 TCollection_AsciiString string = SymbolsSequence()->Value(1)->String();
74 return new Units_ShiftedToken(string.ToCString()," ",Value(),themove,Quantity()->Dimensions());
77 //=======================================================================
80 //=======================================================================
82 //void Units_ShiftedUnit::Dump(const Standard_Integer ashift,
83 // const Standard_Integer alevel) const
84 void Units_ShiftedUnit::Dump(const Standard_Integer ,
85 const Standard_Integer ) const
87 Standard_Integer index;
88 TCollection_AsciiString string;
91 // for(i=0; i<ashift; i++)cout<<" ";
92 for(index=1;index<=thesymbolssequence->Length();index++)
94 string = thesymbolssequence->Value(index)->String();
95 if(index != 1) cout << " or " ;
96 cout<<"\""<<string.ToCString()<<"\"";
98 cout<< " Name: " <<Name().ToCString()<<" (= *" << thevalue << " SI + " << themove << ")"<<endl;