}
}
-GeometryGUI::TextureMap GeometryGUI::myTextureMap;
-
GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil();
GEOM::GEOM_Gen_var GeometryGUI::GetGeomGen()
Handle(TColStd_HArray1OfByte) GeometryGUI::getTexture (int theId, int& theWidth, int& theHeight)
{
theWidth = theHeight = 0;
-
Handle(TColStd_HArray1OfByte) aTexture;
- aTexture = myTextureMap[ theId ];
- if ( aTexture.IsNull() ) {
- GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations();
- if ( !aInsOp->_is_nil() ) {
- CORBA::Long aWidth, aHeight;
- SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
- if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
- theWidth = aWidth;
- theHeight = aHeight;
-
- aTexture = new TColStd_HArray1OfByte (1, aStream->length());
-
- for ( CORBA::ULong i = 0; i < aStream->length(); i++)
- aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
- myTextureMap[ theId ] = aTexture;
- }
+ GEOM::GEOM_IInsertOperations_var aInsOp = GeometryGUI::GetGeomGen()->GetIInsertOperations();
+ if ( !aInsOp->_is_nil() ) {
+ CORBA::Long aWidth, aHeight;
+ SALOMEDS::TMPFile_var aStream = aInsOp->GetTexture( theId, aWidth, aHeight );
+ if ( aWidth > 0 && aHeight > 0 && aStream->length() > 0 ) {
+ theWidth = aWidth;
+ theHeight = aHeight;
+
+ aTexture = new TColStd_HArray1OfByte (1, aStream->length());
+
+ for ( CORBA::ULong i = 0; i < aStream->length(); i++)
+ aTexture->SetValue( i+1, (Standard_Byte)aStream[i] );
}
}
return aTexture;
private:
- typedef QMap<long, Handle(TColStd_HArray1OfByte)> TextureMap;
-
typedef QMap<QString, GEOMGUI*> GUIMap;
typedef QPair<QString, QString> PluginAction;
QDialog* myActiveDialogBox; // active dialog box
gp_Ax3 myWorkingPlane;
//QMap<int,QString> myRules; // popup rules
- static TextureMap myTextureMap; // texture map
QMap<int, PluginAction> myPluginActions; // plugin actions
QMap<QString, QString> myPluginLibs; // plugin name to plugin client library