blob: 02326a6a2560fce7acd0a53da8b0de7ebd454807 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#include <IGESSelect_IGESTypeForm.ixx>
#include <IGESData_IGESEntity.hxx>
#include <IGESData_UndefinedEntity.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>
static char falsetype [] = "?";
static char typeval [30]; // une seule reponse a la fois ...
IGESSelect_IGESTypeForm::IGESSelect_IGESTypeForm
(const Standard_Boolean withform)
//JR/Hp
: IFSelect_Signature ((Standard_CString ) (withform ? "IGES Type & Form Numbers" : "IGES Type Number"))
//: IFSelect_Signature (withform ? "IGES Type & Form Numbers" : "IGES Type Number")
{ theform = withform; }
void IGESSelect_IGESTypeForm::SetForm (const Standard_Boolean withform)
{ theform = withform; thename.Clear();
//JR/Hp
Standard_CString astr = (Standard_CString ) (withform ? "IGES Type & Form Numbers" : "IGES Type Number") ;
thename.AssignCat ( astr ); }
// thename.AssignCat (withform ? "IGES Type & Form Numbers" : "IGES Type Number") ;
Standard_CString IGESSelect_IGESTypeForm::Value
(const Handle(Standard_Transient)& ent,
const Handle(Interface_InterfaceModel)& model) const
{
DeclareAndCast(IGESData_IGESEntity,igesent,ent);
if (igesent.IsNull()) return &falsetype[0];
Standard_Boolean unk = ent->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity));
Standard_Integer typenum = igesent->TypeNumber();
Standard_Integer formnum = igesent->FormNumber();
if (unk) {
if (theform) sprintf (typeval,"%d %d (?)",typenum,formnum);
else sprintf (typeval,"%d (?)",typenum);
} else {
if (theform) sprintf (typeval,"%d %d",typenum,formnum);
else sprintf (typeval,"%d", typenum);
}
return &typeval[0];
}
|