1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <IGESSelect_IGESTypeForm.ixx>
15 #include <IGESData_IGESEntity.hxx>
16 #include <IGESData_UndefinedEntity.hxx>
17 #include <Interface_Macros.hxx>
21 static char falsetype [] = "?";
22 static char typeval [30]; // une seule reponse a la fois ...
26 IGESSelect_IGESTypeForm::IGESSelect_IGESTypeForm
27 (const Standard_Boolean withform)
29 : IFSelect_Signature ((Standard_CString ) (withform ? "IGES Type & Form Numbers" : "IGES Type Number"))
30 //: IFSelect_Signature (withform ? "IGES Type & Form Numbers" : "IGES Type Number")
31 { theform = withform; }
33 void IGESSelect_IGESTypeForm::SetForm (const Standard_Boolean withform)
34 { theform = withform; thename.Clear();
36 Standard_CString astr = (Standard_CString ) (withform ? "IGES Type & Form Numbers" : "IGES Type Number") ;
37 thename.AssignCat ( astr ); }
38 // thename.AssignCat (withform ? "IGES Type & Form Numbers" : "IGES Type Number") ;
40 Standard_CString IGESSelect_IGESTypeForm::Value
41 (const Handle(Standard_Transient)& ent,
42 const Handle(Interface_InterfaceModel)& /*model*/) const
44 DeclareAndCast(IGESData_IGESEntity,igesent,ent);
45 if (igesent.IsNull()) return &falsetype[0];
46 Standard_Boolean unk = ent->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity));
47 Standard_Integer typenum = igesent->TypeNumber();
48 Standard_Integer formnum = igesent->FormNumber();
50 if (theform) sprintf (typeval,"%d %d (?)",typenum,formnum);
51 else sprintf (typeval,"%d (?)",typenum);
53 if (theform) sprintf (typeval,"%d %d",typenum,formnum);
54 else sprintf (typeval,"%d", typenum);