mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-25 12:55:50 +03:00
0023016: Elimination of dependency of Tcl OCAF Browser from Tix product
This commit is contained in:
parent
20637bd27c
commit
f767df4e8c
@ -1,7 +1,6 @@
|
|||||||
// File: DDF_Browser.cxx
|
// File: DDF_Browser.cxx
|
||||||
// ---------------
|
// ---------------
|
||||||
// Author: DAUTRY Philippe
|
// Author: DAUTRY Philippe
|
||||||
// <fid@fox.paris1.matra-dtv.fr>
|
|
||||||
// Copyright: Matra Datavision 1997
|
// Copyright: Matra Datavision 1997
|
||||||
|
|
||||||
// Version: 0.0
|
// Version: 0.0
|
||||||
@ -9,7 +8,6 @@
|
|||||||
// 0.0 Oct 3 1997 Creation
|
// 0.0 Oct 3 1997 Creation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DDF_Browser.ixx>
|
#include <DDF_Browser.ixx>
|
||||||
|
|
||||||
#include <DDF_AttributeBrowser.hxx>
|
#include <DDF_AttributeBrowser.hxx>
|
||||||
@ -118,7 +116,8 @@ TCollection_AsciiString DDF_Browser::OpenRoot() const
|
|||||||
Handle(TDataStd_Name) name;
|
Handle(TDataStd_Name) name;
|
||||||
list.AssignCat(TDF_BrowserSeparator2);
|
list.AssignCat(TDF_BrowserSeparator2);
|
||||||
list.AssignCat("\"");
|
list.AssignCat("\"");
|
||||||
if (root.FindAttribute(TDataStd_Name::GetID(),name)) {
|
if (root.FindAttribute(TDataStd_Name::GetID(),name))
|
||||||
|
{
|
||||||
TCollection_AsciiString tmpStr(name->Get(),'?');
|
TCollection_AsciiString tmpStr(name->Get(),'?');
|
||||||
tmpStr.ChangeAll(' ','_');
|
tmpStr.ChangeAll(' ','_');
|
||||||
list.AssignCat(tmpStr);
|
list.AssignCat(tmpStr);
|
||||||
@ -128,13 +127,7 @@ TCollection_AsciiString DDF_Browser::OpenRoot() const
|
|||||||
if (!root.MayBeModified()) list.AssignCat("Not");
|
if (!root.MayBeModified()) list.AssignCat("Not");
|
||||||
list.AssignCat("Modified");
|
list.AssignCat("Modified");
|
||||||
list.AssignCat(TDF_BrowserSeparator2);
|
list.AssignCat(TDF_BrowserSeparator2);
|
||||||
if (root.HasAttribute() || (root.HasChild())) {
|
list.AssignCat((root.HasAttribute() || root.HasChild())? "1" : "0");
|
||||||
list.AssignCat("1");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
list.AssignCat("0");
|
|
||||||
}
|
|
||||||
//cout<<"OpenRoot: "<<list<<endl;
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +147,8 @@ TCollection_AsciiString DDF_Browser::OpenLabel(const TDF_Label& aLab) const
|
|||||||
{
|
{
|
||||||
Standard_Boolean split = Standard_False;
|
Standard_Boolean split = Standard_False;
|
||||||
TCollection_AsciiString entry, list;
|
TCollection_AsciiString entry, list;
|
||||||
if (aLab.HasAttribute() || aLab.AttributesModified()) {
|
if (aLab.HasAttribute() || aLab.AttributesModified())
|
||||||
|
{
|
||||||
list.AssignCat("AttributeList");
|
list.AssignCat("AttributeList");
|
||||||
list.AssignCat(TDF_BrowserSeparator2);
|
list.AssignCat(TDF_BrowserSeparator2);
|
||||||
if (!aLab.AttributesModified()) list.AssignCat("Not");
|
if (!aLab.AttributesModified()) list.AssignCat("Not");
|
||||||
@ -162,13 +156,15 @@ TCollection_AsciiString DDF_Browser::OpenLabel(const TDF_Label& aLab) const
|
|||||||
split = Standard_True;
|
split = Standard_True;
|
||||||
}
|
}
|
||||||
Handle(TDataStd_Name) name;
|
Handle(TDataStd_Name) name;
|
||||||
for (TDF_ChildIterator itr(aLab); itr.More(); itr.Next()) {
|
for (TDF_ChildIterator itr(aLab); itr.More(); itr.Next())
|
||||||
|
{
|
||||||
if (split) list.AssignCat(TDF_BrowserSeparator1);
|
if (split) list.AssignCat(TDF_BrowserSeparator1);
|
||||||
TDF_Tool::Entry(itr.Value(),entry);
|
TDF_Tool::Entry(itr.Value(),entry);
|
||||||
list.AssignCat(entry);
|
list.AssignCat(entry);
|
||||||
list.AssignCat(TDF_BrowserSeparator2);
|
list.AssignCat(TDF_BrowserSeparator2);
|
||||||
list.AssignCat("\"");
|
list.AssignCat("\"");
|
||||||
if (itr.Value().FindAttribute(TDataStd_Name::GetID(),name)) {
|
if (itr.Value().FindAttribute(TDataStd_Name::GetID(),name))
|
||||||
|
{
|
||||||
TCollection_AsciiString tmpStr(name->Get(),'?');
|
TCollection_AsciiString tmpStr(name->Get(),'?');
|
||||||
tmpStr.ChangeAll(' ','_');
|
tmpStr.ChangeAll(' ','_');
|
||||||
list.AssignCat(tmpStr);
|
list.AssignCat(tmpStr);
|
||||||
@ -179,14 +175,9 @@ TCollection_AsciiString DDF_Browser::OpenLabel(const TDF_Label& aLab) const
|
|||||||
list.AssignCat("Modified");
|
list.AssignCat("Modified");
|
||||||
list.AssignCat(TDF_BrowserSeparator2);
|
list.AssignCat(TDF_BrowserSeparator2);
|
||||||
// May be open.
|
// May be open.
|
||||||
if (itr.Value().HasAttribute() || (itr.Value().HasChild()))
|
list.AssignCat((itr.Value().HasAttribute() || itr.Value().HasChild())? "1" : "0");
|
||||||
list.AssignCat("1");
|
|
||||||
else
|
|
||||||
list.AssignCat("0");
|
|
||||||
|
|
||||||
split = Standard_True;
|
split = Standard_True;
|
||||||
}
|
}
|
||||||
//cout<<"OpenLabel: "<<list<<endl;
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +195,8 @@ TCollection_AsciiString DDF_Browser::OpenAttributeList
|
|||||||
{
|
{
|
||||||
TCollection_AsciiString list;
|
TCollection_AsciiString list;
|
||||||
Standard_Boolean split1 = Standard_False;
|
Standard_Boolean split1 = Standard_False;
|
||||||
for (TDF_AttributeIterator itr(aLab,Standard_False);itr.More();itr.Next()) {
|
for (TDF_AttributeIterator itr(aLab,Standard_False);itr.More();itr.Next())
|
||||||
|
{
|
||||||
if (split1) list.AssignCat(TDF_BrowserSeparator1);
|
if (split1) list.AssignCat(TDF_BrowserSeparator1);
|
||||||
const Handle(TDF_Attribute)& att = itr.Value();
|
const Handle(TDF_Attribute)& att = itr.Value();
|
||||||
const Standard_Integer index = myAttMap.Add(att);
|
const Standard_Integer index = myAttMap.Add(att);
|
||||||
@ -229,11 +221,9 @@ TCollection_AsciiString DDF_Browser::OpenAttributeList
|
|||||||
// May be open.
|
// May be open.
|
||||||
list.AssignCat(TDF_BrowserSeparator2);
|
list.AssignCat(TDF_BrowserSeparator2);
|
||||||
DDF_AttributeBrowser* br = DDF_AttributeBrowser::FindBrowser(att);
|
DDF_AttributeBrowser* br = DDF_AttributeBrowser::FindBrowser(att);
|
||||||
if (br) list.AssignCat("1");
|
list.AssignCat(br? "1" : "0");
|
||||||
else list.AssignCat("0");
|
|
||||||
split1 = Standard_True;
|
split1 = Standard_True;
|
||||||
}
|
}
|
||||||
//cout<<"OpenAttributeList: "<<list<<endl;
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +240,6 @@ TCollection_AsciiString DDF_Browser::OpenAttribute
|
|||||||
Handle(TDF_Attribute) att = myAttMap.FindKey(anIndex);
|
Handle(TDF_Attribute) att = myAttMap.FindKey(anIndex);
|
||||||
DDF_AttributeBrowser* br = DDF_AttributeBrowser::FindBrowser(att);
|
DDF_AttributeBrowser* br = DDF_AttributeBrowser::FindBrowser(att);
|
||||||
if (br) list = br->Open(att);
|
if (br) list = br->Open(att);
|
||||||
//cout<<"OpenAttribute: "<<list<<endl;
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,5 +278,3 @@ TCollection_AsciiString DDF_Browser::Information(const Standard_Integer /*anInde
|
|||||||
TCollection_AsciiString list;
|
TCollection_AsciiString list;
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// File: DDF_BrowserCommands.cxx
|
// File: DDF_BrowserCommands.cxx
|
||||||
// -----------------------
|
// -----------------------
|
||||||
// Author: DAUTRY Philippe
|
// Author: DAUTRY Philippe
|
||||||
// <fid@fox.paris1.matra-dtv.fr>
|
|
||||||
// Copyright: Matra Datavision 1997
|
// Copyright: Matra Datavision 1997
|
||||||
|
|
||||||
// Version: 0.0
|
// Version: 0.0
|
||||||
@ -47,11 +46,10 @@ static Standard_Integer DFBrowse (Draw_Interpretor& di,
|
|||||||
if (!DDF::GetDF (a[1], DF)) return 1;
|
if (!DDF::GetDF (a[1], DF)) return 1;
|
||||||
|
|
||||||
Handle(DDF_Browser) NewDDFBrowser = new DDF_Browser(DF);
|
Handle(DDF_Browser) NewDDFBrowser = new DDF_Browser(DF);
|
||||||
char *name = new char[50];
|
TCollection_AsciiString name("browser_");
|
||||||
if (n == 3) sprintf(name,"browser_%s",a[2]);
|
name += ((n == 3)? a[2] : a[1]);
|
||||||
else sprintf(name,"browser_%s",a[1]);
|
Draw::Set (name.ToCString(), NewDDFBrowser);
|
||||||
|
|
||||||
Draw::Set (name, NewDDFBrowser);
|
|
||||||
TCollection_AsciiString inst1("dftree ");
|
TCollection_AsciiString inst1("dftree ");
|
||||||
inst1.AssignCat(name);
|
inst1.AssignCat(name);
|
||||||
di.Eval(inst1.ToCString());
|
di.Eval(inst1.ToCString());
|
||||||
@ -78,14 +76,8 @@ static Standard_Integer DFOpenLabel (Draw_Interpretor& di,
|
|||||||
TDF_Label lab;
|
TDF_Label lab;
|
||||||
if (n == 3) TDF_Tool::Label(browser->Data(),a[2],lab);
|
if (n == 3) TDF_Tool::Label(browser->Data(),a[2],lab);
|
||||||
|
|
||||||
if (lab.IsNull()) {
|
TCollection_AsciiString list(lab.IsNull()? browser->OpenRoot() : browser->OpenLabel(lab));
|
||||||
TCollection_AsciiString list = browser->OpenRoot();
|
|
||||||
di<<list.ToCString();
|
di<<list.ToCString();
|
||||||
}
|
|
||||||
else {
|
|
||||||
TCollection_AsciiString list = browser->OpenLabel(lab);
|
|
||||||
di<<list.ToCString();
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,11 +101,10 @@ static Standard_Integer DFOpenAttributeList(Draw_Interpretor& di,
|
|||||||
TDF_Label lab;
|
TDF_Label lab;
|
||||||
TDF_Tool::Label(browser->Data(),a[2],lab);
|
TDF_Tool::Label(browser->Data(),a[2],lab);
|
||||||
|
|
||||||
if (lab.IsNull()) {
|
if (lab.IsNull())
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
TCollection_AsciiString list = browser->OpenAttributeList(lab);
|
TCollection_AsciiString list(browser->OpenAttributeList(lab));
|
||||||
di << list.ToCString();
|
di << list.ToCString();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -136,10 +127,8 @@ static Standard_Integer DFOpenAttribute (Draw_Interpretor& di,
|
|||||||
Handle(DDF_Browser) browser =
|
Handle(DDF_Browser) browser =
|
||||||
Handle(DDF_Browser)::DownCast (Draw::Get(a[1], Standard_True));
|
Handle(DDF_Browser)::DownCast (Draw::Get(a[1], Standard_True));
|
||||||
|
|
||||||
Standard_Integer index = atoi(a[2]);
|
const Standard_Integer index = atoi(a[2]);
|
||||||
|
|
||||||
TCollection_AsciiString list = browser->OpenAttribute(index);
|
TCollection_AsciiString list = browser->OpenAttribute(index);
|
||||||
|
|
||||||
di<<list.ToCString();
|
di<<list.ToCString();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -148,8 +137,6 @@ static Standard_Integer DFOpenAttribute (Draw_Interpretor& di,
|
|||||||
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BrowserCommands
|
//function : BrowserCommands
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -157,7 +144,6 @@ static Standard_Integer DFOpenAttribute (Draw_Interpretor& di,
|
|||||||
|
|
||||||
void DDF::BrowserCommands (Draw_Interpretor& theCommands)
|
void DDF::BrowserCommands (Draw_Interpretor& theCommands)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
static Standard_Boolean done = Standard_False;
|
static Standard_Boolean done = Standard_False;
|
||||||
if (done) return;
|
if (done) return;
|
||||||
done = Standard_True;
|
done = Standard_True;
|
||||||
@ -189,5 +175,4 @@ void DDF::BrowserCommands (Draw_Interpretor& theCommands)
|
|||||||
"DON'T USE THIS COMMAND RESERVED TO THE BROWSER!\nReturns information about an attribute, a df or a label: DFDisplayInfo {#} | {browsername [label]}",
|
"DON'T USE THIS COMMAND RESERVED TO THE BROWSER!\nReturns information about an attribute, a df or a label: DFDisplayInfo {#} | {browsername [label]}",
|
||||||
__FILE__, DFDisplayInfo, g);
|
__FILE__, DFDisplayInfo, g);
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,16 @@
|
|||||||
#include <TDataStd_Integer.hxx>
|
#include <TDataStd_Integer.hxx>
|
||||||
#include <TDataStd_Real.hxx>
|
#include <TDataStd_Real.hxx>
|
||||||
#include <TDataStd_Name.hxx>
|
#include <TDataStd_Name.hxx>
|
||||||
|
#include <TDataStd_Comment.hxx>
|
||||||
|
#include <TDataStd_AsciiString.hxx>
|
||||||
|
#include <TDataStd_IntegerArray.hxx>
|
||||||
#include <TDataStd_RealArray.hxx>
|
#include <TDataStd_RealArray.hxx>
|
||||||
|
#include <TDataStd_ByteArray.hxx>
|
||||||
#include <TNaming_NamedShape.hxx>
|
#include <TNaming_NamedShape.hxx>
|
||||||
#include <TDataStd_UAttribute.hxx>
|
#include <TDataStd_UAttribute.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <Draw_Interpretor.hxx>
|
#include <Draw_Interpretor.hxx>
|
||||||
|
#include <TDF_Reference.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : mtmCreate
|
//function : mtmCreate
|
||||||
@ -209,22 +214,16 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
const Handle(TDF_Attribute)& att = itr.Value();
|
const Handle(TDF_Attribute)& att = itr.Value();
|
||||||
if ( att->IsKind(STANDARD_TYPE(TDataStd_TreeNode)) )
|
if ( att->IsKind(STANDARD_TYPE(TDataStd_TreeNode)) )
|
||||||
{
|
{
|
||||||
Standard_CString type = "";
|
|
||||||
// if ( att->ID() == XCAFDoc::ShapeRefGUID() ) type = "Shape Instance Link";
|
|
||||||
// else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorGen) ) type = "Generic Color Link";
|
|
||||||
// else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorSurf) ) type = "Surface Color Link";
|
|
||||||
// else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorCurv) ) type = "Curve Color Link";
|
|
||||||
// else return 0;
|
|
||||||
Handle(TDataStd_TreeNode) TN = Handle(TDataStd_TreeNode)::DownCast(att);
|
Handle(TDataStd_TreeNode) TN = Handle(TDataStd_TreeNode)::DownCast(att);
|
||||||
TCollection_AsciiString ref;
|
TCollection_AsciiString ref;
|
||||||
if ( TN->HasFather() )
|
if ( TN->HasFather() )
|
||||||
{
|
{
|
||||||
TDF_Tool::Entry ( TN->Father()->Label(), ref );
|
TDF_Tool::Entry ( TN->Father()->Label(), ref );
|
||||||
di << type << " ==> " << ref.ToCString();
|
di << " ==> " << ref.ToCString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
di << type << " <== (" << ref.ToCString();
|
di << " <== (" << ref.ToCString();
|
||||||
Handle(TDataStd_TreeNode) child = TN->First();
|
Handle(TDataStd_TreeNode) child = TN->First();
|
||||||
while ( ! child.IsNull() )
|
while ( ! child.IsNull() )
|
||||||
{
|
{
|
||||||
@ -236,6 +235,13 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
di << ")";
|
di << ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDF_Reference)) )
|
||||||
|
{
|
||||||
|
Handle(TDF_Reference) val = Handle(TDF_Reference)::DownCast ( att );
|
||||||
|
TCollection_AsciiString ref;
|
||||||
|
TDF_Tool::Entry ( val->Get(), ref );
|
||||||
|
di << "==> " << ref.ToCString();
|
||||||
|
}
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Integer)) )
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Integer)) )
|
||||||
{
|
{
|
||||||
Handle(TDataStd_Integer) val = Handle(TDataStd_Integer)::DownCast ( att );
|
Handle(TDataStd_Integer) val = Handle(TDataStd_Integer)::DownCast ( att );
|
||||||
@ -254,6 +260,28 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
TCollection_AsciiString str ( val->Get(), '?' );
|
TCollection_AsciiString str ( val->Get(), '?' );
|
||||||
di << str.ToCString();
|
di << str.ToCString();
|
||||||
}
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Comment)) )
|
||||||
|
{
|
||||||
|
Handle(TDataStd_Comment) val = Handle(TDataStd_Comment)::DownCast ( att );
|
||||||
|
TCollection_AsciiString str ( val->Get(), '?' );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_AsciiString)) )
|
||||||
|
{
|
||||||
|
Handle(TDataStd_AsciiString) val = Handle(TDataStd_AsciiString)::DownCast ( att );
|
||||||
|
TCollection_AsciiString str ( val->Get(), '?' );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_IntegerArray)) )
|
||||||
|
{
|
||||||
|
Handle(TDataStd_IntegerArray) val = Handle(TDataStd_IntegerArray)::DownCast ( att );
|
||||||
|
for ( Standard_Integer j=val->Lower(); j <= val->Upper(); j++ )
|
||||||
|
{
|
||||||
|
if ( j > val->Lower() ) di << ", ";
|
||||||
|
TCollection_AsciiString str ( val->Value(j) );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TDataStd_RealArray)) )
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_RealArray)) )
|
||||||
{
|
{
|
||||||
Handle(TDataStd_RealArray) val = Handle(TDataStd_RealArray)::DownCast ( att );
|
Handle(TDataStd_RealArray) val = Handle(TDataStd_RealArray)::DownCast ( att );
|
||||||
@ -264,6 +292,16 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
di << str.ToCString();
|
di << str.ToCString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_ByteArray)) )
|
||||||
|
{
|
||||||
|
Handle(TDataStd_ByteArray) val = Handle(TDataStd_ByteArray)::DownCast ( att );
|
||||||
|
for ( Standard_Integer j=val->Lower(); j <= val->Upper(); j++ )
|
||||||
|
{
|
||||||
|
if ( j > val->Lower() ) di << ", ";
|
||||||
|
TCollection_AsciiString str ( val->Value(j) );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TNaming_NamedShape)) )
|
else if ( att->IsKind(STANDARD_TYPE(TNaming_NamedShape)) )
|
||||||
{
|
{
|
||||||
Handle(TNaming_NamedShape) val = Handle(TNaming_NamedShape)::DownCast ( att );
|
Handle(TNaming_NamedShape) val = Handle(TNaming_NamedShape)::DownCast ( att );
|
||||||
|
362
src/DrawResources/dftree.tcl
Normal file
362
src/DrawResources/dftree.tcl
Normal file
@ -0,0 +1,362 @@
|
|||||||
|
###########################
|
||||||
|
# #
|
||||||
|
# Version 1.4 #
|
||||||
|
# by SZV #
|
||||||
|
# #
|
||||||
|
###########################
|
||||||
|
#
|
||||||
|
# Open : double-clic or +
|
||||||
|
# Close : double-clic or -
|
||||||
|
# Refresh tree : close top level and re-open
|
||||||
|
#
|
||||||
|
# Attributes:
|
||||||
|
# white : interoperable
|
||||||
|
# white + c : non interoperable
|
||||||
|
# X : X Reference
|
||||||
|
# Red : not yet commited in transaction #0
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
proc __update { args } {
|
||||||
|
}
|
||||||
|
|
||||||
|
proc dftree { DDF_Browser } {
|
||||||
|
|
||||||
|
global env
|
||||||
|
global DFTREE_WINDOWS
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
puts $DDF_Browser
|
||||||
|
|
||||||
|
package require Tk
|
||||||
|
|
||||||
|
## Create images
|
||||||
|
set DFTREE_GLOBALS(ImageLabel) [DFOpenImage dfb_folder.gif]
|
||||||
|
set DFTREE_GLOBALS(ImageAttrOther) [DFOpenImage dfb_attribute.gif]
|
||||||
|
set DFTREE_GLOBALS(ImageAttrNS) [DFOpenImage dfb_attribns.gif]
|
||||||
|
|
||||||
|
## set DFTREE_LabelStyle [tixDisplayStyle imagetext \
|
||||||
|
## -font 9x15bold \
|
||||||
|
## -background Bisque3 \
|
||||||
|
## ]
|
||||||
|
|
||||||
|
## set DFTREE_LabelStyle1 [tixDisplayStyle imagetext \
|
||||||
|
## -font 9x15bold \
|
||||||
|
## -background Bisque3 \
|
||||||
|
## -foreground SeaGreen2 \
|
||||||
|
## ]
|
||||||
|
|
||||||
|
## set DFTREE_AttributeStyle [tixDisplayStyle imagetext \
|
||||||
|
## -font 9x15 \
|
||||||
|
## -background Bisque3 \
|
||||||
|
## ]
|
||||||
|
|
||||||
|
## set DFTREE_AttributeStyle1 [tixDisplayStyle imagetext \
|
||||||
|
## -font 9x15 \
|
||||||
|
## -background Bisque3 \
|
||||||
|
## -foreground DarkGreen \
|
||||||
|
## ]
|
||||||
|
|
||||||
|
## set DFTREE_AttributeStyle2 [tixDisplayStyle imagetext \
|
||||||
|
## -font 9x15 \
|
||||||
|
## -background Bisque3 \
|
||||||
|
## -foreground Red \
|
||||||
|
## ]
|
||||||
|
|
||||||
|
set w .$DDF_Browser
|
||||||
|
toplevel $w -height 400 -width 700 -background bisque3
|
||||||
|
|
||||||
|
########
|
||||||
|
# Tree #
|
||||||
|
########
|
||||||
|
|
||||||
|
set tree1 [ttk::treeview $w.tree -show tree]
|
||||||
|
$tree1 tag bind Label <<TreeviewOpen>> [list DFTREE:Tree:Open $DDF_Browser $w]
|
||||||
|
$tree1 tag configure Label -font 9x15bold -foreground DarkGreen
|
||||||
|
#$tree1 tag configure Attribute -font 9x15 -background bisque3
|
||||||
|
#$tree1 tag configure AttributeList -font 9x15 -background bisque3
|
||||||
|
pack $tree1 -expand yes -fill both -padx 4 -pady 4
|
||||||
|
|
||||||
|
# to see different fonts: /usr/openwin/lib/X11/fonts/misc or xlsfonts?
|
||||||
|
# 8x13 8x13bold 9x15 9x15bold
|
||||||
|
# hlist.font 8x13bold
|
||||||
|
# hlist.gap "15"
|
||||||
|
# hlist.indent "30"
|
||||||
|
|
||||||
|
set DFTREE_WINDOWS($w,tree) $tree1
|
||||||
|
set DFTREE_WINDOWS($w,root) [$tree1 insert {} end \
|
||||||
|
-text $DDF_Browser \
|
||||||
|
-values "" \
|
||||||
|
-tags Label]
|
||||||
|
|
||||||
|
# Here we need to open first node!
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
#
|
||||||
|
proc DFTREE:Tree:Open { DDF_Browser w } {
|
||||||
|
|
||||||
|
global DFTREE_WINDOWS
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
set df_tree $DFTREE_WINDOWS($w,tree)
|
||||||
|
set df_node [$df_tree focus]
|
||||||
|
|
||||||
|
#if {$df_node == $DFTREE_WINDOWS($w,root)} {
|
||||||
|
# This is root
|
||||||
|
set chdlist [$df_tree children $df_node]
|
||||||
|
if {$chdlist != {}} {
|
||||||
|
# The root branch already exists in hlist.
|
||||||
|
# Clear all its children to force the tree to be updated.
|
||||||
|
$df_tree delete $chdlist
|
||||||
|
}
|
||||||
|
#}
|
||||||
|
|
||||||
|
#update
|
||||||
|
DFTREE:Tree:Fill $DDF_Browser $df_tree $df_node
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
#
|
||||||
|
proc DFTREE:Tree:Fill { DDF_Browser df_tree df_node } {
|
||||||
|
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
set loc [lindex [$df_tree item $df_node -values] 0]
|
||||||
|
set type [lindex [$df_tree item $df_node -tags] 0]
|
||||||
|
|
||||||
|
switch -glob $type {
|
||||||
|
|
||||||
|
Label {
|
||||||
|
DFTREE:Tree:UpdateLabel $DDF_Browser $df_tree $df_node $loc
|
||||||
|
}
|
||||||
|
|
||||||
|
#AttributeList {
|
||||||
|
# DFTREE:Tree:UpdateAttributeList $DDF_Browser $df_tree $df_node $loc
|
||||||
|
#}
|
||||||
|
|
||||||
|
default {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# $df_entry is a label entry, "1:3:2" for example, or "" for root.
|
||||||
|
#
|
||||||
|
proc DFTREE:Tree:UpdateLabel { DDF_Browser df_tree df_node df_entry } {
|
||||||
|
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
foreach fullname [split [DFOpenLabel $DDF_Browser $df_entry] "\\" ] {
|
||||||
|
FCTREE:Tree:DecodeLabelItem $DDF_Browser $df_tree $df_node $df_entry $fullname
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
#
|
||||||
|
proc DFTREE:Tree:UpdateAttributeList { DDF_Browser df_tree df_node df_entry} {
|
||||||
|
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
set image_other $DFTREE_GLOBALS(ImageAttrOther)
|
||||||
|
set image_ns $DFTREE_GLOBALS(ImageAttrNS)
|
||||||
|
#set xrefimage $DFTREE_GLOBALS(ImageAttrOther)
|
||||||
|
|
||||||
|
# abv: index attributes
|
||||||
|
set num 0
|
||||||
|
set attributes [split [DFOpenAttributeList $DDF_Browser $df_entry ] "\\" ]
|
||||||
|
set iattributes {}
|
||||||
|
foreach fullname $attributes {
|
||||||
|
set num [expr $num + 1]
|
||||||
|
lappend fullname $num
|
||||||
|
lappend iattributes $fullname
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach fullname [lsort $iattributes] {
|
||||||
|
|
||||||
|
# Information first split
|
||||||
|
set tmplist [split $fullname " "]
|
||||||
|
set name [lindex $tmplist 0]
|
||||||
|
set transaction [lindex $tmplist 1]
|
||||||
|
set valid [lindex $tmplist 2]
|
||||||
|
set forgotten [lindex $tmplist 3]
|
||||||
|
set backuped [lindex $tmplist 4]
|
||||||
|
set maybeopen [lindex $tmplist 5]
|
||||||
|
|
||||||
|
# Name analysis to suppress the map address.
|
||||||
|
set shortlist [split $name "#"]
|
||||||
|
set shortname [lindex $shortlist 0]
|
||||||
|
set index [lindex $shortlist 1]
|
||||||
|
|
||||||
|
# Package analysis to determine the icon type.
|
||||||
|
#set pk [lindex [split $name _] 0]
|
||||||
|
set node_img $image_other
|
||||||
|
#if {$pk == "TDataStd" || $pk == "TNaming"} {set node_img $standardimage}
|
||||||
|
#if {$pk == "TXRef"} {set node_img $xrefimage}
|
||||||
|
if {$shortname == "TNaming_NamedShape"} {set node_img $image_ns}
|
||||||
|
|
||||||
|
set textname "$shortname"
|
||||||
|
|
||||||
|
# if { [llength $tmplist] >5 } { set textname [lindex $tmplist 5] }
|
||||||
|
set textname "$textname [DFGetAttributeValue $DDF_Browser $df_entry [lindex $tmplist 6]]"
|
||||||
|
|
||||||
|
# Transaction analysis
|
||||||
|
if {$transaction == "0"} {
|
||||||
|
# set locstyle $DFTREE_AttributeStyle
|
||||||
|
} else {
|
||||||
|
# set textname "$textname T=$transaction"
|
||||||
|
# set locstyle $DFTREE_AttributeStyle1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Valid?
|
||||||
|
if {$valid == "NotValid"} {set textname "$textname $valid"}
|
||||||
|
|
||||||
|
# Forgotten?
|
||||||
|
if {$forgotten == "Forgotten"} {set textname "$textname $forgotten"}
|
||||||
|
|
||||||
|
# Backuped?
|
||||||
|
if {$backuped == "Backuped"} {set textname "$textname $backuped"}
|
||||||
|
|
||||||
|
set df_new [$df_tree insert $df_node end \
|
||||||
|
-text $textname -image $node_img -tags Attribute]
|
||||||
|
|
||||||
|
if {$maybeopen == "1"} {
|
||||||
|
$df_tree item $df_new -open true
|
||||||
|
DFTREE:Tree:UpdateAttribute $DDF_Browser $df_tree $df_new $index
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# $loc is always the attribute index
|
||||||
|
#
|
||||||
|
proc DFTREE:Tree:UpdateAttribute { DDF_Browser df_tree df_node a_index } {
|
||||||
|
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
set tmplist [split [DFOpenAttribute $DDF_Browser $a_index ] "\\"]
|
||||||
|
|
||||||
|
# Failed or not?
|
||||||
|
if {[lindex $tmplist 0] == "Failed"} {
|
||||||
|
## set locstyle $DFTREE_AttributeStyle2
|
||||||
|
} else {
|
||||||
|
## set locstyle $DFTREE_AttributeStyle
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach name $tmplist {
|
||||||
|
$df_tree insert $df_node end -text $name -tags Terminal
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# item:
|
||||||
|
# "Entry Name=TheNameIfExists Modified|NotModified 0|1"
|
||||||
|
proc FCTREE:Tree:DecodeLabelItem { DDF_Browser df_tree df_node df_entry labelItem} {
|
||||||
|
|
||||||
|
global DFTREE_GLOBALS
|
||||||
|
global $DDF_Browser
|
||||||
|
|
||||||
|
set tmplist [split $labelItem " " ]
|
||||||
|
set labname [lindex $tmplist 0]
|
||||||
|
|
||||||
|
set textname "$labname"
|
||||||
|
|
||||||
|
if {$labname == "AttributeList"} {
|
||||||
|
|
||||||
|
# Attribute List
|
||||||
|
# --------------
|
||||||
|
|
||||||
|
#set modified [lindex $tmplist 1]
|
||||||
|
|
||||||
|
# Modified or not?
|
||||||
|
#if {$modified == "Modified"} {
|
||||||
|
# set textname "$textname $modified"
|
||||||
|
## set locstyle $DFTREE_AttributeStyle1
|
||||||
|
#} else {
|
||||||
|
## set locstyle $DFTREE_AttributeStyle
|
||||||
|
#}
|
||||||
|
|
||||||
|
#set df_new [$df_tree insert $df_node end \
|
||||||
|
# -text $textname \
|
||||||
|
# -image $DFTREE_GLOBALS(ImageAttrList) \
|
||||||
|
# -tags AttributeList]
|
||||||
|
|
||||||
|
#$df_tree item $df_new -open true
|
||||||
|
|
||||||
|
DFTREE:Tree:UpdateAttributeList $DDF_Browser $df_tree $df_node $df_entry
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
# Sub-label(s)
|
||||||
|
# ------------
|
||||||
|
|
||||||
|
set name [lindex $tmplist 1]
|
||||||
|
set modified [lindex $tmplist 2]
|
||||||
|
set maybeopen [lindex $tmplist 3]
|
||||||
|
|
||||||
|
# Name?
|
||||||
|
set ll [expr [string length $name] -2]
|
||||||
|
if {$ll > 0} {
|
||||||
|
set textname "$textname [string range $name 1 $ll]"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Modified or not?
|
||||||
|
if {$modified == "Modified"} {
|
||||||
|
set textname "$textname $modified"
|
||||||
|
}
|
||||||
|
|
||||||
|
set df_new [$df_tree insert $df_node end \
|
||||||
|
-text $textname \
|
||||||
|
-image $DFTREE_GLOBALS(ImageLabel) \
|
||||||
|
-values $labname \
|
||||||
|
-tags Label]
|
||||||
|
|
||||||
|
if {$maybeopen == "1"} {
|
||||||
|
$df_tree item $df_new -open true
|
||||||
|
}
|
||||||
|
|
||||||
|
DFTREE:Tree:UpdateLabel $DDF_Browser $df_tree $df_new $labname
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
#
|
||||||
|
proc DFGetAttributeValue { DDF_Browser lab index } {
|
||||||
|
|
||||||
|
global $DDF_Browser; # necessary for DRAW command to see the browser
|
||||||
|
|
||||||
|
if {[catch "XAttributeValue $DDF_Browser $lab $index" ret]} {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
if {"$ret" == ""} { return "" }
|
||||||
|
return "\[$ret\]"
|
||||||
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
#
|
||||||
|
proc DFOpenImage { img } {
|
||||||
|
|
||||||
|
global env
|
||||||
|
|
||||||
|
if {[catch "image create photo -file $env(DRAWHOME)/$img" ret]} {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return $ret
|
||||||
|
}
|
@ -1,541 +0,0 @@
|
|||||||
###########################
|
|
||||||
# #
|
|
||||||
# Version 1.3 #
|
|
||||||
# by FID & YAN #
|
|
||||||
# #
|
|
||||||
###########################
|
|
||||||
#
|
|
||||||
# Open : double-clic or +
|
|
||||||
# Close : double-clic or -
|
|
||||||
# Refresh tree : close top level and re-open
|
|
||||||
#
|
|
||||||
# Attributes:
|
|
||||||
# white : interoperable
|
|
||||||
# white + c : non interoperable
|
|
||||||
# X : X Reference
|
|
||||||
# Red : not yet commited in transaction #0
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
proc __update { args } {
|
|
||||||
}
|
|
||||||
|
|
||||||
proc dftree { DDF_Browser } {
|
|
||||||
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global DFTREE_LabelStyle
|
|
||||||
global DFTREE_LabelStyle1
|
|
||||||
global DFTREE_AttributeStyle
|
|
||||||
global DFTREE_AttributeStyle1
|
|
||||||
global DFTREE_AttributeStyle2
|
|
||||||
|
|
||||||
global $DDF_Browser
|
|
||||||
## global $DDF_Browser
|
|
||||||
puts $DDF_Browser
|
|
||||||
|
|
||||||
package require Tix
|
|
||||||
#tixPref:InitFontSet:14Point
|
|
||||||
|
|
||||||
set DFTREE_LabelStyle [tixDisplayStyle imagetext \
|
|
||||||
-font 9x15bold \
|
|
||||||
-background Bisque3 \
|
|
||||||
]
|
|
||||||
|
|
||||||
set DFTREE_LabelStyle1 [tixDisplayStyle imagetext \
|
|
||||||
-font 9x15bold \
|
|
||||||
-background Bisque3 \
|
|
||||||
-foreground SeaGreen2 \
|
|
||||||
]
|
|
||||||
|
|
||||||
set DFTREE_AttributeStyle [tixDisplayStyle imagetext \
|
|
||||||
-font 9x15 \
|
|
||||||
-background Bisque3 \
|
|
||||||
]
|
|
||||||
|
|
||||||
set DFTREE_AttributeStyle1 [tixDisplayStyle imagetext \
|
|
||||||
-font 9x15 \
|
|
||||||
-background Bisque3 \
|
|
||||||
-foreground DarkGreen \
|
|
||||||
]
|
|
||||||
|
|
||||||
set DFTREE_AttributeStyle2 [tixDisplayStyle imagetext \
|
|
||||||
-font 9x15 \
|
|
||||||
-background Bisque3 \
|
|
||||||
-foreground Red \
|
|
||||||
]
|
|
||||||
|
|
||||||
set w .$DDF_Browser
|
|
||||||
toplevel $w
|
|
||||||
|
|
||||||
set top [frame $w.thu -bd 1 -relief raised -background Bisque3]
|
|
||||||
|
|
||||||
################
|
|
||||||
# Paned Window #
|
|
||||||
################
|
|
||||||
set p [tixPanedWindow $top.p -orient horizontal -height 400 -width 700]
|
|
||||||
pack $p -expand yes -fill both -padx 4 -pady 4
|
|
||||||
|
|
||||||
DFTREE:Tree:InitTreePanel $DDF_Browser $w $p
|
|
||||||
# DFTREE:Tree:InitTextPanel $DDF_Browser $w $p
|
|
||||||
|
|
||||||
tixForm $top -left 2 -top 2 -right %99 -bottom %99
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:InitTreePanel { DDF_Browser w p } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
|
|
||||||
########
|
|
||||||
# Tree #
|
|
||||||
########
|
|
||||||
|
|
||||||
set p1 [$p add pane1 -expand 1 -size 700] ; $p1 config -relief flat
|
|
||||||
set tree [tixTree $p1.tree \
|
|
||||||
-opencmd [list DFTREE:Tree:Open $DDF_Browser $w] \
|
|
||||||
-options { \
|
|
||||||
hlist.separator "^" \
|
|
||||||
hlist.font 9x15bold \
|
|
||||||
hlist.background Bisque3 \
|
|
||||||
hlist.foreground Black \
|
|
||||||
} ]
|
|
||||||
pack $p1.tree -expand yes -fill both -padx 4 -pady 4
|
|
||||||
|
|
||||||
# -browsecmd DFTREE:Tree:BrowseCmd
|
|
||||||
# Cette option peut etre ajoutee a la commande tixTree,
|
|
||||||
# mais elle declanche l'appel a la procedure a chaque clic ,
|
|
||||||
# double-clic, voire a chaque appui puis relachement de souris!!!
|
|
||||||
|
|
||||||
# to see different fonts: /usr/openwin/lib/X11/fonts/misc or xlsfonts?
|
|
||||||
# 8x13 8x13bold 9x15 9x15bold
|
|
||||||
# hlist.font 8x13bold
|
|
||||||
# hlist.gap "15"
|
|
||||||
# hlist.indent "30"
|
|
||||||
|
|
||||||
set DFTREE_WINDOWS($w,NAV,tree) $tree
|
|
||||||
set DFTREE_WINDOWS($w,NAV,hlist) [$tree subwidget hlist]
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) add ^ \
|
|
||||||
-text $DDF_Browser \
|
|
||||||
-data [list $DDF_Browser DataFramework]
|
|
||||||
$DFTREE_WINDOWS($w,NAV,tree) setmode ^ open
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:InitTextPanel { DDF_Browser w p } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
|
|
||||||
########
|
|
||||||
# Text #
|
|
||||||
########
|
|
||||||
set p2 [$p add pane2 -expand 4 -size 400] ; $p2 config -relief flat
|
|
||||||
tixScrolledText $p2.st
|
|
||||||
pack $p2.st -expand yes -fill both -padx 4 -pady 4
|
|
||||||
|
|
||||||
set DFTREE_WINDOWS($w,NAV,text) [$p2.st subwidget text]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$DFTREE_WINDOWS($w,NAV,text) insert end " Welcome to the QDF browser (Rev #.#)\n"
|
|
||||||
$DFTREE_WINDOWS($w,NAV,text) insert end "--------------------------------------\n\n"
|
|
||||||
$DFTREE_WINDOWS($w,NAV,text) insert end "This browser is an easy to use prototype made with Tix technology. We hope it will be usefull for understanding and debugging QDF.\n"
|
|
||||||
$DFTREE_WINDOWS($w,NAV,text) insert end "\t\t\t\tFID & YAN"
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:BrowseCmd { dir } {
|
|
||||||
puts "Hello $dir !"
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# Se positionne sur l'entry pere et update les fenetres.
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:Up { w } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global DFTREE_GLOBALS
|
|
||||||
#puts "DFTREE:Tree:Up"
|
|
||||||
|
|
||||||
if { [set here [$DFTREE_WINDOWS($w,NAV,hlist) info anchor]] != {} } {
|
|
||||||
if { [set up [$DFTREE_WINDOWS($w,NAV,hlist) info parent $here]] != {} } {
|
|
||||||
DFTREE:Tree:ShowUp $w $up
|
|
||||||
set DFTREE_GLOBALS(CWD) [lindex [$DFTREE_WINDOWS($w,NAV,hlist) info data $up] 0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# Se positionne sur l'entry up sans update (History)
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:ShowUp { w dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
#puts "DFTREE:Tree:ShowUp"
|
|
||||||
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) anchor clear
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) anchor set $dir
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) selection clear
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) selection set $dir
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) see $dir
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:Open { DDF_Browser w dir} {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
#puts "DFTREE:Tree:Open"
|
|
||||||
|
|
||||||
if {$dir == "^"} {
|
|
||||||
# This is root
|
|
||||||
if {[$DFTREE_WINDOWS($w,NAV,hlist) info children $dir] != {}} {
|
|
||||||
# The root branch already exists in hlist.
|
|
||||||
# Clear all its children to force the tree to be updated.
|
|
||||||
foreach kid [$DFTREE_WINDOWS($w,NAV,hlist) info children $dir] {
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) delete entry $kid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if {[$DFTREE_WINDOWS($w,NAV,hlist) info children $dir] != {}} {
|
|
||||||
# The branch exists in hlist.
|
|
||||||
foreach kid [$DFTREE_WINDOWS($w,NAV,hlist) info children $dir] {
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) show entry $kid
|
|
||||||
}
|
|
||||||
set data [$DFTREE_WINDOWS($w,NAV,hlist) info data $dir]
|
|
||||||
set loc [lindex $data 0]
|
|
||||||
} else {
|
|
||||||
# The branch is unknown.
|
|
||||||
tixBusy $w on
|
|
||||||
update
|
|
||||||
DFTREE:Tree:Fill $DDF_Browser $w $dir
|
|
||||||
tixBusy $w off
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:Fill { DDF_Browser w dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global DFTREE_GLOBALS
|
|
||||||
global $DDF_Browser
|
|
||||||
#puts "DFTREE:Tree:Fill"
|
|
||||||
|
|
||||||
set data [$DFTREE_WINDOWS($w,NAV,hlist) info data $dir]
|
|
||||||
set loc [lindex $data 0]
|
|
||||||
set type [lindex $data 1]
|
|
||||||
|
|
||||||
#puts "====================="
|
|
||||||
#puts "Type $type"
|
|
||||||
#puts "Window $w"
|
|
||||||
#puts "Loc $loc"
|
|
||||||
#puts "Dir $dir"
|
|
||||||
switch -glob $type {
|
|
||||||
|
|
||||||
DataFramework {
|
|
||||||
DFTREE:Tree:UpdateDataFramework $DDF_Browser $w $loc $dir
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
DFTREE:Tree:UpdateLabel $DDF_Browser $w $loc $dir
|
|
||||||
}
|
|
||||||
|
|
||||||
AttributeList {
|
|
||||||
set lab [lindex $data 2]
|
|
||||||
DFTREE:Tree:UpdateAttributeList $DDF_Browser $w $loc $dir $lab
|
|
||||||
}
|
|
||||||
|
|
||||||
Attribute {
|
|
||||||
DFTREE:Tree:UpdateAttribute $DDF_Browser $w $loc $dir
|
|
||||||
}
|
|
||||||
|
|
||||||
terminal {
|
|
||||||
DFTREE:Tree:terminal $DDF_Browser $w $loc $dir
|
|
||||||
}
|
|
||||||
|
|
||||||
default {
|
|
||||||
puts "type non reconnu"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# ici dir = ^
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:UpdateDataFramework { DDF_Browser w loc dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
global DFTREE_LabelStyle
|
|
||||||
global DFTREE_LabelStyle1
|
|
||||||
|
|
||||||
set litm {}
|
|
||||||
|
|
||||||
foreach fullname [split [DFOpenLabel $DDF_Browser ""] "\\" ] {
|
|
||||||
FCTREE:Tree:DecodeLabelItem $DDF_Browser $w $loc $dir $fullname
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# $loc is a label entry, "1.3.2" for exemple.
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:UpdateLabel { DDF_Browser w loc dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
global DFTREE_LabelStyle
|
|
||||||
global DFTREE_LabelStyle1
|
|
||||||
global DFTREE_AttributeStyle
|
|
||||||
global DFTREE_AttributeStyle1
|
|
||||||
|
|
||||||
set litm {}
|
|
||||||
foreach fullname [split [DFOpenLabel $DDF_Browser $loc ] "\\" ] {
|
|
||||||
FCTREE:Tree:DecodeLabelItem $DDF_Browser $w $loc $dir $fullname
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:UpdateAttributeList { DDF_Browser w loc dir lab} {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
global DFTREE_AttributeStyle
|
|
||||||
global DFTREE_AttributeStyle1
|
|
||||||
|
|
||||||
set litm {}
|
|
||||||
set standardimage [tix getimage srcfile]
|
|
||||||
set otherimage [tix getimage file]
|
|
||||||
set xrefimage [tix getimage cross]
|
|
||||||
|
|
||||||
# abv: index attributes
|
|
||||||
set num 0
|
|
||||||
set attributes [split [DFOpenAttributeList $DDF_Browser $lab ] "\\" ]
|
|
||||||
set iattributes {}
|
|
||||||
foreach fullname $attributes {
|
|
||||||
set num [expr $num + 1]
|
|
||||||
lappend fullname $num
|
|
||||||
lappend iattributes $fullname
|
|
||||||
}
|
|
||||||
foreach fullname [lsort $iattributes] {
|
|
||||||
|
|
||||||
# Information first split
|
|
||||||
set tmplist [split $fullname " "]
|
|
||||||
set name [lindex $tmplist 0]
|
|
||||||
set transaction [lindex $tmplist 1]
|
|
||||||
set valid [lindex $tmplist 2]
|
|
||||||
set forgotten [lindex $tmplist 3]
|
|
||||||
set backuped [lindex $tmplist 4]
|
|
||||||
set maybeopen [lindex $tmplist 5]
|
|
||||||
|
|
||||||
# Package analysis to determine the icon type.
|
|
||||||
set pk [lindex [split $name _] 0]
|
|
||||||
set image $otherimage
|
|
||||||
if {$pk == "TDataStd" || $pk == "TNaming"} {set image $standardimage}
|
|
||||||
if {$pk == "TXRef"} {set image $xrefimage}
|
|
||||||
|
|
||||||
# Name analysis to suppress the map address.
|
|
||||||
set shortlist [split $name "#"]
|
|
||||||
set shortname [lindex $shortlist 0]
|
|
||||||
set index [lindex $shortlist 1]
|
|
||||||
|
|
||||||
set textname "$shortname"
|
|
||||||
|
|
||||||
# if { [llength $tmplist] >5 } { set textname [lindex $tmplist 5] }
|
|
||||||
set textname "$textname [DFGetAttributeValue $DDF_Browser $lab [lindex $tmplist 6]]"
|
|
||||||
|
|
||||||
# Transaction analysis
|
|
||||||
if {$transaction == "0"} {
|
|
||||||
set locstyle $DFTREE_AttributeStyle
|
|
||||||
} else {
|
|
||||||
# set textname "$textname T=$transaction"
|
|
||||||
set locstyle $DFTREE_AttributeStyle1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Valid?
|
|
||||||
if {$valid == "NotValid"} {set textname "$textname $valid"}
|
|
||||||
|
|
||||||
# Forgotten?
|
|
||||||
if {$forgotten == "Forgotten"} {set textname "$textname $forgotten"}
|
|
||||||
|
|
||||||
# Backuped?
|
|
||||||
if {$backuped == "Backuped"} {set textname "$textname $backuped"}
|
|
||||||
|
|
||||||
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) add ${dir}^${name} \
|
|
||||||
-itemtype imagetext \
|
|
||||||
-text $textname \
|
|
||||||
-image $image \
|
|
||||||
-style $locstyle \
|
|
||||||
-data [list ${index} Attribute]
|
|
||||||
if {$maybeopen == "1"} {
|
|
||||||
$DFTREE_WINDOWS($w,NAV,tree) setmode ${dir}^${name} open
|
|
||||||
}
|
|
||||||
lappend litm [list $name $image]
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# $loc is always the attribute index
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:UpdateAttribute { DDF_Browser w loc dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
global DFTREE_AttributeStyle
|
|
||||||
global DFTREE_AttributeStyle1
|
|
||||||
global DFTREE_AttributeStyle2
|
|
||||||
|
|
||||||
set litm {}
|
|
||||||
set image [tix getimage minimize]
|
|
||||||
set tmplist [split [DFOpenAttribute $DDF_Browser $loc ] "\\"]
|
|
||||||
|
|
||||||
# Failed or not?
|
|
||||||
if {[lindex $tmplist 0] == "Failed"} {
|
|
||||||
set locstyle $DFTREE_AttributeStyle2
|
|
||||||
} else {
|
|
||||||
set locstyle $DFTREE_AttributeStyle
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach name $tmplist {
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) add ${dir}^${name} \
|
|
||||||
-itemtype imagetext \
|
|
||||||
-text $name \
|
|
||||||
-image $image \
|
|
||||||
-style $locstyle \
|
|
||||||
-data [list ${loc}:${name} terminal] \
|
|
||||||
-state disabled
|
|
||||||
#$DFTREE_WINDOWS($w,NAV,tree) setmode ${dir}^${name} open
|
|
||||||
lappend litm [list $name $image]
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# item:
|
|
||||||
# "Entry Name=LeNomSIlExiste Modified|NotModified 0|1"
|
|
||||||
proc FCTREE:Tree:DecodeLabelItem { DDF_Browser w loc dir labelItem} {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
global DFTREE_LabelStyle
|
|
||||||
global DFTREE_LabelStyle1
|
|
||||||
global DFTREE_AttributeStyle
|
|
||||||
global DFTREE_AttributeStyle1
|
|
||||||
|
|
||||||
set image [tix getimage folder]
|
|
||||||
|
|
||||||
set tmplist [split $labelItem " " ]
|
|
||||||
set labentry [lindex $tmplist 0]
|
|
||||||
set name [lindex $tmplist 1]
|
|
||||||
set modified [lindex $tmplist 2]
|
|
||||||
set maybeopen [lindex $tmplist 3]
|
|
||||||
|
|
||||||
set textname "$labentry"
|
|
||||||
|
|
||||||
if {$labentry == "AttributeList"} {
|
|
||||||
# Attribute List
|
|
||||||
# --------------
|
|
||||||
|
|
||||||
set modified [lindex $tmplist 1]
|
|
||||||
|
|
||||||
# Modified or not?
|
|
||||||
if {$modified == "Modified"} {
|
|
||||||
set textname "$textname $modified"
|
|
||||||
set locstyle $DFTREE_AttributeStyle1
|
|
||||||
} else {
|
|
||||||
set locstyle $DFTREE_AttributeStyle
|
|
||||||
}
|
|
||||||
|
|
||||||
set image [tix getimage textfile]
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) add ${dir}^$labentry \
|
|
||||||
-itemtype imagetext \
|
|
||||||
-text $textname \
|
|
||||||
-image $image \
|
|
||||||
-style $locstyle \
|
|
||||||
-data [list $labentry AttributeList $loc]
|
|
||||||
$DFTREE_WINDOWS($w,NAV,tree) setmode ${dir}^$labentry open
|
|
||||||
lappend litm [list $labentry $image]
|
|
||||||
set image [tix getimage folder]
|
|
||||||
|
|
||||||
} else {
|
|
||||||
# Sub-label(s)
|
|
||||||
# ------------
|
|
||||||
|
|
||||||
# Name?
|
|
||||||
set ll [expr [string length $name] -2]
|
|
||||||
if {$ll > 0} {
|
|
||||||
set textname "$textname [string range $name 1 $ll]"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Modified or not?
|
|
||||||
if {$modified == "Modified"} {
|
|
||||||
set textname "$textname $modified"
|
|
||||||
set locstyle $DFTREE_LabelStyle1
|
|
||||||
} else {
|
|
||||||
set locstyle $DFTREE_LabelStyle
|
|
||||||
}
|
|
||||||
|
|
||||||
$DFTREE_WINDOWS($w,NAV,hlist) add ${dir}^$labentry \
|
|
||||||
-itemtype imagetext \
|
|
||||||
-text $textname \
|
|
||||||
-image $image \
|
|
||||||
-style $locstyle \
|
|
||||||
-data [list $labentry Label]
|
|
||||||
if {$maybeopen == "1"} {
|
|
||||||
$DFTREE_WINDOWS($w,NAV,tree) setmode ${dir}^$labentry open
|
|
||||||
}
|
|
||||||
lappend litm [list $labentry $image]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:terminal { DDF_Browser w loc dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# loc est une adresse de label?
|
|
||||||
#
|
|
||||||
proc DFTREE:Tree:DisplayAttribute { DDF_Browser w loc dir } {
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
global $DDF_Browser
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
###############################################################################
|
|
||||||
# imprime tout ce qu'il y a dans hli ( Hlist )
|
|
||||||
#
|
|
||||||
proc wokDBG { {root {}} } {
|
|
||||||
global DFTREE_GLOBALS
|
|
||||||
global DFTREE_WINDOWS
|
|
||||||
set w $DFTREE_GLOBALS(toplevel)
|
|
||||||
set hli $DFTREE_WINDOWS($w,NAV,hlist)
|
|
||||||
foreach c [$hli info children $root] {
|
|
||||||
puts "$c : data <[$hli info data $c]>"
|
|
||||||
wokDBG $c
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
proc DFGetAttributeValue {browser lab index} {
|
|
||||||
global $browser; # necessary for DRAW command to see the browser
|
|
||||||
#puts "$lab $index"
|
|
||||||
# set names [split $dir ^]
|
|
||||||
# set len [expr [llength $names] -1]
|
|
||||||
# set lab [lindex $names [expr $len - 2]]
|
|
||||||
# set num [lindex $names $len]
|
|
||||||
# regexp {browser_(.*)} $browser whole doc
|
|
||||||
# XSAttributeValue browser_D a b
|
|
||||||
if {[catch "XAttributeValue $browser $lab $index" ret]} {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
if {"$ret" == ""} { return "" }
|
|
||||||
return "\[$ret\]"
|
|
||||||
}
|
|
||||||
|
|
@ -28,14 +28,19 @@
|
|||||||
#include <TDF_Data.hxx>
|
#include <TDF_Data.hxx>
|
||||||
#include <TDF_LabelSequence.hxx>
|
#include <TDF_LabelSequence.hxx>
|
||||||
#include <TDF_AttributeIterator.hxx>
|
#include <TDF_AttributeIterator.hxx>
|
||||||
|
#include <TDF_Reference.hxx>
|
||||||
#include <TDocStd_Document.hxx>
|
#include <TDocStd_Document.hxx>
|
||||||
#include <TDataStd_UAttribute.hxx>
|
#include <TDataStd_UAttribute.hxx>
|
||||||
#include <TDataStd_TreeNode.hxx>
|
#include <TDataStd_TreeNode.hxx>
|
||||||
#include <TDataStd_Integer.hxx>
|
#include <TDataStd_Integer.hxx>
|
||||||
#include <TDataStd_Real.hxx>
|
#include <TDataStd_Real.hxx>
|
||||||
#include <TDataStd_Name.hxx>
|
#include <TDataStd_Name.hxx>
|
||||||
|
#include <TDataStd_Comment.hxx>
|
||||||
|
#include <TDataStd_AsciiString.hxx>
|
||||||
#include <TNaming_NamedShape.hxx>
|
#include <TNaming_NamedShape.hxx>
|
||||||
|
#include <TDataStd_IntegerArray.hxx>
|
||||||
#include <TDataStd_RealArray.hxx>
|
#include <TDataStd_RealArray.hxx>
|
||||||
|
#include <TDataStd_ByteArray.hxx>
|
||||||
#include <TPrsStd_AISPresentation.hxx>
|
#include <TPrsStd_AISPresentation.hxx>
|
||||||
#include <TPrsStd_NamedShapeDriver.hxx>
|
#include <TPrsStd_NamedShapeDriver.hxx>
|
||||||
#include <TPrsStd_AISViewer.hxx>
|
#include <TPrsStd_AISViewer.hxx>
|
||||||
@ -527,7 +532,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
|
|
||||||
const Handle(TDF_Attribute)& att = itr.Value();
|
const Handle(TDF_Attribute)& att = itr.Value();
|
||||||
if ( att->IsKind(STANDARD_TYPE(TDataStd_TreeNode)) ) {
|
if ( att->IsKind(STANDARD_TYPE(TDataStd_TreeNode)) ) {
|
||||||
Standard_CString type;
|
Standard_CString type = "";
|
||||||
if ( att->ID() == XCAFDoc::ShapeRefGUID() ) type = "Shape Instance Link";
|
if ( att->ID() == XCAFDoc::ShapeRefGUID() ) type = "Shape Instance Link";
|
||||||
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorGen) ) type = "Generic Color Link";
|
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorGen) ) type = "Generic Color Link";
|
||||||
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorSurf) ) type = "Surface Color Link";
|
else if ( att->ID() == XCAFDoc::ColorRefGUID(XCAFDoc_ColorSurf) ) type = "Surface Color Link";
|
||||||
@ -535,7 +540,6 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
else if ( att->ID() == XCAFDoc::DimTolRefGUID() ) type = "DGT Link";
|
else if ( att->ID() == XCAFDoc::DimTolRefGUID() ) type = "DGT Link";
|
||||||
else if ( att->ID() == XCAFDoc::DatumRefGUID() ) type = "Datum Link";
|
else if ( att->ID() == XCAFDoc::DatumRefGUID() ) type = "Datum Link";
|
||||||
else if ( att->ID() == XCAFDoc::MaterialRefGUID() ) type = "Material Link";
|
else if ( att->ID() == XCAFDoc::MaterialRefGUID() ) type = "Material Link";
|
||||||
else return 0;
|
|
||||||
Handle(TDataStd_TreeNode) TN = Handle(TDataStd_TreeNode)::DownCast(att);
|
Handle(TDataStd_TreeNode) TN = Handle(TDataStd_TreeNode)::DownCast(att);
|
||||||
TCollection_AsciiString ref;
|
TCollection_AsciiString ref;
|
||||||
if ( TN->HasFather() ) {
|
if ( TN->HasFather() ) {
|
||||||
@ -554,6 +558,12 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
di << ")";
|
di << ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDF_Reference)) ) {
|
||||||
|
Handle(TDF_Reference) val = Handle(TDF_Reference)::DownCast ( att );
|
||||||
|
TCollection_AsciiString ref;
|
||||||
|
TDF_Tool::Entry ( val->Get(), ref );
|
||||||
|
di << "==> " << ref.ToCString();
|
||||||
|
}
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Integer)) ) {
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Integer)) ) {
|
||||||
Handle(TDataStd_Integer) val = Handle(TDataStd_Integer)::DownCast ( att );
|
Handle(TDataStd_Integer) val = Handle(TDataStd_Integer)::DownCast ( att );
|
||||||
TCollection_AsciiString str ( val->Get() );
|
TCollection_AsciiString str ( val->Get() );
|
||||||
@ -564,6 +574,51 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
TCollection_AsciiString str ( val->Get() );
|
TCollection_AsciiString str ( val->Get() );
|
||||||
di << str.ToCString();
|
di << str.ToCString();
|
||||||
}
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Name)) ) {
|
||||||
|
Handle(TDataStd_Name) val = Handle(TDataStd_Name)::DownCast ( att );
|
||||||
|
TCollection_AsciiString str ( val->Get(), '?' );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Comment)) ) {
|
||||||
|
Handle(TDataStd_Comment) val = Handle(TDataStd_Comment)::DownCast ( att );
|
||||||
|
TCollection_AsciiString str ( val->Get(), '?' );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_AsciiString)) ) {
|
||||||
|
Handle(TDataStd_AsciiString) val = Handle(TDataStd_AsciiString)::DownCast ( att );
|
||||||
|
TCollection_AsciiString str ( val->Get(), '?' );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_IntegerArray)) ) {
|
||||||
|
Handle(TDataStd_IntegerArray) val = Handle(TDataStd_IntegerArray)::DownCast ( att );
|
||||||
|
for ( Standard_Integer j=val->Lower(); j <= val->Upper(); j++ ) {
|
||||||
|
if ( j > val->Lower() ) di << ", ";
|
||||||
|
TCollection_AsciiString str ( val->Value(j) );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_RealArray)) ) {
|
||||||
|
Handle(TDataStd_RealArray) val = Handle(TDataStd_RealArray)::DownCast ( att );
|
||||||
|
for ( Standard_Integer j=val->Lower(); j <= val->Upper(); j++ ) {
|
||||||
|
if ( j > val->Lower() ) di << ", ";
|
||||||
|
TCollection_AsciiString str ( val->Value(j) );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_ByteArray)) ) {
|
||||||
|
Handle(TDataStd_ByteArray) val = Handle(TDataStd_ByteArray)::DownCast ( att );
|
||||||
|
for ( Standard_Integer j=val->Lower(); j <= val->Upper(); j++ ) {
|
||||||
|
if ( j > val->Lower() ) di << ", ";
|
||||||
|
TCollection_AsciiString str ( val->Value(j) );
|
||||||
|
di << str.ToCString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( att->IsKind(STANDARD_TYPE(TNaming_NamedShape)) ) {
|
||||||
|
Handle(TNaming_NamedShape) val = Handle(TNaming_NamedShape)::DownCast ( att );
|
||||||
|
TopoDS_Shape S = val->Get();
|
||||||
|
di << S.TShape()->DynamicType()->Name();
|
||||||
|
if ( ! S.Location().IsIdentity() ) di << "(located)";
|
||||||
|
}
|
||||||
else if ( att->IsKind(STANDARD_TYPE(XCAFDoc_Volume)) ) {
|
else if ( att->IsKind(STANDARD_TYPE(XCAFDoc_Volume)) ) {
|
||||||
Handle(XCAFDoc_Volume) val = Handle(XCAFDoc_Volume)::DownCast ( att );
|
Handle(XCAFDoc_Volume) val = Handle(XCAFDoc_Volume)::DownCast ( att );
|
||||||
TCollection_AsciiString str ( val->Get() );
|
TCollection_AsciiString str ( val->Get() );
|
||||||
@ -585,25 +640,6 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
|
|||||||
di << myCentroid.Z();
|
di << myCentroid.Z();
|
||||||
di << ")";
|
di << ")";
|
||||||
}
|
}
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TDataStd_Name)) ) {
|
|
||||||
Handle(TDataStd_Name) val = Handle(TDataStd_Name)::DownCast ( att );
|
|
||||||
TCollection_AsciiString str ( val->Get(), '?' );
|
|
||||||
di << str.ToCString();
|
|
||||||
}
|
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TDataStd_RealArray)) ) {
|
|
||||||
Handle(TDataStd_RealArray) val = Handle(TDataStd_RealArray)::DownCast ( att );
|
|
||||||
for ( Standard_Integer j=val->Lower(); j <= val->Upper(); j++ ) {
|
|
||||||
if ( j > val->Lower() ) di << ", ";
|
|
||||||
TCollection_AsciiString str ( val->Value(j) );
|
|
||||||
di << str.ToCString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TNaming_NamedShape)) ) {
|
|
||||||
Handle(TNaming_NamedShape) val = Handle(TNaming_NamedShape)::DownCast ( att );
|
|
||||||
TopoDS_Shape S = val->Get();
|
|
||||||
di << S.TShape()->DynamicType()->Name();
|
|
||||||
if ( ! S.Location().IsIdentity() ) di << "(located)";
|
|
||||||
}
|
|
||||||
else if ( att->IsKind(STANDARD_TYPE(TDataStd_UAttribute)) ) {
|
else if ( att->IsKind(STANDARD_TYPE(TDataStd_UAttribute)) ) {
|
||||||
if ( att->ID() == XCAFDoc::AssemblyGUID() ) di << "is assembly";
|
if ( att->ID() == XCAFDoc::AssemblyGUID() ) di << "is assembly";
|
||||||
if ( att->ID() == XCAFDoc::InvisibleGUID() ) di << "invisible";
|
if ( att->ID() == XCAFDoc::InvisibleGUID() ) di << "invisible";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user