-This is the version 1.2.1 of KERNEL
+This is the version 1.3.0 of KERNEL
+
+Previous versions :
+ - 1.2.1
@COMMENCE@
-SUBDIRS = idl src salome_adm
+SUBDIRS = idl src examples salome_adm
RESOURCES_FILES = \
back.xpm \
-THIS IS SALOME PRO - KERNEL VERSION: 1.2.1
+THIS IS SALOME - KERNEL VERSION: 1.3.0
#!/bin/sh
-export KERNEL_ROOT_DIR=/Salome2/KERNEL_install
-
-export GEOM_ROOT_DIR=/Salome2/GEOM_install
-export MED_ROOT_DIR=/Salome2/MED_install
-export SMESH_ROOT_DIR=/Salome2/SMESH_install
-export SUPERV_ROOT_DIR=/Salome2/SUPERV_install
-export VISU_ROOT_DIR=/Salome2/VISU_install
-
python -i runSalome.py --gui --modules=GEOM,SMESH,VISU,SUPERV,MED --xterm --containers=python --killall
#python -i runSalome.py --gui --modules=GEOM,SMESH,VISU,SUPERV,MED --logger --xterm
#python -i runSalome.py --modules=GEOM,SMESH,VISU,SUPERV,MED
# Lancement Session Loader
#
- SessionLoader().run()
+ if with_gui:
+ SessionLoader().run()
#
# Initialisation ORB et Naming Service
import SALOME
session=clt.waitNS("/Kernel/Session",SALOME.Session)
-
+
+
theComputer = os.getenv("HOSTNAME")
computerSplitName = theComputer.split('.')
theComputer = computerSplitName[0]
-
+
#
# Lancement Container C++ local
#
clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
- #
- # Lancement Container Supervision local
- #
-
if with_container_superv:
+
+ #
+ # Lancement Container Supervision local
+ #
+
ContainerSUPERVServer().run()
#
#session.GetInterface()
end_time = os.times()
-
+ print
print "Start SALOME, elpased time : %5.1f seconds"% (end_time[4] - init_time[4])
return clt
-
-# -* Makefile *-
+# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+#
#
-# Author : Patrick GOLDBRONN (CEA)
-# Date : 30/11/2001
-# $Header$
#
-# source path
+# File : Makefile.in
+# Author : Patrick GOLDBRONN (CEA)
+# Module : doc
+# $Header$
+
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
<td bgcolor= "lightgreen"><div align="center"><b>void putMessage ( in string message )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>putMessage ( message )</b></div></td>
</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void ping ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>ping ( )</b></div></td>
+</tr>
</table><br>
</b></HTML>
<td bgcolor= "lightgreen"><div align="center"><b>Save ( aStudy, theMultiFile )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SaveASCII ( in Study aStudy, in boolean theMultiFile )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SaveASCII ( aStudy, theMultiFile )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>void SaveAs ( in URL aUrl, in Study aStudy, in boolean theMultiFile )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>SaveAs ( aUrl, aStudy, theMultiFile )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SaveAsASCII ( in URL aUrl, in Study aStudy, in boolean theMultiFile )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SaveAsASCII ( aUrl, aStudy, theMultiFile )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>ListOfOpenStudies GetOpenStudies ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOpenStudies ( )</b></div></td>
</tr>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = Save ( theComponent, theURL, isMultiFile )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>TMPFile SaveASCII ( in SComponent theComponent, in string theURL, in boolean isMultiFile )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = SaveASCII ( theComponent, theURL, isMultiFile )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>boolean Load ( in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = Load ( theComponent, theStream, theURL, isMultiFile )</b></div></td>
</tr>
<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean LoadASCII ( in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = LoadASCII ( theComponent, theStream, theURL, isMultiFile )</b></div></td>
+</tr>
+<tr>
<td bgcolor= "lightgreen"><div align="center"><b>void Close ( in SComponent aSComponent )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>Close ( aSComponent )</b></div></td>
</tr>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = ComponentDataType ( )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>string IORToLocalPersistentID ( in SObject theSObject, in string IORString, in boolean isMultiFile )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = IORToLocalPersistentID ( theSObject, IORString, isMultiFile )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>string IORToLocalPersistentID ( in SObject theSObject, in string IORString, in boolean isMultiFile, in boolean isASCII )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = IORToLocalPersistentID ( theSObject, IORString, isMultiFile, isASCII )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>string LocalPersistentIDToIOR ( in SObject theSObject, in string aLocalPersistentID, in boolean isMultiFile )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = LocalPersistentIDToIOR ( theSObject, aLocalPersistentID, isMultiFile )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>string LocalPersistentIDToIOR ( in SObject theSObject, in string aLocalPersistentID, in boolean isMultiFile, in boolean isASCII )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = LocalPersistentIDToIOR ( theSObject, aLocalPersistentID, isMultiFile, isASCII )</b></div></td>
</tr>
<tr>
<td bgcolor= "lightgreen"><div align="center"><b>boolean CanPublishInStudy ( in Object theIOR )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>boolean Resume_impl ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = Resume_impl ( )</b></div></td>
</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>long CpuUsed_impl ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = CpuUsed_impl ( )</b></div></td>
+</tr>
</table><br>
</b></HTML>
<td bgcolor= "lightgreen"><div align="center"><b>GetInterface ( )</b></div></td>
</tr>
<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>VISU_Gen GetVisuGen ( )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>Component GetVisuGen ( )</b></div></td>
<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetVisuGen ( )</b></div></td>
</tr>
<tr>
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME PRO v.1.2"
+PROJECT_NAME = "SALOME v.1.3.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
OUTPUT_LANGUAGE = English
../../../share/salome/idl/SALOME_Exception.idl \
../../../share/salome/idl/SALOMEDS_Attributes.idl \
../../../share/salome/idl/SALOME_Session.idl \
- ../../../share/salome/idl/SALOME_Component.idl
+ ../../../share/salome/idl/SALOME_Component.idl \
+ ../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx \
+ ../../../share/salome/src/NamingService/SALOME_NamingService.hxx \
+ ../../../share/salome/src/NamingService/SALOME_NamingService.cxx \
+ ../../../share/salome/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
+BINARY_TOC = YES
+TOC_EXPAND = YES
+DISABLE_INDEX = YES
ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
+GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
+++ /dev/null
-H1 { text-align: center; }
-CAPTION { font-weight: bold }
-A.qindex {}
-A.qindexRef {}
-A.el { text-decoration: none; font-weight: bold }
-A.elRef { font-weight: bold }
-A.code { text-decoration: none; font-weight: normal; color: #4444ee }
-A.codeRef { font-weight: normal; color: #4444ee }
-A:hover { text-decoration: none; background-color: lightblue }
-DL.el { margin-left: -1cm }
-DIV.fragment { width: 100%; border: none; background-color: #CCCCCC }
-DIV.ah { background-color: #CCCCCC; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
-TD.md { background-color: lightblue; font-weight: bold; }
-TD.mdname1 { background-color: lightblue; font-weight: bold; color: #602020; }
-TD.mdname { background-color: lightblue; font-weight: bold; color: #602020; width: 600px; }
-DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
-DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
-BODY { background: url(sources/bg_salomepro.gif) }
-TD.indexkey {
- background-color: #CCCCCC;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
-}
-TD.indexvalue {
- background-color: #CCCCCC;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px
-}
-span.keyword { color: #008000 }
-span.keywordtype { color: #604020 }
-span.keywordflow { color: #e08000 }
-span.comment { color: #800000 }
-span.preprocessor { color: #806020 }
-span.stringliteral { color: #002080 }
-span.charliteral { color: #008080 }
top_srcdir=@top_srcdir@
top_builddir=../..
+root_srcdir=@ROOT_SRCDIR@
srcdir=@srcdir@
VPATH=.:@srcdir@
doxygen=@DOXYGEN@
doc:
cp -fr $(srcdir)/INPUT ./; \
cd INPUT; \
- sed 's|../../../share/salome|../$(top_srcdir)|' doxyfile > doxyfile1; \
+ sed 's|../../../share/salome|$(root_srcdir)|' ./doxyfile > ./doxyfile1; \
mv -f doxyfile1 doxyfile; \
$(doxygen) ./doxyfile; \
cd ..; \
- cp -f $(srcdir)/INPUT/sources/doxygen.css ./html/doxygen.css
+ cp -fr $(srcdir)/INPUT/sources/static/*.* ./html/
cp -fr $(srcdir)/INPUT/sources/ html/
cp -fr $(srcdir)/INPUT/exemple/ html/
cp -fr $(srcdir)/INPUT/HTML/ html/
{
//put message into one special place for all servers using Logger
oneway void putMessage (in string message);
+ void ping ();
};
};
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// $Header$
/*! \mainpage
- \image html Application-About.png
-
-*/
-/*! \page page1 Mapping of IDL definitions to Python language.
-\section Intro Introduction
-%SALOME PRO is a distributed client/server application using the Common Object Request Broker Architecture (CORBA).
-CORBA architecture uses the Interface Definition Language (IDL), which specifies interfaces between CORBA objects. So with help of IDL
-CORBA's language independence is ensured . Because interfaces described in IDL can be mapped to the most of currently used programming languages, CORBA applications and components are thus
-independent of the language(s) used to implement them. In other words, a client written in C++ can communicate with a server written in Java, which in turn can communicate with
-another server written in COBOL, and so forth.
-
-One important thing to remember about IDL is that it is not an implementation language. That is, applications can't be written in IDL. The sole purpose of IDL is to define interfaces;
-providing implementations for these interfaces is performed using some other language.
-
-This page contains an abridged reference manual for mapping of IDL definitions to Python language. It will be useful for Python programmers who are not familiar
-with IDL language. All examples are taken from %SALOME PRO source files.
-The complete version of Python Language Mapping Specification can be found <A HREF="http://www.omg.org">here.</A>
-
-<BR><STRONG>CONTENTS:</STRONG>
-- \ref subsection1
-- \ref subsection2
-- \ref subsection3
-- \ref subsection4
-- \ref subsection5
-- \ref subsection6
-- \ref subsection7
-
-\subsection subsection1 Using Scoped Names
-
-Python implements a module concept that is similar to the IDL scoping mechanisms,
-except that it does not allow for nested modules. In addition, Python requires each
-object to be implemented in a module; globally visible objects are not supported.
-
-Because of these constraints, scoped names are translated into Python using the
-following rules:
-
-\95 An IDL module mapped into a Python module. Modules containing modules are
-mapped to packages (i.e., directories with an <STRONG>__init__</STRONG> module containing all
-definitions excluding the nested modules). An implementation can chose to map toplevel
-definitions (including the module CORBA) to modules in an implementationdefined
-package, to allow concurrent installations of different CORBA runtime
-libraries. In that case, the implementation must provide additional modules so that
-toplevel modules can be used without importing them from a package.
-
-\95 For all other scopes, a Python class is introduced that contains all the definitions
-inside this scope.
-
-\95 Other global definitions (except modules) appear in a module whose name is
-implementation dependent. Implementations are encouraged to use the name of the
-IDL file when defining the name of that module.
-
-For instance,
-
-\verbatim
-module SALOMEDS {
- interface StudyManager {
- void Close(in Study aStudy);
- };
-};
-\endverbatim
-
-would introduce a module SALOMEDS.py, which contains the following definitions:
-
-\verbatim
-# module SALOMEDS.py
-class StudyManager:
- def _Close(self,aStudy):
- pass #interfaces are discussed later
-\endverbatim
-
-To avoid conflicts, IDL names that are also Python identifiers are prefixed with an underscore (\91_\92).
-
-\subsection subsection2 Mapping for Template and Array Types
-
-Both the bounded and the unbounded string type of IDL are mapped to the Python
-string type. Wide strings are represented by an implementation-defined type with the
-following properties:
-
-\95 For the wide string X and the integer n, X[n] returns the nth character, which is a
-wide string of length 1.
-
-\95 len(X) returns the number of characters of wide string X.
-
-\95 CORBA.wstr(c) returns a wide character with the code point c in an
-implementation-defined encoding.
-
-\95 X+Y returns the concatenation of wide strings X and Y.
-
-\95 CORBA.word(CORBA.wstr(c)) == c
-
-The sequence template is mapped to sequence objects (e.g., tuples or lists).
-Applications should not assume that values of a sequence type are mutable. Sequences
-and arrays of octets and characters are mapped to the string type for efficiency reasons.
-
-For example, given the IDL definitions
-
-\verbatim
-module SALOMEDS {
- typedef sequence <string> StringSeq;
-
- interface AttributeTableOfInteger : GenericAttribute {
-
- void SetRowTitles(in StringSeq theTitles) raises(IncorrectArgumentLength);
- };
-};
-\endverbatim
-
-a client could invoke the operation
-
-\verbatim
-print My_AttributeTableOfInteger.SetRowTitles(["X","F"])
-\endverbatim
-
-Array types are mapped like sequence templates. The application in this example also expects an
-IncorrectArgumentLength exception if it passes sequences that violate the bounds constraint or
-arrays of wrong size.
-
-Another example with arrays. The following IDL definition
-
-\verbatim
-module SALOMEDS {
- typedef sequence<GenericAttribute> ListOfAttributes;
- interface SObject {
- ListOfAttributes GetAllAttributes();
- };
-};
-\endverbatim
-
-is equal to
-
-\verbatim
-import SALOMEDS
-
-attributes=[]
-
-attributes = My_SObject.GetAllAttributes()
-
-length = len(attributes)
-
-print "Attributes number = ", length
-print attributes
-\endverbatim
-
-\subsection subsection3 Mapping for Objects and Operations
-
-A CORBA object reference is represented as a Python object at run-time. This object
-provides all the operations that are available on the interface of the object. Although
-this specification does not mandate the use of classes for stub objects, the following
-discussion uses classes to indicate the interface.
-
-The nil object is represented by <STRONG>None</STRONG>.
-
-If an operation expects parameters of the IDL Object type, any Python object
-representing an object reference might be passed as actual argument.
-
-If an operation expects a parameter of an abstract interface, either an object
-implementing that interface, or a value supporting this interface may be passed as
-actual argument. The semantics of abstract values then define whether the argument is
-passed by value or by reference.
-
-Operations of an interface map to methods available on the object references.
-Parameters with a parameter attribute of <STRONG>in</STRONG> or <STRONG>inout</STRONG>
-are passed from left to right tothe method, skipping <STRONG>out</STRONG> parameters.
-The return value of a method depends on the number of <STRONG>out</STRONG> parameters
-and the return type. If the operation returns a value, this
-value forms the first <VAR>result value</VAR>. All <STRONG>inout</STRONG> or <STRONG>out</STRONG>
-parameters form consecutive <VAR>result values</VAR>. The method result depends then on the number
-of <VAR>result values</VAR>:
-
-\95 If there is no <VAR>result value</VAR>, the method returns None.
-
-\95 If there is exactly one <VAR>result value</VAR>, it is returned as a single value.
-
-\95 If there is more than one <VAR>result value</VAR>, all of them are packed into a tuple, and this
-tuple is returned.
-
-Assuming the IDL definition
-
-\verbatim
-module SALOMEDS{
- interface StudyBuilder{
- boolean FindAttribute ( in SObject anObject,
- out GenericAttribute anAttribute,
- in string aTypeOfAttribute );
- };
-};
-\endverbatim
-
-a client could write
-
-\verbatim
-from SALOMEDS import StudyBuilder;
-my_StudyBuilder=...
-
- res,A=my_StudyBuilder.FindAttribute(Sobj, "AttributeSequenceOfReal")
-\endverbatim
-
-In this example <STRONG>A</STRONG> corresponds to the return value <STRONG>anAttribute</STRONG> and
-<STRONG>res</STRONG> to the <STRONG>boolean</STRONG> return value.
-
-If an interface defines an <STRONG>attribute name</STRONG>, for example, the attribute is mapped into an
-operation <STRONG>_get_name</STRONG>. If the attribute is not <STRONG>readonly</STRONG>, there is an
-additional operation <STRONG>_set_name</STRONG>.
-
-The IDL definition
-
-\verbatim
-module SALOMEDS{
- interface Study{
- attribute string Name;
- };
-};
-\endverbatim
-
-is equal to the following
-
-\verbatim
-from SALOMEDS import Study
-My_Study=...
- Name=My_Study._get_name();
- Name=My_Study._set_name();
-\endverbatim
-
-\subsection subsection4 Narrowing Object References
-
-Python objects returned from CORBA operations or pseudo-operations (such as
-string_to_object) might have a dynamic type, which is more specific than the
-static type as defined in the operation signature.
-
-Since there is no efficient and reliable way of automatically creating the most specific
-type, explicit narrowing is necessary. To narrow an object reference <STRONG>A</STRONG> to an interface
-class <STRONG>AttributeSequenceOfReal</STRONG>, the client can use the following operation
-
-\verbatim
-A = A._narrow(SALOMEDS.AttributeSequenceOfReal)
-\endverbatim
-
-\subsection subsection5 Mapping for Exceptions
-
-An IDL exception is translated into a Python class derived from
-CORBA.UserException. System exceptions are derived from CORBA.SystemException.
-Both base classes are derived from CORBA.Exception. The parameters of the
-exception are mapped in the same way as the fields of a struct definition. When
-raising an exception, a new instance of the class is created; the constructor
-expects the exception parameters. For example, the definition
-
-\verbatim
-module SALOMEDS{
- interface StudyBuilder{
- exception LockProtection {};
- void CommitCommand() raises(LockProtection);
- };
-};
-\endverbatim
-
-could be used caught as
-
-\verbatim
-from SALOMEDS import StudyBuilder;
-my_StudyBuilder=...
-try:
- my_StudyBuilder.CommitCommand();
-except StudyBuilder.LockProtection,value:
- print "Error! Study is locked for modifications"
-\endverbatim
-
-
-\subsection subsection6 Mapping for Enumeration Types
-
-An enumeration is mapped into a number of constant objects in the name space where
-the enumeration is defined. An application may only test for equivalence of two
-enumeration values, and not assume that they behave like numbers.
-For example, the definition
-
-\verbatim
-module VISU {
- interface PrsObject{
-
- enum PrsObjType{ TCURVE, TTABLE, TMESH, TCONTAINER,
- TSCALARMAP, TISOSURFACE, TDEFORMEDSHAPE,
- TCUTPLANES, TVECTORS };
- };
-};
-\endverbatim
-
-introduces the objects
-
-\verbatim
-from VISU import PrsObject
-VISU.PrsObjType.TCURVE,VISU.PrsObjType.TTABLE,VISU.PrsObjType.TMESH,VISU.PrsObjType.TCONTAINER,
-VISU.PrsObjType.TSCALARMAP,VISU.PrsObjType.TISOSURFACE,VISU.PrsObjType.TDEFORMEDSHAPE,VISU.PrsObjType.TCUTPLANES,
-VISU.PrsObjType.TVECTORS
-\endverbatim
-
-\subsection subsection7 Mapping for Structured Types
-
-An IDL struct definition is mapped into a Python class or type. For each field in the
-struct, there is a corresponding attribute in the class with the same name as the field.
-The constructor of the class expects the field values, from left to right.
-For example, the IDL definition
-
-\verbatim
-struct SDate {
- short Second;
- short Minute;
- short Hour;
- short Day;
- short Month;
- short Year;
- };
-\endverbatim
-
-could be used in the Python statements
-
-\verbatim
-Date=SDate(30, 12, 15, 26, 1, 79)
-print Date.Second,Date.Minute,Date.Hour,Date.Day,Date.Month,Date.Year
-\endverbatim
-*/
-/*! \page page2 Mapping of SALOME IDL definitions to Python language.
-
-
- - <B>%SALOME STUDY module</B>
- - <A href=HTML/SALOMEDS.html>Mapping of %SALOMEDS functions</A>
- - <A href=HTML/SALOMEDS_Attributes.html>Mapping of SALOMEDS_Attributes functions</A>
- - <B>%SAlOME KERNEL module</B>
- - <A href=HTML/Med_Gen.html>Mapping of %Med_Gen functions</A>
- - <A href=HTML/SALOME_Session.html>Mapping of %SALOME_Session functions</A>
- - <A href=HTML/SALOME_ModuleCatalog.html>Mapping of %SALOME_ModuleCatalog functions</A>
- - <A href=HTML/SALOME_Exception.html>Mapping of %SALOME_Exception functions</A>
- - <A href=HTML/SALOME_Component.html>Mapping of %SALOME_Component functions</A>
- - <B>%SALOME MED component</B>
- - <A href=HTML/MED.html>Mapping of %Med functions</A>
- - <B>%SALOME SUPERVISION module</B>
- - <A href=HTML/SUPERV.html>Mapping of %SUPERV functions</A>
- - <B>%SALOME %VISU module</B>
- - <A href=HTML/VISU_Gen.html>Mapping of %VISU_Gen functions</A>
-
-*/
-
-/*! \defgroup Study SALOME STUDY module
+ \image html Application-About.png
*/
/*!
#include "SALOME_Exception.idl"
-/*! \ingroup Study
+/*!
This package contains the interfaces used for creation, managment
and modification of the %Study
*/
/*! IOR of the study in %SALOME application
*/
typedef string SalomeReference;
-/*! List of names of open studies in a %SALOME session
+
+/*! List of the names of studies which are currently open in this %SALOME session.
+Since %SALOME is a multi-study application, it allows to open a lot of studies
+during each working session.
*/
typedef sequence<string> ListOfOpenStudies;
/*! List of file names
interface UseCaseIterator;
interface UseCaseBuilder;
interface Callback;
+
/*! List of attributes
*/
typedef sequence<GenericAttribute> ListOfAttributes;
-/*! Exception indicating that this feature hasn't been implemented
+
+/*! Exception indicating that this feature hasn't been implemented.
*/
exception NotImplemented {};
*/
typedef sequence<SObject> ListOfSObject;
/*!
- Gets a persistent reference to the %Study.
+ Gets the persistent reference to the %Study.
*/
PersistentReference GetPersistentReference();
/*!
Closes the study.
*/
void Close(in Study aStudy);
-/*! \brief Saving the study
+/*! \brief Saving the study in a HDF file (or files).
Saves the study.
+ \param theMultiFile If this parameter is True the study will be saved in several files.
<BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
*/
void Save(in Study aStudy, in boolean theMultiFile);
+/*! \brief Saving the study in a ASCII file (or files).
+ Saves the study in a ASCII format.
+ \param theMultiFile If this parameter is True the study will be saved in several files.
+*/
void SaveASCII(in Study aStudy, in boolean theMultiFile);
-/*! \brief Saving the study in a file
+/*! \brief Saving the study in a specified HDF file (or files).
+
+ Saves the study in a specified file (or files).
+ \param theMultiFile If this parameter is True the study will be saved in several files.
- Saves the study in a specified file.
<BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
*/
void SaveAs(in URL aUrl, // if the file already exists
in Study aStudy,
in boolean theMultiFile); // overwrite (as option)
+/*! \brief Saving the study in a specified ASCII file (or files).
+ Saves the study in a specified ASCII file (or files).
+ \param theMultiFile If this parameter is True the study will be saved in several files.
+*/
void SaveAsASCII(in URL aUrl, // if the file already exists
in Study aStudy,
in boolean theMultiFile); // overwrite (as option)
//==========================================================================
/*! \brief %Generic attribute interface
- %Generic attribute is a base interface for all attributes which inherit
- its methods.
+ %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
*/
//==========================================================================
interface GenericAttribute
//==========================================================================
/*! \brief %SComponent interface
+ The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
The %SComponent interface is a specialization of the %SObject interface.
It inherits the most of its methods from the %SObject interface.
*/
};
//==========================================================================
//==========================================================================
-/*! \brief The callback interface
+/*! \brief The callback interface
The %StudyBuilder can be created with the method <VAR>NewBuilder</VAR>. While invocation of this method a new object of the class <VAR>Callback</VAR> is created
and this object is assigned to the newly created Builder as callback which should be called when adding and removing of the ojects.
};
};
-
+
#endif
#ifndef _SALOME_COMPONENT_IDL_
#define _SALOME_COMPONENT_IDL_
-/*! \ingroup Kernel
+/*!
This is a package of interfaces used for connecting new components to %SALOME application. It also contains a set of interfaces used
for management of %MED component in %SALOME application.
/*! \brief Interface of the %Container
This interface defines the process of loading and registration
- of new components in SALOME application
+ of new components in %SALOME application
*/
interface Container
{
// $Header$
/*! \file SALOME_Exception.idl This file contains the objects defining the main exception used
-in %SALOME application.
+in %SALOME application. The idl SALOME_Exception provides a generic CORBA exception for SALOME,
+ with an attribute that gives an exception type,a message, plus optional source file name and line number.
+This idl is intended to serve for all user CORBA exceptions raised in SALOME code, as IDL specification
+does not support exception inheritance. So, all the user CORBA exceptions from SALOME could be
+handled in a single catch.
+
*/
#ifndef _SALOME_EXCEPTION_IDL_
#define _SALOME_EXCEPTION_IDL_
/*!
-Module SALOME regroups all idl definitions for SALOME Kernel
+Module %SALOME regroups all idl definitions for %SALOME Kernel component
*/
module SALOME
{
/*!
-This enumeration contains the elements indicating the type of the exception.
+This enumeration contains the elements indicating the type of the exception
+which can be raised during %SALOME session.
*/
enum ExceptionType
{
COMM, /*!< Communication problem */
BAD_PARAM, /*!< Bad User parameters */
- INTERNAL_ERROR /*!< SALOME Bug, irrecoverable */
+ INTERNAL_ERROR /*!< Application level problem, irrecoverable */
};
/*!
This struct contains a set of fields defining the structure of the exception.
creation of the catalog of components in %SALOME application
*/
-/*! \ingroup Kernel
+/*!
The main package of interfaces used for creation of the module catalog in %SALOME application.
*/
module SALOME_ModuleCatalog
{
// Type Definitions
/*!
-This enumeration contains a set of definitions of %SALOME modules.
+This enumeration contains a set of definitions of the components integrated
+into %SALOME application.
*/
enum ComponentType { GEOM, /*!<Module %GEOM */
MESH, /*!<Module %MESH */
// $Header$
#include "SALOME_Component.idl"
-/*! \defgroup Kernel SALOME KERNEL module
-*/
-/*! \ingroup Kernel
-
+/*!
This package contains interfaces used for management of the session in %SALOME application.
*/
module SALOME
AC_SUBST(CAS_DATAEXCHANGE)
AC_SUBST(CAS_LDFLAGS)
+AC_SUBST(CAS_LDPATH)
+
CAS_CPPFLAGS=""
CAS_CXXFLAGS=""
CAS_LDFLAGS=""
-
occ_ok=no
dnl libraries directory location
AC_MSG_WARN(You must provide CASROOT variable : see OCC installation manual)
else
occ_ok=yes
+ OCC_VERSION_MAJOR=0
+ ff=$CASROOT/inc/Standard_Version.hxx
+ if test -f $ff ; then
+ grep "define OCC_VERSION_MAJOR" $ff > /dev/null
+ if test $? = 0 ; then
+ OCC_VERSION_MAJOR=`grep "define OCC_VERSION_MAJOR" $ff | awk '{i=3 ; print $i}'`
+ fi
+ fi
fi
if test "x$occ_ok" = "xyes"; then
if test "x$occ_ok" = xyes ; then
- CAS_CPPFLAGS="-DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -I$CASROOT/inc"
+ CAS_CPPFLAGS="-DOCC_VERSION_MAJOR=$OCC_VERSION_MAJOR -DLIN -DLINTEL -DCSFDB -DNO_CXX_EXCEPTION -DNo_exception -I$CASROOT/inc"
CAS_CXXFLAGS="-funsigned-char"
AC_MSG_CHECKING(for OpenCascade libraries)
CXXFLAGS="$CXXFLAGS $CAS_CXXFLAGS"
LIBS_old="$LIBS"
LIBS="$LIBS -L$CASROOT/$casdir/lib -lTKernel"
-
AC_CACHE_VAL(salome_cv_lib_occ,[
AC_TRY_LINK(
#include <Standard_Type.hxx>
AC_MSG_WARN(Opencascade libraries not found)
else
AC_MSG_RESULT(yes)
- CAS_KERNEL="-L$CASROOT/$casdir/lib -lTKernel -lTKMath"
- CAS_OCAF="-L$CASROOT/$casdir/lib -lPTKernel -lTKCAF -lFWOSPlugin -lTKPShape -lTKPCAF -lTKStdSchema -lTKShapeSchema -lPAppStdPlugin -lTKPAppStd -lTKCDF"
+ CAS_LDPATH="-L$CASROOT/$casdir/lib "
+ CAS_KERNEL="$CAS_LDPATH -lTKernel -lTKMath"
+ CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKCAF -lFWOSPlugin -lTKPShape -lTKPCAF -lTKStdSchema -lTKShapeSchema -lPAppStdPlugin -lTKPAppStd -lTKCDF"
dnl CAS_VIEWER="-L$CASROOT/$casdir/lib -lTKOpenGl -lTKV3d -lTKV2d -lTKService"
- CAS_VIEWER="-L$CASROOT/$casdir/lib -lTKOpenGl -lTKV3d -lTKService"
+ CAS_VIEWER="$CAS_LDPATH -lTKOpenGl -lTKV3d -lTKService"
# CAS_MODELER="-L$CASROOT/$casdir/lib -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKFeat -lTKOffset"
- CAS_MODELER="-L$CASROOT/$casdir/lib -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKOffset"
+ CAS_MODELER="$CAS_LDPATH -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo -lTKPrim -lTKBool -lTKHLR -lTKFillet -lTKOffset"
dnl CAS_DATAEXCHANGE="-L$CASROOT/$casdir/lib -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd -lTKSTL -lTKVRML "
- CAS_DATAEXCHANGE="-L$CASROOT/$casdir/lib -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd"
- CAS_LDFLAGS="$CAS_KERNEL $CAS_OCAF $CAS_VIEWER $CAS_MODELER $CAS_DATAEXCHANGE"
-
+ CAS_DATAEXCHANGE="$CAS_LDPATH -lTKXSBase -lTKIGES -lTKSTEP -lTKShHealing -lTKShHealingStd"
+ CAS_LDFLAGS="$CAS_KERNEL $CAS_OCAF $CAS_VIEWER $CAS_MODELER $CAS_DATAEXCHANGE"
+
+
fi
AC_LANG_RESTORE
OCC_INCLUDES=@CAS_CPPFLAGS@
OCC_CXXFLAGS=@CAS_CXXFLAGS@
-OCC_KERNEL_LIBS=@CAS_KERNEL@
-OCC_OCAF_LIBS=@CAS_OCAF@
-OCC_VIEWER_LIBS=@CAS_VIEWER@
-OCC_MODELER_LIBS=@CAS_MODELER@
-OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@
-OCC_LIBS=@CAS_LDFLAGS@
+#OCC_KERNEL_LIBS=@CAS_KERNEL@
+#OCC_OCAF_LIBS=@CAS_OCAF@
+#OCC_VIEWER_LIBS=@CAS_VIEWER@
+#OCC_MODELER_LIBS=@CAS_MODELER@
+#OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@
+#OCC_LIBS=@CAS_LDFLAGS@
+CAS_KERNEL=@CAS_KERNEL@
+CAS_OCAF=@CAS_OCAF@
+CAS_VIEWER=@CAS_VIEWER@
+CAS_MODELER=@CAS_MODELER@
+CAS_DATAEXCHANGE=@CAS_DATAEXCHANGE@
+CAS_LDPATH=@CAS_LDPATH@
# MPICH
MPICH_INCLUDES=@MPICH_INCLUDES@
#LDFLAGS+= $(CORBA_LIBS)
LIBS+=$(CORBA_LIBS)
+DOXYGEN = @DOXYGEN@
+
## Shared libraries
LT_STATIC_EXEC=@LT_STATIC_EXEC@
DYNAMIC_DIRS=@DYNAMIC_DIRS@
# begin of package rules
#
-.PHONY: all lib bin inc resources tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
+.PHONY: all lib bin inc resources data doc tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
$(MAKE) lib
$(MAKE) bin
$(MAKE) resources
+ $(MAKE) data
#
# add target to build administrative files
$(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/share/salome/resources/% : %
cp -f $< $@
+data:
+ @if test "X$(top_builddir)" = "X."; then \
+ ((cd examples && $(MAKE) $@) || exit 1); \
+ fi;
+
+doc:
+ @if test "X$(top_builddir)" = "X."; then \
+ ((cd doc && $(MAKE) $@) || exit 1); \
+ fi;
install: install-resources
@@SETX@; for d in $(SUBDIRS); do \
#include "utilities.h"
extern bool _Sleeping ;
+static Engines_Component_i * theEngines_Component ;
Engines_Component_i::Engines_Component_i()
{
const char *instanceName,
const char *interfaceName,
bool notif) :
- _instanceName(instanceName), _interfaceName(interfaceName),
- _myConnexionToRegistry(0), _ThreadId(0) , _graphName("") , _nodeName("") {
+ _instanceName(instanceName),
+ _interfaceName(interfaceName),
+ _myConnexionToRegistry(0),
+ _ThreadId(0) , _ThreadCpuUsed(0) , _Executed(false) , _graphName("") , _nodeName("") {
MESSAGE("Component constructor with instanceName "<< _instanceName);
_orb = CORBA::ORB::_duplicate(orb);
_poa = PortableServer::POA::_duplicate(poa);
: _instanceName(instanceName),
_interfaceName(interfaceName),
_myConnexionToRegistry(0),
- _ThreadId(0)
-{
+ _ThreadId(0) , _ThreadCpuUsed(0) , _Executed(false) , _graphName("") , _nodeName("") {
// MESSAGE("Component constructor with instanceName "<< _instanceName);
_orb = CORBA::ORB::_duplicate(orb);
_poa = PortableServer::POA::_duplicate(poa);
void Engines_Component_i::beginService(const char *serviceName)
{
- MESSAGE("Send BeginService notification for " << serviceName << endl
+ MESSAGE(pthread_self() << "Send BeginService notification for " << serviceName << endl
<< "Component instance : " << _instanceName << endl << endl);
_ThreadId = pthread_self() ;
_StartUsed = 0 ;
_StartUsed = CpuUsed_impl() ;
+ _ThreadCpuUsed = 0 ;
+ _Executed = true ;
_serviceName = serviceName ;
if ( pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS , NULL ) ) {
perror("pthread_setcanceltype ") ;
perror("pthread_setcancelstate ") ;
exit(0) ;
}
- MESSAGE("Return from BeginService for " << serviceName
- << " ThreadId " << _ThreadId
- << " _graphName " << _graphName << " _nodeName " << _nodeName );
+// MESSAGE(pthread_self() << " Return from BeginService for " << serviceName
+// << " ThreadId " << _ThreadId << " StartUsed " << _StartUsed
+// << " _graphName " << _graphName << " _nodeName " << _nodeName );
}
void Engines_Component_i::endService(const char *serviceName)
{
- MESSAGE("Send EndService notification for " << serviceName << endl
- << "Component instance : " << _instanceName << endl << endl);
+ _ThreadCpuUsed = CpuUsed_impl() ;
+ MESSAGE(pthread_self() << " Send EndService notification for " << serviceName << endl
+ << " Component instance : " << _instanceName << " StartUsed " << _StartUsed << " _ThreadCpuUsed "
+ << _ThreadCpuUsed << endl << endl);
_ThreadId = 0 ;
}
return CORBA::string_dup( _nodeName.c_str() ) ;
}
-bool Killer( int ThreadId , int signum ) {
+bool Engines_Component_i::Killer( int ThreadId , int signum ) {
if ( ThreadId ) {
if ( signum == 0 ) {
if ( pthread_cancel( ThreadId ) ) {
return false ;
}
else {
- MESSAGE("Killer : ThreadId " << ThreadId << " pthread_canceled") ;
+ MESSAGE(pthread_self() << "Killer : ThreadId " << ThreadId << " pthread_canceled") ;
}
}
else {
return false ;
}
else {
- MESSAGE("Killer : ThreadId " << ThreadId << " pthread_killed("
+ MESSAGE(pthread_self() << "Killer : ThreadId " << ThreadId << " pthread_killed("
<< signum << ")") ;
}
}
}
bool Engines_Component_i::Kill_impl() {
- MESSAGE("Engines_Component_i::Kill_i() pthread_t "<< pthread_self()
- << " pid " << getpid() << " instanceName "
- << _instanceName.c_str() << " interface " << _interfaceName.c_str()
- << " machineName " << GetHostname().c_str()<< " _id " << hex << _id
- << dec << " _ThreadId " << _ThreadId << " this " << hex << this
- << dec ) ;
+// MESSAGE("Engines_Component_i::Kill_i() pthread_t "<< pthread_self()
+// << " pid " << getpid() << " instanceName "
+// << _instanceName.c_str() << " interface " << _interfaceName.c_str()
+// << " machineName " << GetHostname().c_str()<< " _id " << hex << _id
+// << dec << " _ThreadId " << _ThreadId << " this " << hex << this
+// << dec ) ;
bool RetVal = false ;
if ( _ThreadId > 0 && pthread_self() != _ThreadId ) {
RetVal = Killer( _ThreadId , 0 ) ;
}
+void SetCpuUsed() {
+ theEngines_Component->SetCurCpu() ;
+}
+void Engines_Component_i::SetCurCpu() {
+ _ThreadCpuUsed = CpuUsed() ;
+// MESSAGE(pthread_self() << " Engines_Component_i::SetCurCpu() _ThreadCpuUsed " << _ThreadCpuUsed) ;
+}
+
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
-long Engines_Component_i::CpuUsed_impl() {
+long Engines_Component_i::CpuUsed() {
+ long cpu = 0 ;
struct rusage usage ;
- long cpu ;
- if ( getrusage( RUSAGE_SELF , &usage ) == -1 ) {
- perror("GraphBase::CpuUsed") ;
- return 0 ;
+ if ( _ThreadId || _Executed ) {
+ if ( getrusage( RUSAGE_SELF , &usage ) == -1 ) {
+ perror("Engines_Component_i::CpuUsed") ;
+ return 0 ;
+ }
+ cpu = usage.ru_utime.tv_sec - _StartUsed ;
+// cout << pthread_self() << " Engines_Component_i::CpuUsed " << " " << _serviceName
+// << usage.ru_utime.tv_sec << " - " << _StartUsed << " = " << cpu << endl ;
+ }
+ else {
+// cout << pthread_self() << "Engines_Component_i::CpuUsed _ThreadId " << _ThreadId << " " << _serviceName
+// << " _StartUsed " << _StartUsed << endl ;
+ }
+ return cpu ;
+}
+
+long Engines_Component_i::CpuUsed_impl() {
+ long cpu = 0 ;
+ if ( _ThreadId || _Executed ) {
+ if ( _ThreadId > 0 ) {
+ if ( pthread_self() != _ThreadId ) {
+ if ( _Sleeping ) {
+ }
+ else {
+// Get Cpu in the appropriate thread with that object !...
+ theEngines_Component = this ;
+ Killer( _ThreadId ,SIGUSR1 ) ;
+ }
+ cpu = _ThreadCpuUsed ;
+ }
+ else {
+ _ThreadCpuUsed = CpuUsed() ;
+ cpu = _ThreadCpuUsed ;
+// cout << pthread_self() << " Engines_Component_i::CpuUsed_impl " << _serviceName << " " << cpu
+// << endl ;
+ }
+ }
+ else {
+ cpu = _ThreadCpuUsed ;
+// cout << pthread_self() << " Engines_Component_i::CpuUsed_impl " << _serviceName << " " << cpu
+// << endl ;
+ }
+ }
+ else {
+// cout << pthread_self() << "Engines_Component_i::CpuUsed_impl _ThreadId " << _ThreadId << " "
+// << _serviceName << " _StartUsed " << _StartUsed << endl ;
}
-// return usage.ru_utime.__time_t tv_sec ;
- cout << "CpuUsed " << usage.ru_utime.tv_sec << " " << usage.ru_utime.tv_usec << " "
- << usage.ru_stime.tv_sec << " " << usage.ru_stime.tv_usec << endl ;
- cpu = usage.ru_utime.tv_sec - _StartUsed ;
return cpu ;
}
return Engines::Container::_nil() ;
}
-Engines::Component_ptr Engines_Container_i::load_impl
- (const char* nameToRegister,
- const char* componentName)
-{
- BEGIN_OF("Container_i::load_impl");
+Engines::Component_ptr Engines_Container_i::load_impl( const char* nameToRegister,
+ const char* componentName ) {
_numInstanceMutex.lock() ; // lock on the instance number
+ BEGIN_OF( "Container_i::load_impl " << componentName ) ;
_numInstance++ ;
char _aNumI[12];
- sprintf(_aNumI,"%d",_numInstance) ;
+ sprintf( _aNumI , "%d" , _numInstance ) ;
string _impl_name = componentName;
string _nameToRegister = nameToRegister;
//SCRUTE(instanceName);
//string absolute_impl_name = _library_path + "lib" + _impl_name + ".so";
- string absolute_impl_name(_impl_name);
- // SCRUTE(absolute_impl_name);
+ string absolute_impl_name( _impl_name ) ;
+ SCRUTE(absolute_impl_name);
void* handle;
- handle = dlopen(absolute_impl_name.c_str(), RTLD_LAZY);
- if (!handle)
- {
- INFOS("Can't load shared library : " << absolute_impl_name);
- INFOS("error dlopen: " << dlerror());
- _numInstanceMutex.unlock() ;
- return Engines::Component::_nil() ;
- }
+ handle = dlopen( absolute_impl_name.c_str() , RTLD_LAZY ) ;
+ if ( !handle ) {
+ INFOS("Can't load shared library : " << absolute_impl_name);
+ INFOS("error dlopen: " << dlerror());
+ _numInstanceMutex.unlock() ;
+ return Engines::Component::_nil() ;
+ }
string factory_name = _nameToRegister + string("Engine_factory");
// SCRUTE(factory_name) ;
PortableServer::ObjectId *,
const char *,
const char *) ;
-// typedef PortableServer::ObjectId * (*FACTORY_FUNCTION_SUPERV)
-// (CORBA::ORB_ptr,
-// PortableServer::POA_ptr,
-// PortableServer::ObjectId *,
-// const char *,
-// const char * ,
-// int , char ** ) ;
-
FACTORY_FUNCTION Component_factory = (FACTORY_FUNCTION) dlsym(handle, factory_name.c_str());
-// FACTORY_FUNCTION_SUPERV Component_factory_superv = (FACTORY_FUNCTION_SUPERV) Component_factory ;
-
-// PortableServer::ObjectId * (*Component_factory) (CORBA::ORB_ptr,
-// PortableServer::POA_ptr,
-// PortableServer::ObjectId *,
-// const char *,
-// const char *) =
-// (PortableServer::ObjectId * (*) (CORBA::ORB_ptr,
-// PortableServer::POA_ptr,
-// PortableServer::ObjectId *,
-// const char *,
-// const char *))
-// dlsym(handle, factory_name.c_str());
char *error ;
- if ((error = dlerror()) != NULL)
- {
+ if ( (error = dlerror() ) != NULL) {
INFOS("Can't resolve symbol: " + factory_name);
SCRUTE(error);
_numInstanceMutex.unlock() ;
return Engines::Component::_nil() ;
}
- // Instanciate required CORBA object
- PortableServer::ObjectId * id ;
-// if ( factory_name == "SupervisionEngine_factory" ) { // for Python ...
-// id = (Component_factory_superv) (_orb, _poa, _id, instanceName.c_str(),
-// _nameToRegister.c_str(), _argc , _argv );
-// }
-// else {
- id = (Component_factory) (_orb, _poa, _id, instanceName.c_str(),
- _nameToRegister.c_str());
-// }
+ string component_registerName = _containerName + "/" + _nameToRegister;
+ Engines::Component_var iobject = Engines::Component::_nil() ;
+ try {
+ CORBA::Object_var obj = _NS->Resolve( component_registerName.c_str() ) ;
+ if ( CORBA::is_nil( obj ) ) {
+// Instanciate required CORBA object
+ PortableServer::ObjectId * id ;
+ id = (Component_factory) ( _orb, _poa, _id, instanceName.c_str() ,
+ _nameToRegister.c_str() ) ;
// get reference from id
- CORBA::Object_var o = _poa->id_to_reference(*id);
- Engines::Component_var iobject = Engines::Component::_narrow(o) ;
+ obj = _poa->id_to_reference(*id);
+ iobject = Engines::Component::_narrow( obj ) ;
// _numInstanceMutex.lock() ; // lock on the add on handle_map (necessary ?)
// register the engine under the name containerName.dir/nameToRegister.object
- string component_registerName = _containerName + "/" + _nameToRegister;
- _NS->Register(iobject, component_registerName.c_str()) ;
+ _NS->Register( iobject , component_registerName.c_str() ) ;
+ MESSAGE( "Container_i::load_impl " << component_registerName.c_str() << " bound" ) ;
+ }
+ else { // JR : No ReBind !!!
+ MESSAGE( "Container_i::load_impl " << component_registerName.c_str() << " already bound" ) ;
+ iobject = Engines::Component::_narrow( obj ) ;
+ }
+ }
+ catch (...) {
+ MESSAGE( "Container_i::load_impl catched" ) ;
+ }
//Jr _numInstanceMutex.lock() ; // lock on the add on handle_map (necessary ?)
handle_map[instanceName] = handle;
+ END_OF("Container_i::load_impl");
_numInstanceMutex.unlock() ;
-// END_OF("Container_i::load_impl");
return Engines::Component::_duplicate(iobject);
}
struct sigaction SigIntAct ;
SigIntAct.sa_sigaction = &SigIntHandler ;
SigIntAct.sa_flags = SA_SIGINFO ;
- if ( sigaction( SIGINT , &SigIntAct, NULL ) ) {
+ if ( sigaction( SIGINT | SIGUSR1 , &SigIntAct, NULL ) ) {
perror("SALOME_Container main ") ;
exit(0) ;
}
else {
- INFOS("SigIntHandler activated") ;
+ INFOS(pthread_self() << "SigIntHandler activated") ;
}
}
+void SetCpuUsed() ;
+
void SigIntHandler(int what , siginfo_t * siginfo ,
void * toto ) {
- MESSAGE("SigIntHandler what " << what << endl
+ MESSAGE(pthread_self() << "SigIntHandler what " << what << endl
<< " si_signo " << siginfo->si_signo << endl
<< " si_code " << siginfo->si_code << endl
<< " si_pid " << siginfo->si_pid) ;
}
else {
ActSigIntHandler() ;
- _Sleeping = true ;
- INFOS("SigIntHandler BEGIN sleeping.")
- MESSAGE("SigIntHandler BEGIN sleeping.") ;
- int count = 0 ;
- while( _Sleeping ) {
- sleep( 1 ) ;
- count += 1 ;
+ if ( siginfo->si_signo == SIGUSR1 ) {
+ SetCpuUsed() ;
+ }
+ else {
+ _Sleeping = true ;
+ INFOS("SigIntHandler BEGIN sleeping.")
+ MESSAGE("SigIntHandler BEGIN sleeping.") ;
+ int count = 0 ;
+ while( _Sleeping ) {
+ sleep( 1 ) ;
+ count += 1 ;
+ }
+ INFOS("SigIntHandler LEAVE sleeping after " << count << " s.")
+ MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
}
- INFOS("SigIntHandler LEAVE sleeping after " << count << " s.")
- MESSAGE("SigIntHandler LEAVE sleeping after " << count << " s.") ;
return ;
}
}
from SALOME_utilities import *
+from thread import *
+
#=============================================================================
#define an implementation of the component interface
self._nodeName = ''
self._ThreadId = 0
self._StartUsed = 0
+ self._ThreadCpuUsed = 0
+ self._Executed = 0
naming_service = SALOME_NamingServicePy_i(self._orb)
Component_path = "/Containers/" + os.getenv( "HOSTNAME" ) + "/" + self._containerName + "/" + self._interfaceName
#-------------------------------------------------------------------------
def beginService(self , serviceName ):
- MESSAGE( "Send BeginService notification for " + str(serviceName) + "for graph/node" + str(self._graphName) + str(self._nodeName) )
+ MESSAGE( "Send BeginService notification for " + str(serviceName) + " for graph/node " + str(self._graphName) + " " + str(self._nodeName) )
MESSAGE( "Component instance : " + str ( self._instanceName ) )
+ self._serviceName = str(serviceName)
+ self._ThreadId = get_ident()
self._StartUsed = 0
self._StartUsed = self.CpuUsed_impl()
+ self._ThreadCpuUsed = 0
+ self._Executed = 1
+ MESSAGE( "SALOME_ComponentPy_i::beginService _StartUsed " + str( self._ThreadId ) + " " + str( self._StartUsed ) )
+
#-------------------------------------------------------------------------
def endService(self , serviceName ):
- MESSAGE( "Send EndService notification for " + str(serviceName) + "for graph/node" + str(self._graphName) + str(self._nodeName) )
+ MESSAGE( "Send EndService notification for " + str( self._ThreadId ) + " " + str(serviceName) + " for graph/node " + str(self._graphName) + " " + str(self._nodeName) + " CpuUsed " + str( self.CpuUsed_impl() ) )
MESSAGE( "Component instance : " + str(self._instanceName) )
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
def CpuUsed_impl(self):
- cpu = time.clock()
- cpuL = int(cpu) - self._StartUsed
- print "SALOME_ComponentPy_i::CpuUsed_impl ",cpuL,type(cpuL)
- return cpuL
+ if ( self._ThreadId | self._Executed ) :
+ if self._ThreadId == get_ident() :
+ cpu = time.clock()
+ self._ThreadCpuUsed = int(cpu) - self._StartUsed
+ MESSAGE( "SALOME_ComponentPy_i::CpuUsed_impl " + self._serviceName + " " + str( int(cpu) ) + " - " + str( self._StartUsed ) + " = " + str( self._ThreadCpuUsed ) )
+ return self._ThreadCpuUsed
+ MESSAGE( "SALOME_ComponentPy_i::CpuUsed_impl " + self._serviceName + " " + str( self._ThreadCpuUsed ) )
+ return self._ThreadCpuUsed
+ MESSAGE( "SALOME_ComponentPy_i::CpuUsed_impl self._StartUsed " + self._serviceName + " " + str(self._StartUsed) )
+ return 0
#-------------------------------------------------------------------------
void Names( const char * graphName , const char * nodeName ) ;
char * graphName() ;
char * nodeName() ;
+ bool Killer( int ThreadId , int signum );
bool Kill_impl();
bool Stop_impl();
bool Suspend_impl();
bool Resume_impl();
+ void SetCurCpu() ;
+ long CpuUsed() ;
long CpuUsed_impl() ;
protected:
private:
pthread_t _ThreadId ;
long _StartUsed ;
+ long _ThreadCpuUsed ;
+ bool _Executed ;
};
#endif
# include "Utils_ORB_INIT.hxx"
# include "Utils_SINGLETON.hxx"
-
+#include "SALOME_NamingService.hxx"
#include "SALOME_Container_i.hxx"
#include <iostream>
#include <string>
CORBA::ORB_var &orb = init( argc , argv ) ;
// Obtain a reference to the root POA.
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
- PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj);
-
// obtain the root poa manager
- PortableServer::POAManager_var pman = root_poa->the_POAManager();
-
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var root_poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int CONTAINER=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var pman;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ root_poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(root_poa))
+ pman = root_poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ }
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "Container: Naming Service was found" )
+ if(EnvL==1){
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Container: Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "Container: Unknown exception" ) }
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "Container: Logger Server was found" )
+ log->ping();
+ CONTAINER=1;
+ break;
+ }
+ }}
+ }
+ if ((CONTAINER==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+
+ //
// define policy objects
PortableServer::ImplicitActivationPolicy_var implicitActivation =
root_poa->create_implicit_activation_policy(PortableServer::NO_IMPLICIT_ACTIVATION) ;
- // default = NO_IMPLICIT_ACTIVATION
+ // default = NO_IMPLICIT_ACTIVATION
PortableServer::ThreadPolicy_var threadPolicy =
root_poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL) ;
- // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
-
+ // default = ORB_CTRL_MODEL, other choice SINGLE_THREAD_MODEL
+
// create policy list
CORBA::PolicyList policyList;
policyList.length(2);
#include "SALOME_NamingService.hxx"
#include "SALOME_DataTypeCatalog_impl.hxx"
#include "utilities.h"
-
+# include "Utils_SINGLETON.hxx"
int main(int argc,char **argv)
{
try {
CosNaming::NamingContext_var _rootContext, catalogContext;
-
// initialize the ORB
-
CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
-
// initialize POA
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ int DATA_TYPE_CATALOG=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var mgr;
+
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);}
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Data Type Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ }
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "Data Type Catalog: Naming Service was found" )
+ if(EnvL==1){
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);}
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Data Type Catalog: Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "Data Type Catalog: Unknown exception" ) }
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "Data Type Catalog: Logger Server was found" )
+ log->ping();
+ DATA_TYPE_CATALOG=1;
+ break;
+ }
+
+ }}
+ }
+ if ((DATA_TYPE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
- CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
-
- PortableServer::POA_var poa = PortableServer::POA::_narrow (poaobj);
- PortableServer::POAManager_var mgr = poa->the_POAManager();
-
+ //
// Active catalog
SALOME_DataTypeCatalogImpl* Catalogue_i = new SALOME_DataTypeCatalogImpl(argc, argv);
poa->destroy(1,1);
- }
+ }
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.")
}
break;
case HDF_INT32 :
+#ifdef PCLINUX
+ type_hdf = H5T_STD_I32BE;
+#else
type_hdf = H5T_NATIVE_INT;
+#endif
break;
case HDF_INT64 :
{
hdf_err ret = -1;
hdf_idt type_hdf;
-
+
if ((type_hdf = H5Aget_type(id)) >= 0) {
+#ifdef PCLINUX
+ if ((H5Tget_class(type_hdf) == H5T_INTEGER) && (H5Tget_size(type_hdf) == 4))
+ type_hdf = H5T_NATIVE_INT;
+#endif
ret = H5Aread(id, type_hdf, val);
}
hdf_err HDFattrWrite(hdf_idt id, void *val)
{
hdf_idt type_id;
- hdf_type type;
- hdf_class_type hdf_type;
int ret = 0;
+#ifdef PCLINUX
+ int isI32BE = 0;
+#endif
if ((type_id = H5Aget_type(id)) < 0)
return -1;
+#ifdef PCLINUX
+ if((H5Tget_class(type_id) == H5T_INTEGER) && (H5Tget_size(type_id) == 4)) {
+ isI32BE = 1; /* See HDFattrCreate */
+ if (H5Tconvert(H5T_NATIVE_INT,H5T_STD_I32BE,1,(void *)val,NULL,NULL) < 0)
+ return -1;
+ }
+#endif
+
ret = H5Awrite(id,type_id, val);
+
+#ifdef PCLINUX
+ if (isI32BE && (H5Tconvert(H5T_STD_I32BE,H5T_NATIVE_INT,1,(void *)val,NULL,NULL) < 0))
+ return -1;
+#endif
+
H5Tclose(type_id);
return ret;
break;
case HDF_INT32 :
+#ifdef PCLINUX
+ type_hdf = H5T_STD_I32BE;
+#else
type_hdf = H5T_NATIVE_INT;
+#endif
break;
case HDF_INT64 :
{
hdf_idt type_id;
hdf_type type;
- hdf_class_type hdf_type;
hdf_size_type size;
if ((type_id = H5Dget_type(id)) < 0)
return HDF_NONE;
- hdf_type = H5Tget_class(type_id);
- switch (hdf_type)
+ switch (H5Tget_class(type_id))
{
case H5T_INTEGER :
size = H5Tget_size(type_id);
if ((datatype = H5Dget_type(id)) < 0)
return -1;
- if ((ret = H5Dread(id,datatype,H5S_ALL,H5S_ALL,
- H5P_DEFAULT, val)) < 0)
+#ifdef PCLINUX
+ if ((H5Tget_class(datatype) == H5T_INTEGER) && (H5Tget_size(datatype) == 4))
+ datatype = H5T_NATIVE_INT;
+#endif
+
+ if ((ret = H5Dread(id,datatype,H5S_ALL,H5S_ALL,H5P_DEFAULT, val)) < 0)
return -1;
return 0;
{
hdf_idt datatype;
hdf_err ret;
+#ifdef PCLINUX
+ int isI32BE = 0;
+ int size;
+#endif
if ((datatype = H5Dget_type(id)) < 0)
return -1;
- if ((ret = H5Dwrite(id,datatype,H5S_ALL,H5S_ALL,
- H5P_DEFAULT, val)) < 0)
+#ifdef PCLINUX
+ if((H5Tget_class(datatype) == H5T_INTEGER) && (H5Tget_size(datatype) == 4)) {
+ isI32BE = 1; /* See HDFdatasetCreate */
+ size = (int)HDFdatasetGetSize(id) / 4;
+ if(size == 0)
+ return -1;
+ if(H5Tconvert(H5T_NATIVE_INT, H5T_STD_I32BE, size, (void *)val, NULL, NULL) < 0)
+ return -1;
+ }
+#endif
+
+ if ((ret = H5Dwrite(id, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, val)) < 0)
+ return -1;
+
+#ifdef PCLINUX
+ if (isI32BE && (H5Tconvert(H5T_STD_I32BE, H5T_NATIVE_INT, size, (void *)val, NULL, NULL) < 0))
return -1;
+#endif
return 0;
}
#BIN = test9 test8
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) -DPCLINUX
-LDFLAGS+= $(OCC_LIBS) $(HDF5_LIBS)
+LDFLAGS+= $(CAS_LDPATH) -lTKernel $(HDF5_LIBS)
@CONCLUDE@
QString dir;
char* cenv;
- // Try ${SALOME_ROOT_DIR}/share/salome/resources directory
+ // Try ${KERNEL_ROOT_DIR}/share/salome/resources directory
cenv = getenv( "KERNEL_ROOT_DIR" );
if ( cenv ) {
dir.sprintf( "%s", cenv );
return fileInfo.filePath();
}
}
- // Try ${SALOME_SITE_DIR}/share/salome/resources directory
- cenv = getenv( "SALOME_SITE_DIR" );
- if ( cenv ) {
- dir.sprintf( "%s", cenv );
- if ( !dir.isEmpty() ) {
- dir = addSlash(dir) ;
- dir = dir + "share" ;
- dir = addSlash(dir) ;
- dir = dir + "salome" ;
- dir = addSlash(dir) ;
- dir = dir + "resources" ;
- dir = addSlash(dir) ;
- QFileInfo fileInfo( dir + filename );
- if ( fileInfo.isFile() && fileInfo.exists() )
- return fileInfo.filePath();
- }
- }
- // Try ${SALOME_ROOT_DIR}/share/salome/resources directory
- cenv = getenv( "SALOME_ROOT_DIR" );
- if ( cenv ) {
- dir.sprintf( "%s", cenv );
- if ( !dir.isEmpty() ) {
- dir = addSlash(dir) ;
- dir = dir + "share" ;
- dir = addSlash(dir) ;
- dir = dir + "salome" ;
- dir = addSlash(dir) ;
- dir = dir + "resources" ;
- dir = addSlash(dir) ;
- QFileInfo fileInfo( dir + filename );
- if ( fileInfo.isFile() && fileInfo.exists() )
- return fileInfo.filePath();
- }
- }
return filename;
}
QString addSlash( const QString& path )
using namespace std;
#include <iostream>
#include "SALOME_Logger_Server.hxx"
-
+#include <SALOMEconfig.h>
+#include <sys/types.h>
+#include <unistd.h>
omni_mutex Logger::myLock;
/////////////////////////////////////////////////////////////////////
myLock.unlock();
}
+void Logger::ping()
+{
+ cout<<" Logger::ping() pid "<< getpid()<<endl;
+}
+
int main(int argc, char **argv)
{
if (argc > 2)
try
{
//Initialize the ORB
- CORBA::ORB_var orb = CORBA::ORB_init(argc,argv) ;
-
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA") ;
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj) ;
-
- // NB. You can activate the POA before or after
- // activating objects in that POA.
- PortableServer::POAManager_var pman = poa->the_POAManager();
- pman->activate();
-
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ CORBA::ORB_var orb;
+ SALOME_Logger::Logger_var myLoggerRef;
+ CORBA::Object_var theObj;
Logger* myLogger;
+ CORBA::Object_var obj;
+ PortableServer::POA_var poa;
+ PortableServer::POAManager_var pman;
+ orb = CORBA::ORB_init(argc,argv) ;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ obj = orb->resolve_initial_references("RootPOA") ;
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj) ;
+ pman = poa->the_POAManager();
+ // NB. You can activate the POA before or after
+ // activating objects in that POA.
+
+ // This activates the object in the root POA (by default), and
+ // returns a reference to it.
+ //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro
+ //Otherwise, you will get segmentation fault.
+ //Get initial naming context
+ try{
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ //Narrow to NamingContext
+ if (!CORBA::is_nil(theObj)){
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ }catch(CORBA::COMM_FAILURE&)
+ {
+ cout<<"Logger Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service"<<endl;
+ }
+ catch(...){ cout<<"Logger Server: Unknown exception dealed with Naming Service" <<endl; }
+ if (!CORBA::is_nil(inc)){
+ cout<<"Logger Server: Naming Service was found"<<endl;
+ break;}
+ }
if (argc == 1)
myLogger = new Logger();
else
myLogger = new Logger(argv[1]);
-
-
- // This activates the object in the root POA (by default), and
- // returns a reference to it.
- SALOME_Logger::Logger_var myLoggerRef = myLogger->_this();
-
- //NB. You can't use SALOME_NamingService class because it uses MESSAGE macro
- //Otherwise, you will get segmentation fault.
-
- //Get initial naming context
- CORBA::Object_var theObj = orb->resolve_initial_references("NameService");
- //Narrow to NamingContext
- CosNaming::NamingContext_var inc = CosNaming::NamingContext::_narrow(theObj);
-
+ myLoggerRef = myLogger->_this();
CosNaming::Name name;
name.length(1);
name[0].id = CORBA::string_dup("Logger");
-
inc->bind(name,myLoggerRef);
-
myLogger->_remove_ref();
-
+ pman->activate();
orb->run() ;
-
orb->destroy() ;
}
catch(CORBA::COMM_FAILURE& ex)
{
cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
- << "object." << endl;
+ << "object." << endl;
}
catch(CORBA::SystemException&)
{
virtual ~Logger();
//put message into one special place for all servers
void putMessage(const char* message);
+ void ping();
private:
//if m_putIntoFile is true all messages will be put into special
//otherwise all messages will be put into terminal via cout
//Initialize the ORB
CORBA::ORB_var orb = CORBA::ORB_init(argc,argv) ;
- //Get initial naming context
- CORBA::Object_var theObj = orb->resolve_initial_references("NameService");
- //Narrow to NamingContext
- CosNaming::NamingContext_var inc = CosNaming::NamingContext::_narrow(theObj);
-
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
CosNaming::Name name;
name.length(1);
name[0].id = CORBA::string_dup("Logger");
-
- CORBA::Object_var obj;
- obj = inc->resolve(name);
-
- m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj) ;
-
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ cout<<"SALOME_TRACE: CORBA::COMM_FAILURE: Unable to contact the Naming Service" <<endl;
+ }
+ catch(...){ cout<< "SALOME_TRACE: Unknown exception dealed with Naming Service" <<endl; }
+
+ if(!CORBA::is_nil(inc)) {
+ obj = inc->resolve(name);
+ m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj);
+ if (!CORBA::is_nil(m_pInterfaceLogger))
+ cout<<"SALOME_TRACE: Logger Server was found"<<endl;
+ break;
+
+ }
+ }
+
}
- catch (const CosNaming::NamingContext::NotFound&)
- {
-// cout << "Caught exception: Naming Service can't found Logger";
- }
- catch (CORBA::COMM_FAILURE&)
- {
-// cout << "Caught CORBA::SystemException CommFailure.";
+ catch (const CosNaming::NamingContext::NotFound&)
+ {
+ // cout << "Caught exception: Naming Service can't found Logger";
+ }
+ catch (CORBA::COMM_FAILURE&)
+ {
+ // cout << "Caught CORBA::SystemException CommFailure.";
}
catch (CORBA::SystemException&)
{
SUBDIRS = MSG2QM Logger Utils PatchQt NamingService Registry ModuleCatalog DataTypeCatalog \
RessourcesCatalog Notification NOTIFICATION_SWIG Container TestContainer LifeCycleCORBA \
- HDFPersist OBJECT TOOLSDS SALOMEDS SALOMEGUI Plot2d VTKViewer OCCViewer SUPERVGraph Session \
- SALOME_SWIG TOOLSGUI SALOME_PY RegistryDisplay ModuleGenerator \
- SALOME_PYQT Loader
+ HDFPersist VTKFilter OBJECT TOOLSDS SALOMEDS SALOMEGUI Plot2d VTKViewer OCCViewer SUPERVGraph \
+ Session SALOME_SWIG TOOLSGUI SALOME_PY RegistryDisplay ModuleGenerator SALOME_PYQT Loader
ifeq (@WITHMPICH@,yes)
SUBDIRS+= MPIContainer
#include "SALOME_NamingService.hxx"
#include "SALOME_ModuleCatalog_impl.hxx"
#include "utilities.h"
+# include "Utils_SINGLETON.hxx"
+
+//#define CHECKTIME
+#ifdef CHECKTIME
+#include <Utils_Timer.hxx>
+#endif
//#define CHECKTIME
#ifdef CHECKTIME
CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
// initialize POA
-
- CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
-
- PortableServer::POA_var poa = PortableServer::POA::_narrow (poaobj);
- PortableServer::POAManager_var mgr = poa->the_POAManager();
-
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ int MODULE_CATALOG=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var mgr;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Module Catalog Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ }
+ if (!CORBA::is_nil(theObj)){
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "Module Catalog Server: Naming Service was found" )
+ if(EnvL==1){
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);}
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "Module Catalog Server: Unknown exception" ) }
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "Module Catalog Server: Logger Server was found" )
+ log->ping();
+ MODULE_CATALOG=1;
+ break;
+ }
+ }}
+ }}
+ if ((MODULE_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+
+ //
// Active catalog
SALOME_ModuleCatalogImpl* Catalogue_i = new SALOME_ModuleCatalogImpl(argc, argv);
# $Header$
import sys
+import time
from omniORB import CORBA
import CosNaming
from string import *
MESSAGE ( "SALOME_NamingServicePy_i::__init__" )
self._orb = orb
# initialize root context and current context
- obj =self._orb.resolve_initial_references("NameService")
- self._root_context =obj._narrow(CosNaming.NamingContext)
- self._current_context = self._root_context
+ ok = 0
+ steps = 40
+ while steps > 0 and ok == 0:
+ try:
+ obj =self._orb.resolve_initial_references("NameService")
+ self._root_context =obj._narrow(CosNaming.NamingContext)
+ self._current_context = self._root_context
- if self._root_context is None :
- MESSAGE ( "Name Service Reference is invalid" )
- sys.exit(1)
-
+ if self._root_context is None :
+ #MESSAGE ( "Name Service Reference is invalid" )
+ #sys.exit(1)
+ MESSAGE(" Name service not found")
+ else:
+ ok = 1
+ except CORBA.COMM_FAILURE, ex:
+ MESSAGE(" Name service not found")
+ time.sleep(0.25)
+ steps = steps - 1
+ if steps == 0:
+ MESSAGE ( "Name Service Reference is invalid" )
+ sys.exit(1)
#-------------------------------------------------------------------------
def Register(self,ObjRef, Path):
MESSAGE ( "SALOME_NamingServicePy_i::Register" )
EXPORT_HEADERS = SALOME_InteractiveObject.hxx \
Handle_SALOME_InteractiveObject.hxx \
SALOME_Actor.h \
- SALOME_Transform.h \
SALOME_AISShape.hxx \
Handle_SALOME_AISShape.hxx \
SALOME_AISObject.hxx \
LIB = libSalomeObject.la
LIB_SRC = SALOME_InteractiveObject.cxx \
SALOME_Actor.cxx \
- SALOME_Transform.cxx \
SALOME_AISShape.cxx\
SALOME_AISObject.cxx
BIN_SRC =
CPPFLAGS+=$(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES)
-LDFLAGS+=$(OCC_KERNEL_LIBS) $(OCC_VIEWER_LIBS) $(VTK_LIBS) $(OGL_LIBS) $(PYTHON_LIBS)
+LDFLAGS+= $(VTK_LIBS) $(OGL_LIBS) $(PYTHON_LIBS) $(CAS_LDPATH) -lTKV3d -lSalomeVTKFilter
@CONCLUDE@
// Module : SALOME
// $Header$
-using namespace std;
/*!
\class SALOME_Actor SALOME_Actor.h
\brief Abstract class of SALOME Objects in VTK.
*/
#include "SALOME_Actor.h"
+#include "SALOME_Transform.h"
+#include "SALOME_TransformFilter.h"
+#include "SALOME_PassThroughFilter.h"
+#include "SALOME_GeometryFilter.h"
// SALOME Includes
#include "utilities.h"
#include <vtkObjectFactory.h>
#include <vtkDataSetMapper.h>
#include <vtkPolyDataMapper.h>
-#include <vtkGeometryFilter.h>
#include <vtkTransformPolyDataFilter.h>
+using namespace std;
+
+int SALOME_POINT_SIZE = 3;
+
void SALOME_Actor::Render(vtkRenderer *ren, vtkMapper *Mapper )
{
if (this->Mapper == NULL) {
this->Mapper->ReleaseGraphicsResources(renWin);
}
+
void SALOME_Actor::AddToRender(vtkRenderer* theRenderer){
theRenderer->AddActor(this);
}
-
void SALOME_Actor::RemoveFromRender(vtkRenderer* theRenderer){
theRenderer->RemoveActor(this);
}
+
vtkPolyData* SALOME_Actor::GetPolyDataInput(){
return myPassFilter[3]->GetPolyDataOutput();
}
void SALOME_Actor::SetMapper(vtkMapper* theMapper){
if(theMapper){
myPassFilter[0]->SetInput(theMapper->GetInput());
- // myPassFilter[0]->Update(); -------- This and other three lines must be comment or removed to fix the regression in SMESH
myPassFilter[1]->SetInput(myPassFilter[0]->GetPolyDataOutput());
- // myPassFilter[1]->Update();
myTransformFilter->SetInput(myPassFilter[1]->GetPolyDataOutput());
myPassFilter[2]->SetInput(myTransformFilter->GetOutput());
- // myPassFilter[2]->Update();
myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
- // myPassFilter[3]->Update();
if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper))
- aMapper->SetInput(myPassFilter[3]->GetOutput());
+ aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))
aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
}
myTransformFilter->Modified();
}
+
+void SALOME_Actor::SetRepresentation(int theMode) {
+ myRepresentation = theMode;
+ switch(theMode){
+ case 3 :
+ myPassFilter[0]->SetInside(true);
+ GetProperty()->SetRepresentation(1);
+ break;
+ case 0 :
+ GetProperty()->SetPointSize(SALOME_POINT_SIZE);
+ default :
+ GetProperty()->SetRepresentation(myRepresentation);
+ myPassFilter[0]->SetInside(false);
+ }
+}
+int SALOME_Actor::GetRepresentation(){
+ return myRepresentation;
+}
+
+
SALOME_Actor::SALOME_Actor(){
PreviewProperty = NULL;
+ myRepresentation = 2;
myTransformFilter = SALOME_TransformFilter::New();
myPassFilter.push_back(SALOME_PassThroughFilter::New());
myPassFilter.push_back(SALOME_PassThroughFilter::New());
}
SALOME_Actor::~SALOME_Actor(){
+ myTransformFilter->Delete();
SetPreviewProperty(NULL);
for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
if(myPassFilter[i] != NULL)
#define SALOME_ACTOR_H
// SALOME Includes
-#include "SALOME_Transform.h"
+#include "VTKViewer_Common.h"
#include "SALOME_InteractiveObject.hxx"
#ifndef _Handle_SALOME_InteractiveObject_HeaderFile
#include "Handle_SALOME_InteractiveObject.hxx"
#endif
-
#include <vector.h>
-#include "VTKViewer_Common.h"
-class SALOME_Actor : public vtkLODActor
-{
+class SALOME_Transform;
+class SALOME_TransformFilter;
+class SALOME_PassThroughFilter;
+
+extern int SALOME_POINT_SIZE;
+
+class SALOME_Actor : public vtkLODActor{
protected:
//constructor should be protected due to first implementation of this class
//it was abstract class
virtual void SetMapper(vtkMapper* theMapper);
virtual void SetTransform(SALOME_Transform* theTransform);
+ virtual void SetRepresentation(int theMode);
+ virtual int GetRepresentation();
+
protected:
vtkProperty *PreviewProperty;
Standard_Boolean ispreselected;
SALOME_Transform *myTransform;
std::vector<SALOME_PassThroughFilter*> myPassFilter;
SALOME_TransformFilter *myTransformFilter;
+ int myRepresentation;
};
+
#endif // SALOME_ACTOR_H
+++ /dev/null
-// File: SALOME_Transform.cxx
-// Created: Wed Jun 4 09:46:59 2003
-// Author: Alexey PETROV
-// <apo@ivanox.nnov.matra-dtv.fr>
-
-
-#include "SALOME_Transform.h"
-#include "VTKViewer_Common.h"
-#include <vtkObjectFactory.h>
-#include <vtkGeometryFilter.h>
-#include <vtkMatrix4x4.h>
-using namespace std;
-
-//=======================================================================
-
-SALOME_Transform* SALOME_Transform::New(){
- vtkObject* ret = vtkObjectFactory::CreateInstance("SALOME_Transform");
- if(ret) return (SALOME_Transform*)ret;
- return new SALOME_Transform;
-}
-
-void SALOME_Transform::SetScale(float theScaleX, float theScaleY, float theScaleZ){
- double aMatrix[16] = {theScaleX,0,0,0,
- 0,theScaleY,0,0,
- 0,0,theScaleZ,0,
- 0,0,0,1.0000000};
- vtkTransform::SetMatrix(aMatrix);
- //vtkTransform::Pop();
- //vtkTransform::Scale(theScale);
-}
-
-int SALOME_Transform::IsIdentity(){
- float* aScale = GetScale();
- return (aScale[0] == 1.0 && aScale[1] == 1.0 && aScale[2] == 1.0);
-}
-
-//=======================================================================
-
-SALOME_TransformFilter* SALOME_TransformFilter::New(){
- vtkObject* ret = vtkObjectFactory::CreateInstance("SALOME_TransformFilter");
- if(ret) return (SALOME_TransformFilter*)ret;
- return new SALOME_TransformFilter;
-}
-
-void SALOME_TransformFilter::Execute(){
- vtkPoints *inPts;
- vtkPoints *newPts;
- int numPts, numCells;
- vtkPointSet *input = this->GetInput();
- vtkPointSet *output = this->GetOutput();
- vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
- vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();
- output->CopyStructure( input );
- int anIdentity = 0;
- if(SALOME_Transform* aTransform = dynamic_cast<SALOME_Transform*>(this->Transform))
- anIdentity = aTransform->IsIdentity();
- if(!anIdentity && this->Transform != NULL){
- inPts = input->GetPoints();
- if(!inPts){
- vtkErrorMacro(<<"No input data");
- return;
- }
- numPts = inPts->GetNumberOfPoints();
- numCells = input->GetNumberOfCells();
- newPts = vtkPoints::New();
- newPts->Allocate(numPts);
- this->UpdateProgress(.2);
- this->Transform->TransformPoints(inPts,newPts);
- this->UpdateProgress(.8);
- output->SetPoints(newPts);
- newPts->Delete();
- }
- outPD->PassData(pd);
- outCD->PassData(cd);
-}
-
-//=======================================================================
-
-SALOME_PassThroughFilter* SALOME_PassThroughFilter::New(){
- vtkObject* ret = vtkObjectFactory::CreateInstance("SALOME_PassThroughFilter");
- if(ret) return (SALOME_PassThroughFilter*)ret;
- return new SALOME_PassThroughFilter;
-}
-
-SALOME_PassThroughFilter::SALOME_PassThroughFilter(){
- myGeomFilter = vtkGeometryFilter::New();
-}
-
-SALOME_PassThroughFilter::~SALOME_PassThroughFilter(){
- myGeomFilter->Delete();
-}
-
-void SALOME_PassThroughFilter::Execute(){
- vtkDataSet *input = static_cast<vtkDataSet*>(this->GetInput());
- vtkDataSet *output = static_cast<vtkDataSet*>(this->GetOutput());
- output->CopyStructure( input );
- output->GetPointData()->PassData( input->GetPointData() );
- output->GetCellData()->PassData( input->GetCellData() );
-}
-
-void SALOME_PassThroughFilter::SetInput(vtkDataSet *input){
- myGeomFilter->SetInput(input);
- vtkDataSet *oldInput = this->GetInput();
- if(oldInput != NULL)
- if(input == NULL || oldInput->GetDataObjectType() != input->GetDataObjectType()){
- vtkWarningMacro("Changing input type. Deleting output");
- this->SetOutput(NULL);
- }
- if (input != NULL && this->vtkSource::GetOutput(0) == NULL){
- this->vtkSource::SetNthOutput(0, input->NewInstance());
- this->Outputs[0]->ReleaseData();
- this->Outputs[0]->Delete();
- }
- this->vtkProcessObject::SetNthInput(0, input);
-}
-
-vtkPolyData *SALOME_PassThroughFilter::GetPolyDataOutput() {
- vtkDataSet *ds = this->GetOutput();
- if(!ds) return NULL;
- if(ds->GetDataObjectType() == VTK_POLY_DATA) return (vtkPolyData *)ds;
- myGeomFilter->SetInput(this->GetOutput());
- return myGeomFilter->GetOutput();
-}
+++ /dev/null
-// File: SALOME_Transformation.hxx
-// Created: Wed Jun 4 09:39:09 2003
-// Author: Alexey PETROV
-// <apo@ivanox.nnov.matra-dtv.fr>
-
-
-#ifndef SALOME_Transform_HeaderFile
-#define SALOME_Transform_HeaderFile
-
-#include <math.h>
-
-#include <vtkTransform.h>
-#include <vtkTransformFilter.h>
-#include <vtkDataSetToDataSetFilter.h>
-class vtkGeometryFilter;
-
-//=======================================================================
-
-class VTK_EXPORT SALOME_Transform : public vtkTransform{
- public:
- static SALOME_Transform *New();
- vtkTypeMacro(SALOME_Transform,vtkTransform);
- void SetScale(float theScaleX, float theScaleY, float theScaleZ);
- int IsIdentity();
-protected:
- SALOME_Transform() {}
- ~SALOME_Transform() {}
- SALOME_Transform(const SALOME_Transform&) {}
- void operator=(const SALOME_Transform&) {}
-};
-
-//=======================================================================
-
-class VTK_EXPORT SALOME_TransformFilter : public vtkTransformFilter{
- public:
- static SALOME_TransformFilter *New();
- vtkTypeMacro(SALOME_TransformFilter,vtkTransformFilter);
-protected:
- SALOME_TransformFilter() {}
- ~SALOME_TransformFilter() {}
- SALOME_TransformFilter(const SALOME_TransformFilter&) {}
- void operator=(const SALOME_TransformFilter&) {}
- void Execute();
-};
-
-//=======================================================================
-
-class SALOME_PassThroughFilter : public vtkDataSetToDataSetFilter{
- public:
- vtkTypeMacro(SALOME_PassThroughFilter,vtkDataSetToDataSetFilter);
- static SALOME_PassThroughFilter *New();
- void SetInput(vtkDataSet *input);
- vtkPolyData *GetPolyDataOutput();
- protected:
- SALOME_PassThroughFilter();
- virtual ~SALOME_PassThroughFilter();
- void Execute();
- vtkGeometryFilter* myGeomFilter;
- private:
- SALOME_PassThroughFilter(const SALOME_PassThroughFilter&); // Not implemented.
- void operator=(const SALOME_PassThroughFilter&); // Not implemented.
-};
-
-//=======================================================================
-
-#endif
CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(OGL_INCLUDES) $(PYTHON_INCLUDES)
-LDFLAGS+=$(QT_MT_LIBS) $(OCC_KERNEL_LIBS) $(OCC_VIEWER_LIBS) $(OGL_LIBS)
+LDFLAGS+=$(QT_MT_LIBS) $(OGL_LIBS) -lSalomeGUI
@CONCLUDE@
SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(OGL_INCLUDES) $(PYTHON_INCLUDES) $(QWT_INCLUDES)
-LDFLAGS+=$(QT_MT_LIBS) $(OGL_LIBS) $(QWT_LIBS)
+LDFLAGS+=$(QT_MT_LIBS) $(OGL_LIBS) $(QWT_LIBS) -lSalomeGUI
@CONCLUDE@
*/
bool Plot2d_ViewFrame::isInViewer( const Handle(SALOME_InteractiveObject)& IObject )
{
- return ( getCurveByIO( IObject ) != NULL );
+ if( getCurveByIO( IObject ) != NULL )
+ return 1;
+ else{
+ if(!IObject.IsNull()){
+ QIntDictIterator<Plot2d_Curve> it(myCurves);
+ for(; it.current();++it){
+ if(it.current()->hasIO() && it.current()->getTableIO()->isSame(IObject))
+ return 1;
+ }}
+ }
+ return 0;
}
/*!
Returns true if interactive object is presented in the viewer and displayed
ASSERT(ptrSessionName) ;
ASSERT(strlen( ptrSessionName )>0) ;
const char *registryName = "Registry" ;
-
-
- try
- {
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- CORBA::ORB_var &orb = init( argc , argv ) ;
-
-
- SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
- naming.init_orb( orb ) ;
-
- RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance() ;
- ptrRegistry->SessionName( ptrSessionName ) ;
- Registry::Components_var varComponents = ptrRegistry->_this() ;
-
- // The RegistryService must not already exist.
-
- try
- {
- CORBA::Object_var pipo = naming.Resolve( registryName ) ;
- if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ;
- MESSAGE("RegistryService servant already existing" ) ;
- exit( EXIT_FAILURE ) ;
- }
- catch( const ServiceUnreachable &ex )
- {
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ CORBA::ORB_var &orb = init( argc , argv ) ;
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ Registry::Components_var varComponents;
+ int REGISTRY=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var manager;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ manager = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Registry Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
}
- catch( const CORBA::Exception &exx )
- {
- }
- string absoluteName = string("/") + registryName;
- naming.Register( varComponents , absoluteName.c_str() ) ;
-
-
- CORBA::Object_var poaObj = orb->resolve_initial_references( "RootPOA" ) ;
- PortableServer::POA_var poa = PortableServer::POA::_narrow(poaObj) ;
- PortableServer::POAManager_var manager = poa->the_POAManager() ;
-
-
- MESSAGE("On attend les requetes des clients") ;
- try
- {
- // Activation du POA
- MESSAGE("Activation du POA") ;
- manager->activate() ;
-
- // Lancement de l'ORB
- MESSAGE("Lancement de l'ORB") ;
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "Registry Server: Naming Service was found" )
+ if(EnvL==1){
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Registry Server: Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "Registry Server: Unknown exception" ) }
+
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "Registry Server: Logger Server was found" )
+ log->ping();
+ REGISTRY=1;
+ break;
+ }
+ }}
+ }
+ if ((REGISTRY==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+ //
+ try
+ {
+ naming.init_orb( orb ) ;
+ RegistryService *ptrRegistry = SINGLETON_<RegistryService>::Instance() ;
+ ptrRegistry->SessionName( ptrSessionName ) ;
+ varComponents = ptrRegistry->_this() ;
+ // The RegistryService must not already exist.
+
+ try
+ {
+ CORBA::Object_var pipo = naming.Resolve( registryName ) ;
+ if (CORBA::is_nil(pipo) ) throw ServiceUnreachable() ;
+ MESSAGE("RegistryService servant already existing" ) ;
+ exit( EXIT_FAILURE ) ;
+ }
+ catch( const ServiceUnreachable &ex )
+ {
+ }
+ catch( const CORBA::Exception &exx )
+ {
+ }
+ string absoluteName = string("/") + registryName;
+ naming.Register( varComponents , absoluteName.c_str() ) ;
+ MESSAGE("On attend les requetes des clients") ;
+ try
+ {
+ // Activation du POA
+ MESSAGE("Activation du POA") ;
+ manager->activate() ;
+
+ // Lancement de l'ORB
+ MESSAGE("Lancement de l'ORB") ;
#ifdef CHECKTIME
- Utils_Timer timer;
- timer.Start();
- timer.Stop();
- MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
- timer.ShowAbsolute();
+ Utils_Timer timer;
+ timer.Start();
+ timer.Stop();
+ MESSAGE("SALOME_Registry_Server.cxx - orb->run()");
+ timer.ShowAbsolute();
#endif
- orb->run() ;
- }
- catch( const CORBA::Exception &ex )
- {
- MESSAGE("Erreur systeme") ;
- return EXIT_FAILURE ;
- }
-
- }
- catch( const SALOME_Exception &ex )
- {
- MESSAGE( "Communication Error : " << ex.what() )
+ orb->run() ;
+ }
+ catch( const CORBA::Exception &ex )
+ {
+ MESSAGE("Erreur systeme") ;
return EXIT_FAILURE ;
- }
-
+ }
+
+ }
+ catch( const SALOME_Exception &ex )
+ {
+ MESSAGE( "Communication Error : " << ex.what() )
+ return EXIT_FAILURE ;
+ }
+
END_OF( argv[0] ) ;
return 0 ;
}
#include "SALOME_NamingService.hxx"
#include "SALOME_RessourcesCatalog_impl.hxx"
#include "utilities.h"
-
+# include "Utils_SINGLETON.hxx"
int main(int argc,char **argv)
{
try {
CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
// initialize POA
-
- CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
-
- PortableServer::POA_var poa = PortableServer::POA::_narrow (poaobj);
- PortableServer::POAManager_var mgr = poa->the_POAManager();
-
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int RESSOURCES_CATALOG=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var mgr;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ mgr = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Ressources Catalog: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ }
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "Ressources Catalog: Naming Service was found" )
+ if(EnvL==1){
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Ressources Catalog: Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "Ressources Catalog: Unknown exception" ) }
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "Ressources Catalog: Loger Server was found" )
+ log->ping();
+ RESSOURCES_CATALOG=1;
+ break;
+ }
+ }}
+ }
+ if ((RESSOURCES_CATALOG==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+ //
// Active catalog
-
+
SALOME_RessourcesCatalogImpl* Catalogue_i = new SALOME_RessourcesCatalogImpl(argc, argv);
poa->activate_object (Catalogue_i);
-
mgr->activate();
-
-
CORBA::Object_ptr myCata = Catalogue_i->_this();
// initialise Naming Service
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(OCC_KERNEL_LIBS) $(OCC_OCAF_LIBS) $(OCC_VIEWER_LIBS) $(OCC_MODELER_LIBS) $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSalomeLoggerServer $(CAS_LDPATH) -lTKCAF
@CONCLUDE@
#include CORBA_SERVER_HEADER(SALOMEDS)
#include "SALOMEDS_StudyManager_i.hxx"
#include "utilities.h"
-
+# include "Utils_SINGLETON.hxx"
+#include "SALOME_NamingService.hxx"
//#define CHECKTIME
#ifdef CHECKTIME
#include <Utils_Timer.hxx>
// Initialise the ORB.
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
omniORB::MaxMessageSize(100 * 1024 * 1024);
-
// Obtain a reference to the root POA.
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-
-
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ int SALOMEDS=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var pman;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ pman = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj)){
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "SalomeDS Server: Naming Service was found" )
+ if(EnvL==1){
+ CORBA::ORB_var orb1 = CORBA::ORB_init(argc,argv) ;
+ SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ NS.init_orb( orb1 ) ;
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);}
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "SalomeDS Server: Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "SalomeDS Server: Unknown exception" ) }
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "SalomeDS Server: Logger Server was found" )
+ log->ping();
+ SALOMEDS=1;
+ break;
+ }
+ }}
+ }}
+
+ }
+ catch( const SALOME_Exception &ex )
+ {
+ MESSAGE( "Communication Error : " << ex.what() )
+ return EXIT_FAILURE ;
+ }
+ if ((SALOMEDS==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+ //
+
// We allocate the objects on the heap. Since these are reference
// counted objects, they will be deleted by the POA when they are no
// longer needed.
// Obtain a POAManager, and tell the POA to start accepting
// requests on its objects.
- PortableServer::POAManager_var pman = poa->the_POAManager();
+ pman = poa->the_POAManager();
pman->activate();
#ifdef CHECKTIME
#---------------
msgid "INF_VERSION"
-msgstr "Version 1.2"
+msgstr "Version 1.3.0"
msgid "INF_COPYRIGHT"
msgstr " "
#: QAD_Application.cxx:133
msgid "QAD_Application::APP_DEFAULTTITLE"
-msgstr "SALOME 1.2"
+msgstr "SALOME 1.3.0"
#: QAD_Desktop.cxx:424
msgid "QAD_Desktop::DESK_DEFAULTTITLE"
-msgstr "SALOME 1.2"
+msgstr "SALOME 1.3.0"
QAD_FileDlg.h \
QAD_FileValidator.h \
QAD_Help.h \
- QAD_HelpWindow.h \
QAD_PyInterp.h \
QAD_LeftFrame.h \
QAD_ListMenuIdAction.h \
SALOMEGUI_SetValueDlg.h \
SALOMEGUI_SetupCurveDlg.h \
SALOMEGUI_CloseDlg.h
-
+
# .po files to transform in .qm
PO_FILES = \
QAD_FileDlg.cxx \
QAD_FileValidator.cxx \
QAD_Help.cxx \
- QAD_HelpWindow.cxx \
PyInterp_base.cxx \
QAD_PyInterp.cxx \
QAD_PyInterp_mono.cxx \
SALOME_DataMapNodeOfDataMapOfIOMapOfInteger_0.cxx \
SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger_0.cxx \
SALOMEGUI_TrihedronSizeDlg.cxx \
+ SALOMEGUI_ExternalBrowserDlg.cxx \
SALOMEGUI_LoadStudiesDlg.cxx \
SALOMEGUI_TableDlg.cxx \
SALOMEGUI_NameDlg.cxx \
SALOMEGUI_SetValueDlg.cxx \
SALOMEGUI_SetupCurveDlg.cxx \
- SALOMEGUI_CloseDlg.cxx
-
+ SALOMEGUI_CloseDlg.cxx \
+ SALOMEGUI_ActivateComponentDlg.cxx
LIB_MOC = \
SALOMEGUI_Application.h \
SALOMEGUI_Desktop.h \
QAD_Desktop.h \
QAD_DirListDlg.h \
QAD_FileDlg.h \
- QAD_HelpWindow.h \
QAD_ListView.h \
QAD_ObjectBrowser.h \
QAD_Operation.h \
SALOMEGUI_OpenWith.h \
SALOMEGUI_StudyPropertiesDlg.h \
SALOMEGUI_TrihedronSizeDlg.h \
+ SALOMEGUI_ExternalBrowserDlg.h \
SALOME_Selection.h \
SALOMEGUI_LoadStudiesDlg.h \
SALOMEGUI_ViewChoiceDlg.h \
SALOMEGUI_TableDlg.h \
SALOMEGUI_NameDlg.h \
SALOMEGUI_SetupCurveDlg.h \
- SALOMEGUI_CloseDlg.h
-
+ SALOMEGUI_CloseDlg.h \
+ SALOMEGUI_ActivateComponentDlg.h
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
SALOME_Exception.idl
-CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(QWT_INCLUDES)
-LDFLAGS+=$(QT_MT_LIBS) $(OCC_KERNEL_LIBS) $(VTK_LIBS) $(QWT_LIBS) -lSalomeNS -lqsplitterP -lSalomeLifeCycleCORBA -lOpUtil -lSalomeObject
+CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES)
+LDFLAGS+=$(QT_MT_LIBS) -lSalomeNS -lqsplitterP -lSalomeLifeCycleCORBA -lOpUtil -lSalomeObject
LIBS+= $(PYTHON_LIBS)
void QAD_Application::helpSearch()
{
/* just calls QAD_Desktop::helpSearch() but can have own implementation */
- getDesktop()->helpSearch();
+ // getDesktop()->helpSearch();
}
/*!
void QAD_Application::helpContents()
{
/* just calls QAD_Desktop::helpContents() but can have own implementation */
- getDesktop()->helpContents();
+ // getDesktop()->helpContents();
}
/*!
# include "Utils_SINGLETON.hxx"
#define INCLUDE_MENUITEM_DEF
+#define DEFAULT_BROWSER "mozilla"
+
#include "QAD.h"
#include "QAD_Help.h"
#include "QAD_ObjectBrowser.h"
#include "QAD_Resource.h"
#include "QAD_FileDlg.h"
-#include "QAD_HelpWindow.h"
+//NRI#include "QAD_HelpWindow.h"
#include "QAD_DirListDlg.h"
#include "QAD_WaitCursor.h"
#include "SALOMEGUI_OpenWith.h"
#include "SALOMEGUI_StudyPropertiesDlg.h"
#include "SALOMEGUI_TrihedronSizeDlg.h"
+#include "SALOMEGUI_ExternalBrowserDlg.h"
#include "SALOMEGUI_LoadStudiesDlg.h"
#include "SALOME_Selection.h"
#include "SALOME_InteractiveObject.hxx"
#include "utilities.h"
#include "SALOMEGUI_CloseDlg.h"
+#include "SALOMEGUI_ActivateComponentDlg.h"
// QT Includes
#include <qlabel.h>
#include <qfontdialog.h>
#include <qlineedit.h>
#include <qdatetime.h>
+#include <qthread.h>
#if QT_VERSION > 300
#include <qlistbox.h>
myActiveApp(0),
myActiveStudy(0),
myCntUntitled(0),
-myHelpWindow(0),
+//NRImyHelpWindow(0),
myDefaultTitle( tr("DESK_DEFAULTTITLE") ),
myQueryClose( true )
{
myToolBarAction.clear();
myApps.clear();
delete resourceMgr;
- if (myHelpWindow)
- myHelpWindow->close();
+//NRI if (myHelpWindow)
+// myHelpWindow->close();
resourceMgr = 0;
QAD_Application::desktop = 0;
}
*/
bool QAD_Desktop::eventFilter( QObject* o, QEvent* e )
{
- if ( e->type() == QEvent::ContextMenu ) {
- QContextMenuEvent* ce = (QContextMenuEvent*)e;
- if ( o->inherits("QRenameEdit") ) {
+ if (e->type() == 2000 ) {
+ QMessageBox::information (this, tr ( "Help Information" ), tr ( "Can't run choosen browser.\nRunning default browser (Mozilla). "));
+ return TRUE;
+ }
+ else if (e->type() == 2001 ) {
+ QMessageBox::critical(this, tr ( "Help Error" ), tr ( "Can't run the default browser.") );
+ return TRUE;
+ }
+ else if ( e->type() == QEvent::ContextMenu ) {
+ QContextMenuEvent* ce = (QContextMenuEvent*)e;
+ if ( o->inherits("QRenameEdit") ) {
return TRUE;
}
else if ( o->inherits("QLineEdit") ) {
myMainMenu->insertItem ( tr("MEN_DESK_VIEW"), &myViewPopup, 2 ); /* add popup VIEW */
myMainMenu->insertItem ( tr("MEN_DESK_TOOLS"), &myToolsPopup, 5 ); /* add popup TOOLS */
myMainMenu->insertItem ( tr("MEN_DESK_PREF"), &myPrefPopup, 4 ); /* add popup PREF */
- myMainMenu->insertItem ( tr("MEN_DESK_WINDOW"), &myWindowPopup, 6 ); /* add popup WINDOW */
+ myMainMenu->insertItem ( tr("MEN_DESK_WINDOW"), &myWindowPopup, 6 );/* add popup WINDOW */
myMainMenu->insertItem ( tr("MEN_DESK_HELP"), &myHelpPopup, 7 ); /* add popup HELP */
/* Applications will insert their items after 'File' 'Edit' and 'View'
myPrefPopup.insertSeparator();
+ /* External Browser */
+ QActionP* externalBrowserAction = new QActionP( "", tr("MEN_DESK_PREF_EXTERNAL_BROWSER"), 0, this );
+ QAD_ASSERT(connect( externalBrowserAction, SIGNAL(activated()), this, SLOT(onExternalBrowser() )));
+ externalBrowserAction->addTo( &myPrefPopup );
+ myStdActions.insert( PrefExternalBrowserId, externalBrowserAction );
+
+ myPrefPopup.insertSeparator();
/* BrowserPopup */
myPrefPopup.insertItem( tr("MEN_DESK_PREF_OBJECTBROWSER"), &myObjBrowserPopup );
this, SLOT( onHelpContents() )));
helpContentsAction->addTo( &myHelpPopup );
myStdActions.insert( HelpContentsId , helpContentsAction );
+
+ id = myHelpPopup.insertSeparator();
+
+ /* GUI contents */
+ // NRI : Temporary commented
+
+// QActionP* helpContentsActionGUI = new QActionP( "", tr("MEN_DESK_HELP_GUICONTENTS"), 0, this );
+// helpContentsActionGUI->setStatusTip ( tr("PRP_DESK_HELP_GUICONTENTS") );
+// QAD_ASSERT(connect( helpContentsActionGUI, SIGNAL(activated()),
+// this, SLOT( onHelpContentsGUI() )));
+// helpContentsActionGUI->addTo( &myHelpPopup );
+// myStdActions.insert( HelpContentsId , helpContentsActionGUI );
+
+ /* TUI contents */
+ QActionP* helpContentsActionTUI = new QActionP( "", tr("MEN_DESK_HELP_TUICONTENTS"), 0, this );
+ helpContentsActionTUI->setStatusTip ( tr("PRP_DESK_HELP_TUICONTENTS") );
+ QAD_ASSERT(connect( helpContentsActionTUI, SIGNAL(activated()),
+ this, SLOT( onHelpContentsTUI() )));
+ helpContentsActionTUI->addTo( &myHelpPopup );
+ myStdActions.insert( HelpContentsId , helpContentsActionTUI );
/* search */
// QActionP* helpSearchAction = new QActionP( "", tr("MEN_DESK_HELP_SEARCH"), 0, this );
else
{ /* default icon and title */
setIcon( myDefaultIcon );
+ qApp->processEvents();
setCaption( myDefaultTitle );
}
}
return "";
}
-/*!
- gets application Help Window (and creates if necessary)
-*/
-QAD_HelpWindow* QAD_Desktop::getHelpWindow()
-{
- if (!myHelpWindow) {
- myHelpWindow = new QAD_HelpWindow();
+// /*!
+// gets application Help Window (and creates if necessary)
+// */
+// QAD_HelpWindow* QAD_Desktop::getHelpWindow()
+// {
+// if (!myHelpWindow) {
+// myHelpWindow = new QAD_HelpWindow();
- QMap<QString,QString>::Iterator it;
- for( it = mapComponentName.begin(); it != mapComponentName.end(); ++it ) {
- QCString dir;
- QString root;
+// QMap<QString,QString>::Iterator it;
+// for( it = mapComponentName.begin(); it != mapComponentName.end(); ++it ) {
+// QCString dir;
+// QString root;
- // look for index.html and set homeDir
- // 1. $(MODULE_ROOT_DIR)/doc/index.html
- // 2. $(MODULE_ROOT_DIR)/doc/html/index.html
- // 3. $(MODULE_ROOT_DIR)/doc/html/html/index.html
-
- if (dir = getenv( QString( it.data() + "_ROOT_DIR")) ) {
- root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- helpContext( root + "index.html", "" );
- }
- else {
- root = QAD_Tools::addSlash( root + "html" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- helpContext( root + "index.html", "" );
- }
- else {
- root = QAD_Tools::addSlash( root + "html" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- helpContext( root + "index.html", "" );
- }
- }
- }
- }
- }
+// // look for index.html and set homeDir
+// // 1. $(MODULE_ROOT_DIR)/doc/index.html
+// // 2. $(MODULE_ROOT_DIR)/doc/html/index.html
+// // 3. $(MODULE_ROOT_DIR)/doc/html/html/index.html
+
+// if (dir = getenv( QString( it.data() + "_ROOT_DIR")) ) {
+// root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" );
+// if ( QFileInfo( root + "index.html" ).exists() ) {
+// helpContext( root + "index.html", "" );
+// }
+// else {
+// root = QAD_Tools::addSlash( root + "html" );
+// if ( QFileInfo( root + "index.html" ).exists() ) {
+// helpContext( root + "index.html", "" );
+// }
+// else {
+// root = QAD_Tools::addSlash( root + "html" );
+// if ( QFileInfo( root + "index.html" ).exists() ) {
+// helpContext( root + "index.html", "" );
+// }
+// }
+// }
+// }
+// }
- connect(myHelpWindow, SIGNAL(helpWindowClosed()), this, SLOT(onHelpWindowClosed()));
- }
- return myHelpWindow;
-}
+// connect(myHelpWindow, SIGNAL(helpWindowClosed()), this, SLOT(onHelpWindowClosed()));
+// }
+// return myHelpWindow;
+// }
/*!
Called when desktop is closing
it.current()->resize((int)(0.8*w), (int)(0.8*h));
}
-/*!
- called when help window closed
-*/
-void QAD_Desktop::onHelpWindowClosed()
-{
- myHelpWindow = 0;
-}
+// /*!
+// called when help window closed
+// */
+// void QAD_Desktop::onHelpWindowClosed()
+// {
+// myHelpWindow = 0;
+// }
/*!
Called when 'view status bar' option
//NRI : SAL2214
}
+// Helps to execute command
+class RunBrowser: public QThread {
+public:
+
+ RunBrowser(QString theApp, QString theParams, QString theHelpFile):
+ myApp(theApp), myParams(theParams), myHelpFile(theHelpFile), myStatus(0) {};
+
+ virtual void run()
+ {
+ QString aCommand;
+
+ if ( !myApp.isEmpty())
+ {
+ aCommand.sprintf("%s %s %s",myApp.latin1(),myParams.latin1(),myHelpFile.latin1());
+ myStatus = system(aCommand);
+ if(myStatus != 0)
+ {
+ QCustomEvent* ce2000 = new QCustomEvent (2000);
+ postEvent (qApp, ce2000);
+ }
+ }
+
+ if( myStatus != 0 || myApp.isEmpty())
+ {
+ myParams = "";
+ aCommand.sprintf("%s %s %s", QString(DEFAULT_BROWSER).latin1(),myParams.latin1(), myHelpFile.latin1());
+ myStatus = system(aCommand);
+ if(myStatus != 0)
+ {
+ QCustomEvent* ce2001 = new QCustomEvent (2001);
+ postEvent (qApp, ce2001);
+ }
+ }
+ }
+
+private:
+ QString myApp;
+ QString myParams;
+ QString myHelpFile;
+ int myStatus;
+
+};
+
/*!
Called on 'help\contents'
*/
void QAD_Desktop::onHelpContents()
+{ if (myActiveComp == "")
+ myActiveComp = getComponentUserName( "KERNEL" ); //NRI "Salome";
+
+ QCString dir;
+ QString root;
+ QString homeDir;
+ if (dir = getenv( getComponentName( myActiveComp ) + "_ROOT_DIR")) {
+ root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + QAD_Tools::addSlash("doc") + "html" );
+ if ( QFileInfo( root + "index.html" ).exists() ) {
+ homeDir = root;
+ } else {
+ QMessageBox::warning( this, tr("WRN_WARNING"),
+ QString( "%1index.html doesn't exist." ).arg(root), tr ("BUT_OK") );
+ return;
+ }
+ }
+
+ QString helpFile = QFileInfo( homeDir + "index.html" ).absFilePath();
+
+ QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
+ QString aParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
+
+ RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile);
+ rs->start();
+}
+
+/*!
+ Called on 'help\GUI Reference'
+*/
+void QAD_Desktop::onHelpContentsGUI()
{
- if (myActiveApp)
- myActiveApp->helpContents();
- else
- helpContents();
+
+// QCString dir;
+// QString root;
+// QString homeDir;
+
+// if ( (dir = getenv("KERNEL_ROOT_DIR")) ) {
+// root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + "doc" );
+// root = QAD_Tools::addSlash( root + "guihtml" );
+// root = QAD_Tools::addSlash( root + "guihtml" );
+// if ( QFileInfo( root + "salomedoc.html" ).exists() ) {
+// homeDir = root;
+// }
+// }
+// if ( root.isEmpty() ) {
+// if ( QFileInfo( "/usr/local/doc/guihtml/salomedoc.html" ).exists() ) {
+// homeDir = "/usr/local/doc/guihtml/";
+// }
+// }
+// if ( root.isEmpty() )
+// root = "./doc/";
+
+// QString helpFile = QFileInfo( homeDir + "salomedoc.html" ).absFilePath();
+
+// QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
+// QString aParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
+
+// RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile);
+// rs->start();
+
}
/*!
- Called on 'help\search'
+ Called on 'help\TUI Reference'
*/
-void QAD_Desktop::onHelpSearch()
+void QAD_Desktop::onHelpContentsTUI()
{
- if (myActiveApp)
- myActiveApp->helpSearch();
- else
- helpSearch();
+ if (myActiveComp == "")
+ myActiveComp = getComponentUserName( "KERNEL" ); //NRI "Salome";
+
+ QCString dir;
+ QString root;
+ QString homeDir;
+ if (dir = getenv( getComponentName( myActiveComp ) + "_ROOT_DIR")) {
+ root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + QAD_Tools::addSlash("doc") + "html" );
+ if ( QFileInfo( root + "index.html" ).exists() ) {
+ homeDir = root;
+ } else {
+ QMessageBox::warning( this, tr("WRN_WARNING"),
+ QString( "%1index.html doesn't exist." ).arg(root), tr ("BUT_OK") );
+ return;
+ }
+ }
+
+ QString helpFile = QFileInfo( homeDir + "index.html" ).absFilePath();
+
+ QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
+ QString aParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
+
+ RunBrowser* rs = new RunBrowser(anApp, aParams, helpFile);
+ rs->start();
}
+// /*!
+// Called on 'help\search'
+// */
+// void QAD_Desktop::onHelpSearch()
+// {
+// if (myActiveApp)
+// myActiveApp->helpSearch();
+// else
+// helpSearch();
+// }
+
/*!
Called on 'help\about'
*/
bool libToolsGUI = true;
if( QAD_XmlHandler::_bibmap[ id ].isEmpty() )
{
-
- if ( dir = getenv("SALOME_SITE_DIR")) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libToolsGUI.dll" ;
-#else
- dir = dir + "libToolsGUI.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir );
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ToolsLib = fileInfo.fileName() ;
- found = true;
- }
- }
-
- if ( (dir = getenv("SALOME_ROOT_DIR")) && !found ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libToolsGUI.dll" ;
-#else
- dir = dir + "libToolsGUI.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir );
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ToolsLib = fileInfo.fileName() ;
- found = true;
- }
- }
-
if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) {
dir = QAD_Tools::addSlash(dir) ;
dir = dir + "lib" ;
else {
libToolsGUI = false;
SCRUTE( QAD_XmlHandler::_bibmap[ id ] ) ;
- if ( dir = getenv("SALOME_SITE_DIR")) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + QAD_XmlHandler::_bibmap[ id ].latin1() ;
- MESSAGE ( " GUI library = " << dir );
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ToolsLib = fileInfo.fileName() ;
- found = true;
- }
- }
-
- if ( (dir = getenv("SALOME_ROOT_DIR")) && !found ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + QAD_XmlHandler::_bibmap[ id ].latin1() ;
- MESSAGE ( " GUI library = " << dir );
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ToolsLib = fileInfo.fileName() ;
- found = true;
- }
- }
-
if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) {
dir = QAD_Tools::addSlash(dir) ;
dir = dir + "lib" ;
aButton->setOn(true);
}
}
- } else {
- QMessageBox::critical( 0,
- tr( "ERR_ERROR" ),
- tr( "WRN_LOAD_COMPONENT" ) );
- myCombo->setCurrentItem (0);
- for ( QToolButton* aButton=myComponentButton.first(); aButton; aButton=myComponentButton.next() ) {
- aButton->setOn(false);
- }
- }
+ } else if (component.compare(QString("Salome"))!= 0) {
+
+ SALOMEGUI_ActivateComponentDlg aDlg( this );
+ int res = aDlg.exec();
+
+ switch ( res )
+ {
+ case 1:
+ onNewStudy();
+ onComboActiveComponent(component,true);
+ break;
+ case 2:
+ onOpenStudy();
+ onComboActiveComponent(component,true);
+ break;
+ case 3:
+ onLoadStudy();
+ onComboActiveComponent(component,true);;
+ break;
+ case 0:
+ default:
+ putInfo( tr("INF_CANCELLED") );
+ myCombo->setCurrentItem (0);
+ for ( QToolButton* aButton=myComponentButton.first(); aButton; aButton=myComponentButton.next() ) {
+ aButton->setOn(false);
+ // return;
+ }
+ }
+ }
}
/*!
}
}
+void QAD_Desktop::onExternalBrowser()
+{
+
+ QString theApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
+ QString theParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
+
+ SALOMEGUI_ExternalBrowserDlg *Dlg = new SALOMEGUI_ExternalBrowserDlg(this);
+
+ if (!theApp.isEmpty())
+ {
+ QString theParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
+ Dlg->setSettings(theApp, theParams);
+ }
+ int r = Dlg->exec();
+ QString theAppFromDialog = Dlg->getApp();
+ QString theParamsFromDialog = Dlg->getParams();
+ delete Dlg;
+
+ if (r == QDialog::Accepted)
+ {
+ QAD_CONFIG->addSetting("ExternalBrowser:Application", theAppFromDialog );
+ QAD_CONFIG->addSetting("ExternalBrowser:Parameters", theParamsFromDialog );
+ }
+
+}
+
+
void QAD_Desktop::onDirList()
{
// getting dir list from settings
delete About;
}
-/* Help Search */
-void QAD_Desktop::helpSearch()
-{
-}
-
-/* Help Contents */
-void QAD_Desktop::helpContents()
-{
- if (myActiveComp == "")
- myActiveComp = getComponentUserName( "KERNEL" ); //NRI "Salome";
-
- QCString dir;
- QString root;
- if (dir = getenv( getComponentName( myActiveComp ) + "_ROOT_DIR")) {
- root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- helpContext( root + "index.html", "" );
- }
- else {
- root = QAD_Tools::addSlash( root + "html" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- helpContext( root + "index.html", "" );
- }
- else {
- root = QAD_Tools::addSlash( root + "html" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- helpContext( root + "index.html", "" );
- }
- }
- }
- }
+// /* Help Search */
+// void QAD_Desktop::helpSearch()
+// {
+// }
+
+// /* Help Contents */
+// void QAD_Desktop::helpContents()
+// {
+// if (myActiveComp == "")
+// myActiveComp = getComponentUserName( "KERNEL" ); //NRI "Salome";
+
+// QCString dir;
+// QString root;
+// if (dir = getenv( getComponentName( myActiveComp ) + "_ROOT_DIR")) {
+// root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" );
+// if ( QFileInfo( root + "index.html" ).exists() ) {
+// helpContext( root + "index.html", "" );
+// }
+// else {
+// root = QAD_Tools::addSlash( root + "html" );
+// if ( QFileInfo( root + "index.html" ).exists() ) {
+// helpContext( root + "index.html", "" );
+// }
+// else {
+// root = QAD_Tools::addSlash( root + "html" );
+// if ( QFileInfo( root + "index.html" ).exists() ) {
+// helpContext( root + "index.html", "" );
+// }
+// }
+// }
+// }
- //NRI getHelpWindow()->contents();
- getHelpWindow()->show();
- getHelpWindow()->raise();
- getHelpWindow()->setActiveWindow();
-}
+// // //NRI getHelpWindow()->contents();
+// // getHelpWindow()->show();
+// // getHelpWindow()->raise();
+// // getHelpWindow()->setActiveWindow();
+// }
/* Help Context */
-void QAD_Desktop::helpContext(const QString& source, const QString& context)
-{
- getHelpWindow()->context(source, context);
- getHelpWindow()->show();
- getHelpWindow()->raise();
- getHelpWindow()->setActiveWindow();
-}
+// void QAD_Desktop::helpContext(const QString& source, const QString& context)
+// {
+// // getHelpWindow()->context(source, context);
+// // getHelpWindow()->show();
+// // getHelpWindow()->raise();
+// // getHelpWindow()->setActiveWindow();
+// }
/* Preferences/MultiFile Save */
void QAD_Desktop::onMultiFileSave()
#include "QAD_Application.h"
#include "QAD_OperatorMenus.h"
#include "QAD_Menus.h"
-#include "QAD_HelpWindow.h"
+//NRI #include "QAD_HelpWindow.h"
#include "QAD_Action.h"
#include "SALOME_NamingService.hxx"
//VRV: T2.5 - add default viewer
PrefViewerTrihedronId, PrefConsoleFontId, PrefObjectBrowserEntryId,
PrefObjectBrowserIAPPId, PrefObjectBrowserValueId, PrefObjectBrowserCHRONO_SORTId,
- PrefDirsId, PrefMultiFileSave, PrefASCIISave, PrefSaveId,
+ PrefDirsId, PrefMultiFileSave, PrefASCIISave, PrefExternalBrowserId, PrefSaveId,
//NRI : SAL2214
WindowNew3dId, ViewOCCId, ViewVTKId, ViewPlot2dId,
//NRI : SAL2214
/* help actions */
virtual void helpAbout();
- virtual void helpSearch();
- virtual void helpContents();
- virtual void helpContext(const QString& path, const QString& dir = QString::null);
+/* virtual void helpSearch(); */
+/* virtual void helpContents(); */
+/* virtual void helpContext(const QString& path, const QString& dir = QString::null); */
bool loadComponent(QString);
void activateComponent(const QString& theName, bool isLoadData = true);
QString getComponentName(const char *componentUserName);
QString getComponentUserName(const char *componentName);
- QAD_HelpWindow* getHelpWindow();
+ //NRI QAD_HelpWindow* getHelpWindow();
void onMouseMove(QMouseEvent*);
bool onMousePress(QMouseEvent*);
void onObjectBrowser();
void onMultiFileSave();
void onASCIISave();
+ void onExternalBrowser();
void onActivateApp(QAD_Application* app);
void onDeactivateApp(QAD_Application* app);
void onHelpContents();
- void onHelpSearch();
+ void onHelpContentsGUI();
+ void onHelpContentsTUI();
+/* void onHelpSearch(); */
void onHelpAbout();
void onNewWindow3d();
void onComboActiveComponent( const QString & , bool isLoadData);
void onCascade();
- void onHelpWindowClosed();
+ //NRI void onHelpWindowClosed();
protected:
QMenuBar* myMainMenu; /* the main menu bar */
QList<QAD_Menus> myMenusList;
QAD_Menus* myActiveMenus;
- QAD_HelpWindow* myHelpWindow;
+ //NRI QAD_HelpWindow* myHelpWindow;
QList<QToolButton> myComponentButton;
id = popup->insertItem( tr( "EDIT_SELECTALL_CMD" ) );
idMap.insert(IdSelectAll, id);
popup->setItemEnabled( idMap[ IdCopy ], hasMarkedText() );
- popup->setItemEnabled( idMap[ IdSelectAll ],
- (bool)text().length() && !allSelected );
-
+ popup->setItemEnabled( idMap[ IdSelectAll ], !allSelected );
+ popup->setItemEnabled( idMap[ IdClear ], textLine(1)!=myPrompt );
+
int r = popup->exec( event->globalPos() );
delete popup;
*/
void QAD_ObjectBrowser::Update()
{
+ int x = myListView->contentsX();
+ int y = myListView->contentsY();
+
myListView->clear();
myListViewMap.clear();
}
/* Updating UseCase Browser ============================================= */
UpdateUseCaseBrowser();
+
+ myListView->setContentsPos(x,y);
}
/*!
}
case Key_Up:
{
- // if Cntr+Key_Up event then scroll the commands stack up
+ // if Cntr+Key_Up event then move cursor up
if (ctrlPressed) {
- QString histLine = _currentPrompt;
+ QMultiLineEdit::cursorUp( );
+ }
+ // if Shift+Key_Up event then move cursor up and select the text
+ else if ( shftPressed && curLine > 0 ){
+ setCursorPosition(curLine-1, curCol, true);
+ }
+ // scroll the commands stack up
+ else {
+ QString histLine = _currentPrompt;
if (! _isInHistory)
{
_isInHistory = true;
endLine = numLines() -1;
setCursorPosition(endLine, lineLength(endLine));
}
- // if Shift+Key_Up event then move cursor up and select the text
- else if ( shftPressed && curLine > 0 ){
- setCursorPosition(curLine-1, curCol, true);
- }
- // move cursor up
- else { QMultiLineEdit::keyPressEvent( e ); }
break;
}
case Key_Down:
{
- // if Cntr+Key_Down event then scroll the commands stack down
+ // if Cntr+Key_Down event then move cursor down
if (ctrlPressed) {
- QString histLine = _currentPrompt;
+ QMultiLineEdit::cursorDown( );
+ }
+ // if Shift+Key_Down event then move cursor down and select the text
+ else if ( shftPressed && curLine < endLine ) {
+ setCursorPosition(curLine+1, curCol, true);
+ }
+ // scroll the commands stack down
+ else {
+ QString histLine = _currentPrompt;
QString nextCommand = _interp->getNext();
if (nextCommand.compare(TOP_HISTORY_PY) != 0)
{
endLine = numLines() -1;
setCursorPosition(endLine, lineLength(endLine));
}
- // if Shift+Key_Down event then move cursor down and select the text
- else if ( shftPressed && curLine < endLine ) {
- setCursorPosition(curLine+1, curCol, true);
- }
- //move cursor down
- else { QMultiLineEdit::keyPressEvent( e ); }
-
break;
}
case Key_Left:
Collects list of directories, separated by ';' where resources for module 'prefix'
can be situated
The order is following :
+ - <prefix>_ROOT_DIR/share/salome/resources directory
- CSF_<prefix>Resources env.var directory ( or directory list )
- - CSF_ResourcesDefaults env.var directory ( or directory list )
- ${HOME}/.salome/resources directory
- - ${SALOME_SITE_DIR}/share/salome/resources directory
- - ${SALOME_ROOT_DIR}/share/salome/resources directory
+ - KERNEL_ROOT_DIR/share/salome/resources directory
*/
QString QAD_ResourceMgr::collectDirs( const QString& prefix ) const
{
dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
}
}
- // Try CSF_ResourcesDefaults env.var directory ( or directory list )
- cenv = getenv( "CSF_ResourcesDefaults" );
- if ( cenv ) {
- dir.sprintf( "%s", cenv );
- if ( !dir.isEmpty() )
- dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
- }
// Try ${HOME}/.salome/resources directory
cenv = getenv( "HOME" );
if ( cenv ) {
dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
}
}
- // Try ${SALOME_SITE_DIR}/share/salome/resources directory
- cenv = getenv( "SALOME_SITE_DIR" );
- if ( cenv ) {
- dir.sprintf( "%s", cenv );
- if ( !dir.isEmpty() ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "share" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "resources" ;
- dir = QAD_Tools::addSlash(dir) ;
- dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
- }
- }
- // Try ${SALOME_ROOT_DIR}/share/salome/resources directory
- cenv = getenv( "SALOME_ROOT_DIR" );
- if ( cenv ) {
- dir.sprintf( "%s", cenv );
- if ( !dir.isEmpty() ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "share" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "resources" ;
- dir = QAD_Tools::addSlash(dir) ;
- dirList.append( dirList.isEmpty() ? dir : ( QString( SEPARATOR ) + dir ) );
- }
- }
// Try ${KERNEL_ROOT_DIR}/share/salome/resources directory
cenv = getenv( "KERNEL_ROOT_DIR" );
QCString dir;
QFileInfo fileInfo ;
bool found = false;
- if (myViewType == VIEW_OCC) {
- if ( dir = getenv("SALOME_SITE_DIR")) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libOCCViewer.dll" ;
-#else
- dir = dir + "libOCCViewer.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName();
- found = true;
- MESSAGE (" Found ")
- } else
- MESSAGE (" Not found ")
- }
-
- if ( (dir = getenv("SALOME_ROOT_DIR")) && !found ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libOCCViewer.dll" ;
-#else
- dir = dir + "libOCCViewer.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName();
- found = true;
- MESSAGE (" Found ")
- } else
- MESSAGE (" Not found ")
- }
-
+ if (myViewType == VIEW_OCC) {
if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) {
dir = QAD_Tools::addSlash(dir) ;
dir = dir + "lib" ;
MESSAGE (" Not found ")
}
} else if (myViewType == VIEW_VTK) {
-
- if ( dir = getenv("SALOME_SITE_DIR")) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libVTKViewer.dll" ;
-#else
- dir = dir + "libVTKViewer.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir );
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName();
- found = true;
- MESSAGE (" Found ");
- } else
- MESSAGE (" Not found ");
- }
-
- if ( (dir = getenv("SALOME_ROOT_DIR")) && !found ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libVTKViewer.dll" ;
-#else
- dir = dir + "libVTKViewer.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir );
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName();
- found = true;
- MESSAGE (" Found ");
- } else
- MESSAGE (" Not found ");
- }
-
if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) {
dir = QAD_Tools::addSlash(dir) ;
dir = dir + "lib" ;
MESSAGE (" Not found ");
}
} else if (myViewType == VIEW_GRAPHSUPERV) {
- if ( dir = getenv("SALOME_SITE_DIR")){
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libSUPERVGraph.dll" ;
-#else
- dir = dir + "libSUPERVGraph.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName() ;
- found = true;
- MESSAGE (" Found ")
- } else
- MESSAGE (" Not found ")
- }
-
- if ( (dir = getenv("SALOME_ROOT_DIR")) && !found ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libSUPERVGraph.dll" ;
-#else
- dir = dir + "libSUPERVGraph.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName() ;
- found = true;
- MESSAGE (" Found ")
- } else
- MESSAGE (" Not found ")
- }
-
if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) {
dir = QAD_Tools::addSlash(dir) ;
dir = dir + "lib" ;
MESSAGE (" Not found ")
}
} else if (myViewType == VIEW_PLOT2D) {
- if ( dir = getenv("SALOME_SITE_DIR")){
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libPlot2d.dll" ;
-#else
- dir = dir + "libPlot2d.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName() ;
- found = true;
- MESSAGE (" Found ")
- } else
- MESSAGE (" Not found ")
- }
-
- if ( (dir = getenv("SALOME_ROOT_DIR")) && !found ) {
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "salome" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "libPlot2d.dll" ;
-#else
- dir = dir + "libPlot2d.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName() ;
- found = true;
- MESSAGE (" Found ")
- } else
- MESSAGE (" Not found ")
- }
-
if ( (dir = getenv("KERNEL_ROOT_DIR")) && !found ) {
dir = QAD_Tools::addSlash(dir) ;
dir = dir + "lib" ;
msgid "ICON_HELP"
msgstr "help.png"
-msgid "QAD_HelpWindow::ICON_APP_HELP_BACK"
-msgstr "back.xpm"
-
-msgid "QAD_HelpWindow::ICON_APP_HELP_FORWARD"
-msgstr "forward.xpm"
-
-msgid "QAD_HelpWindow::ICON_APP_HELP_HOME"
-msgstr "home.xpm"
-
#--------------
# VIEW
#--------------
msgid "QAD_Desktop::MEN_DESK_HELP_CONTENTS"
msgstr "&Contents"
+#: QAD_Desktop.cxx:265
+msgid "QAD_Desktop::MEN_DESK_HELP_GUICONTENTS"
+msgstr "&GUI Reference"
+
+#: QAD_Desktop.cxx:265
+msgid "QAD_Desktop::MEN_DESK_HELP_TUICONTENTS"
+msgstr "&TUI Reference"
+
#: QAD_Desktop.cxx:273
msgid "QAD_Desktop::MEN_DESK_HELP_SEARCH"
msgstr "&Search ..."
msgid "MEN_DESK_PREF_VIEWER_TRIHEDRON"
msgstr "Trihedron size"
+#: QAD_Desktop.cxx:747
+msgid "MEN_DESK_PREF_EXTERNAL_BROWSER"
+msgstr "External browser"
+
msgid "MEN_DESK_PREF_DEFAULT_VIEWER"
msgstr "Default viewer"
msgid "QAD_Desktop::PRP_DESK_HELP_CONTENTS"
msgstr "Shows the whole help contents"
+#: QAD_Desktop.cxx:266
+msgid "QAD_Desktop::PRP_DESK_HELP_GUICONTENTS"
+msgstr "Shows the GUI help contents"
+
+#: QAD_Desktop.cxx:266
+msgid "QAD_Desktop::PRP_DESK_HELP_TUICONTENTS"
+msgstr "Shows the TUI help contents"
+
#: QAD_Desktop.cxx:274
msgid "QAD_Desktop::PRP_DESK_HELP_SEARCH"
msgstr "Searches help for a topic"
# TOOL TIP
#---------------
-#: QAD_HelpWindow.cxx:57
-msgid "QAD_HelpWindow::TOT_HELPWINDOW_BACKWARD"
-msgstr "Backward"
-
-#: QAD_HelpWindow.cxx:60
-msgid "QAD_HelpWindow::TOT_HELPWINDOW_FORWARD"
-msgstr "Forward"
-
-#: QAD_HelpWindow.cxx:63
-msgid "QAD_HelpWindow::TOT_HELPWINDOW_HOME"
-msgstr "Home"
-
-msgid "QAD_HelpWindow::QAD_HELP_CONTENTS"
-msgstr "Contents"
-
#: QAD_Application.cxx:173
msgid "QAD_Application::TOT_APP_EDIT_REDO"
msgstr "Redo last operation"
msgid "WRN_WARNING"
msgstr "Warning"
-#: QAD_Desktop.cxx:1072
-msgid "QAD_Desktop::WRN_LOAD_COMPONENT"
-msgstr "Creates or opens before a study"
-
msgid "WRN_STUDY_LOCKED"
msgstr "This study is locked and therefore cannot be modified"
# TOOL TIP
#---------------
-#: QAD_HelpWindow.cxx:57
-msgid "QAD_HelpWindow::TOT_HELPWINDOW_BACKWARD"
-msgstr "Avant"
-
-#: QAD_HelpWindow.cxx:60
-msgid "QAD_HelpWindow::TOT_HELPWINDOW_FORWARD"
-msgstr "Apres"
-
-#: QAD_HelpWindow.cxx:63
-msgid "QAD_HelpWindow::TOT_HELPWINDOW_HOME"
-msgstr "Home"
-
#: QAD_Application.cxx:173
msgid "QAD_Application::TOT_APP_EDIT_REDO"
msgstr "Répéter l'opération"
QCString dir;
QFileInfo fileInfo ;
bool found = false;
- if ( getenv("SALOME_SITE_DIR") ) {
- dir.fill('\0');
- dir.sprintf("%s",getenv("SALOME_SITE_DIR"));
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "lib" + parentComp.latin1() + "GUI.dll" ;
-#else
- dir = dir + "lib" + parentComp.latin1() + "GUI.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName();
- found = true;
- MESSAGE ( " found " )
- } else {
- MESSAGE ( " Not found " )
- }
- }
- if ( !found && getenv("SALOME_ROOT_DIR") ) {
- dir.fill('\0');
- dir.sprintf("%s", getenv("SALOME_ROOT_DIR"));
- dir = QAD_Tools::addSlash(dir) ;
- dir = dir + "lib" ;
- dir = QAD_Tools::addSlash(dir) ;
-#ifdef WNT
- dir = dir + "lib" + parentComp.latin1() + "GUI.dll" ;
-#else
- dir = dir + "lib" + parentComp.latin1() + "GUI.so" ;
-#endif
- MESSAGE ( " GUI library = " << dir )
- fileInfo.setFile(dir) ;
- if (fileInfo.exists()) {
- ComponentLib = fileInfo.fileName() ;
- found = true;
- MESSAGE ( " found " )
- } else {
- MESSAGE ( " Not found " )
- }
- }
- if ( !found && getenv( QAD_Application::getDesktop()->getComponentName(parentComp) + "_ROOT_DIR") ) {
+ if ( getenv( QAD_Application::getDesktop()->getComponentName(parentComp) + "_ROOT_DIR") ) {
dir.fill('\0');
dir.sprintf("%s", getenv( QAD_Application::getDesktop()->getComponentName(parentComp) + "_ROOT_DIR"));
dir = QAD_Tools::addSlash(dir) ;
msgid "SALOMEGUI_TrihedronSizeDlg::MEN_TRIHEDRON"
msgstr "Trihedron"
+#: SALOMEGUI_ExternalBrowserDlg.cxx:26
+msgid "SALOMEGUI_ExternalBrowserDlg::MEN_EXTERNAL_BROWSER"
+msgstr "Choose external browser"
+
+#: SALOMEGUI_ExternalBrowserDlg.cxx:42
+msgid "SALOMEGUI_ExternalBrowserDlg::MEN_EXTERNAL_BROWSER_APP"
+msgstr "Application:"
+
+#: SALOMEGUI_ExternalBrowserDlg.cxx:50
+msgid "SALOMEGUI_ExternalBrowserDlg::MEN_EXTERNAL_BROWSER_PARAMS"
+msgstr "Parameters:"
+
+#: SALOMEGUI_ExternalBrowserDlg.cxx:58
+msgid "SALOMEGUI_ExternalBrowserDlg::MEN_EXTERNAL_BROWSER_BROWSE"
+msgstr "&Browse"
+
+#: SALOMEGUI_ExternalBrowserDlg.cxx:95
+msgid "SALOMEGUI_ExternalBrowserDlg::MEN_EXTERNAL_BROWSER_CHOOSEAPP"
+msgstr "Choose application"
+
+#: SALOMEGUI_ExternalBrowserDlg.cxx:126
+msgid "SALOMEGUI_ExternalBrowserDlg::MEN_EXTERNAL_BROWSER_NOTEXECUTABLE"
+msgstr "The file is not executable!"
+
+
+
#: SALOMEGUI_OpenWith.cxx:37
msgid "SALOMEGUI_OpenWith::MEN_COMPONENT_CHOICE1"
msgstr "Always use this component to open this type of object"
msgid "SALOMEGUI_CloseDlg::CLOSE_DESCRIPTION"
msgstr "Do you want to close or only unload the study ?"
+msgid "SALOMEGUI_ActivateComponentDlg::CAPTION"
+msgstr "Activate module"
+
+msgid "SALOMEGUI_ActivateComponentDlg::NEW"
+msgstr "&New"
+
+msgid "SALOMEGUI_ActivateComponentDlg::OPEN"
+msgstr "&Open"
+
+msgid "SALOMEGUI_ActivateComponentDlg::LOAD"
+msgstr "&Load"
+
+msgid "SALOMEGUI_ActivateComponentDlg::CANCEL"
+msgstr "&Cancel"
+
+msgid "SALOMEGUI_ActivateComponentDlg::ActivateComponent_DESCRIPTION"
+msgstr "You need to create, open or load study before."
+
msgid "SALOMEGUI_HELP_TITLE"
msgstr "SALOME Help"
SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) -DHAVE_CONFIG_H
-LDFLAGS+= $(PYTHON_LIBS) $(QT_MT_LIBS) $(OCC_LIBS) $(VTK_LIBS) $(OGL_LIBS) -lSalomeGUI -lvtkCommonPython -lvtkGraphicsPython -lvtkImagingPython -lVTKViewer
+LDFLAGS+= $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) -lSalomeGUI -lvtkCommonPython -lvtkGraphicsPython -lvtkImagingPython -lVTKViewer
@CONCLUDE@
LIB_CLIENT_IDL = SALOME_Exception.idl
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES)
-LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(OCC_LIBS) $(VTK_LIBS) $(OGL_LIBS)
+LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS)
LDFLAGS+= -lSalomeGUI -lqtcmodule
def IDToSObject(id):
mySO = myStudy.FindObjectID(id);
return mySO
+
+ #--------------------------------------------------------------------------
+
+def PersistentPresentation(theStudy, theSO, theWithID):
+ # put the sobject's content (with subchildren) to the string
+ aResult = ""
+ attrs = theSO.GetAllAttributes()
+ aLen = len(attrs)
+ anUncopied = 0
+ for a in range(0,aLen):
+ attr = attrs[a]
+ if isinstance(attr,SALOMEDS._objref_AttributeTreeNode):
+ anUncopied += 1
+ elif isinstance(attr,SALOMEDS._objref_AttributeTarget):
+ anUncopied += 1
+ elif isinstance(attr,SALOMEDS._objref_AttributeReal) or \
+ isinstance(attr,SALOMEDS._objref_AttributeInteger) or \
+ isinstance(attr,SALOMEDS._objref_AttributeName) or \
+ isinstance(attr,SALOMEDS._objref_AttributeComment) or \
+ isinstance(attr,SALOMEDS._objref_AttributePersistentRef) or \
+ isinstance(attr,SALOMEDS._objref_AttributeLocalID) or \
+ isinstance(attr,SALOMEDS._objref_AttributeUserID):
+ aResult += " attribute value: " + str(attr.Value())
+ elif isinstance(attr,SALOMEDS._objref_AttributeIOR):
+ aResult += " attribute: IOR"
+ elif isinstance(attr,SALOMEDS._objref_AttributeSequenceOfReal) or \
+ isinstance(attr,SALOMEDS._objref_AttributeSequenceOfInteger):
+ aResult += " Sequence: " + str(attr.CorbaSequence())
+ elif isinstance(attr,SALOMEDS._objref_AttributeDrawable):
+ aResult += " Drawable: " + str(attr.IsDrawable())
+ elif isinstance(attr,SALOMEDS._objref_AttributeSelectable):
+ aResult += " Selectable: " + str(attr.IsSelectable())
+ elif isinstance(attr,SALOMEDS._objref_AttributeExpandable):
+ aResult += " Expandable: " + str(attr.IsExpandable())
+ elif isinstance(attr,SALOMEDS._objref_AttributeOpened):
+ aResult += " Opened: " + str(attr.IsOpened())
+ elif isinstance(attr,SALOMEDS._objref_AttributeTextColor):
+ aResult += " TextColor: " + str(attr.TextColor())
+ elif isinstance(attr,SALOMEDS._objref_AttributeTextHighlightColor):
+ aResult += " TextHighlightColor: " + str(attr.TextHighlightColor())
+ elif isinstance(attr,SALOMEDS._objref_AttributePixMap):
+ aResult += " PixMap: " + str(attr.GetPixMap())
+ elif isinstance(attr,SALOMEDS._objref_AttributeTableOfInteger) or \
+ isinstance(attr,SALOMEDS._objref_AttributeTableOfReal):
+ aResult += " Table with title: " + attr.GetTitle()
+ elif isinstance(attr,SALOMEDS._objref_AttributePythonObject):
+ aResult += " PythonObject: " + attr.GetObject()
+
+ if theWithID:
+ aResult = "sobject: " + theSO.GetID() + " nbattrs: " + str(aLen - anUncopied) + aResult + '\n'
+ else:
+ aResult = " nbattrs: " + str(aLen - anUncopied) + aResult + '\n'
+ anIter = theStudy.NewChildIterator(theSO)
+ while anIter.More():
+ aResult += PersistentPresentation(theStudy, anIter.Value(), theWithID)
+ anIter.Next()
+ return aResult
+
#--------------------------------------------------------------------------
+def GetTree(theSO):
+ # returns the document list tree (as list)
+ aResult = [theSO.GetID()]
+ anIter = myStudy.NewChildIterator(theSO)
+ while anIter.More():
+ aResult += GetTree(anIter.Value())
+ anIter.Next()
+ return aResult
+
+ #--------------------------------------------------------------------------
+
+def CheckCopyPaste(theSO, theInfo ,theComponentPaste):
+ aRoot = theSO
+ while aRoot.GetID() != "0:":
+ aRoot = aRoot.GetFather()
+ aTree = GetTree(aRoot)
+ aStudyPersist = PersistentPresentation(myStudy, aRoot, 1)
+
+ if not myStudyManager.CanCopy(theSO):
+ raise RuntimeError, "<CanCopy> for "+theInfo+" returns false"
+
+ if not myStudyManager.Copy(theSO):
+ raise RuntimeError, "<Copy> for "+theInfo+" returns false"
+
+
+ if not myStudyManager.CanPaste(theSO):
+ raise RuntimeError, "<CanPaste> for "+theInfo+" returns false"
+
+ # check: before paste study is not changed check
+ if aStudyPersist != PersistentPresentation(myStudy, aRoot, 1):
+ raise RuntimeError, "Study is changed before Paste calling for "+theInfo
+
+ aSObj = theSO
+ if theComponentPaste:
+ aSObj = theSO.GetFatherComponent()
+ theInfo = theInfo + "(paste for component)"
+ if not myStudyManager.Paste(aSObj):
+ raise RuntimeError, "<Paste> for "+theInfo+" returns false"
+ aNewTree = GetTree(aRoot)
+ aLen = len(aTree)
+ for a in range(0,aLen):
+ if aTree[a] != aNewTree[a]:
+ return myStudy.FindObjectID(aNewTree[a])
+
+ if aLen < len(aNewTree):
+ return myStudy.FindObjectID(aNewTree[aLen])
+
+ raise RuntimeError, "After Copy calling the tree is not changed"
+
+ #--------------------------------------------------------------------------
+def FindFileInDataDir(filename):
+ import os
+ datadir = os.getenv("DATA_DIR")
+ if datadir is not None:
+ import string
+ dirs = string.split(datadir, ":")
+ for dir in dirs:
+ file = dir + "/" + filename
+ if os.path.exists(file):
+ return file;
+ datadir = os.getenv("KERNEL_ROOT_DIR") + "/examples/"
+ file = datadir + filename
+ if os.path.exists(file):
+ return file;
+
+ return None
+
#--------------------------------------------------------------------------
# initialise the ORB
orb = CORBA.ORB_init([''], CORBA.ORB_ID)
import SALOMEDS
import os
+import SALOME_ModuleCatalog
+
+print "======================================================================"
+print " Get Catalog "
+print "======================================================================"
+obj = salome.naming_service.Resolve('Kernel/ModulCatalog')
+catalog = obj._narrow(SALOME_ModuleCatalog.ModuleCatalog)
+
print "======================================================================"
print " Create Study "
print "======================================================================"
+comp = catalog.GetComponent("GEOM")
+if comp is None:
+ raise RuntimeError,"Component GEOM not found in Module Catalog."
+
import geompy
print "================================="
print "============= Test SMESH ============================="
print
+comp = catalog.GetComponent("SMESH")
+if comp is None:
+ raise RuntimeError,"Component SMESH not found in Module Catalog."
+
+comp = catalog.GetComponent("MED")
+if comp is None:
+ raise RuntimeError,"Component MED not found in Module Catalog."
+
import SMESH
import smeshpy
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "Geometry")
+geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
myBuilder = salome.myStudy.NewBuilder()
smeshgui = salome.ImportComponentGUI("SMESH")
print "============= Test Supervisor ============================="
print
+comp = catalog.GetComponent("SUPERV")
+if comp is None:
+ raise RuntimeError,"Component SUPERV not found in Module Catalog."
+
from SuperV import *
import SALOMEDS
myStudy = salome.myStudy
myBuilder = myStudy.NewBuilder()
-SuperVision = lcc.FindOrLoadComponent("SuperVisionContainer","Supervision")
+SuperVision = lcc.FindOrLoadComponent("SuperVisionContainer","SUPERV")
father = myStudy.FindComponent("SUPERV")
if father is None:
father = myBuilder.NewComponent("SUPERV")
A1 = myBuilder.FindOrCreateAttribute(father, "AttributeName");
FName = A1._narrow(SALOMEDS.AttributeName)
- FName.SetValue("Supervision")
+ FName.SetValue( salome.sg.getComponentUserName("SUPERV") )
A2 = myBuilder.FindOrCreateAttribute(father, "AttributePixMap");
aPixmap = A2._narrow(SALOMEDS.AttributePixMap);
aPixmap.SetPixMap( "ICON_OBJBROWSER_Supervision" );
anIOR.SetValue(dataflow.getIOR())
import os
-dir= os.getenv("SALOME_ROOT_DIR")
+dir= os.getenv("SUPERV_ROOT_DIR")
if dir == None:
- raise RuntimeError, "SALOME_ROOT_DIR is not defined"
-xmlfile = dir +"/../SALOME_ROOT/SuperVisionTest/resources/GraphEssai.xml"
+ raise RuntimeError, "SUPERV_ROOT_DIR is not defined"
+xmlfile = dir +"/examples/GraphGeomEssai.xml"
print "Load dataflow from the file : "
print xmlfile
print
# Get Nodes
myGraph.PrintNodes()
-Add,Sub,Mul,Div = myGraph.Nodes()
-
-# Load Datas
-Addx = Add.Input("x",3.)
-Addy = Add.Input("y",4.5)
-Subx = Sub.Input("x",1.5)
-
-# Get Output Port
-Addz = Add.Port('z')
-Subz = Sub.Port('z')
-Mulz = Mul.Port('z')
-Divz = Div.Port('z')
# This DataFlow is "executable" : all pending Ports are defined with Datas
print myGraph.IsExecutable()
# Wait for Completion (but it is already done after event loop ...)
print "Done : ",myGraph.DoneW()
-# Get result
-print "Result : ",Divz.ToString()
-
-# Intermediate results :
-print "Intermediate Result Add\z : ",Addz.ToString()
-print "Intermediate Result Sub\z : ",Subz.ToString()
-print "Intermediate Result Mul\z : ",Mulz.ToString()
-
print " "
#print "Type : print myGraph.IsDone()"
#print " If execution is finished ==> 1 (true)"
if res != 1:
raise RuntimeError, "myGraph.Run() is not done"
-print " "
-print "Type : print Divz.ToString()"
-print " You will get the result"
-Divz.ToString()
-
print " "
print "Type : myGraph.PrintPorts()"
print " to see input and output values of the graph"
myGraph.PrintPorts()
-print " "
-print "Type : Add.PrintPorts()"
-Add.PrintPorts()
-
-print "Type : Sub.PrintPorts()"
-Sub.PrintPorts()
-
-print "Type : Mul.PrintPorts()"
-Mul.PrintPorts()
-
-print "Type : Div.PrintPorts()"
-print " to see input and output values of nodes"
-Div.PrintPorts()
-
# Export will create newsupervisionexample.xml and the corresponding .py file
tmpdir=os.getenv("TmpDir")
if tmpdir is None:
names.append(node.Name())
print names
-print "Load FactorialComponent component, create dataflow using its services and run execution"
-myPy = Graph('myPy')
-
-eval = myPy.Node('FactorialComponent','FactorialComponent','eval')
-eval.SetContainer('FactoryServerPy')
-
-myPy.IsValid()
-
-myPy.PrintPorts()
-
-myPy.Run( 3 )
-
-myPy.DoneW()
-
-myPy.State()
-
-myPy.PrintPorts()
-
+# Graph creation
+GraphInLines = Graph( 'GraphInLines' )
+GraphInLines.SetName( 'GraphInLines' )
+GraphInLines.SetAuthor( '' )
+GraphInLines.SetComment( '' )
+GraphInLines.Coords( 0 , 0 )
+
+# Creation of InLine Nodes
+PyAdd = []
+PyAdd.append( 'def Add(a,b) : ' )
+PyAdd.append( ' return a+b ' )
+PyAdd.append( '' )
+Add = GraphInLines.INode( 'Add' , PyAdd )
+Add.InPort( 'a' , 'long' )
+Add.InPort( 'b' , 'long' )
+Add.OutPort( 'f' , 'long' )
+Add.SetName( 'Add' )
+Add.SetAuthor( '' )
+Add.SetComment( 'Python function' )
+Add.Coords( 351 , 77 )
+PySub = []
+PySub.append( 'def Sub(a,b) : ' )
+PySub.append( ' return a-b ' )
+PySub.append( '' )
+Sub = GraphInLines.INode( 'Sub' , PySub )
+Sub.InPort( 'a' , 'long' )
+Sub.InPort( 'b' , 'long' )
+Sub.OutPort( 'f' , 'long' )
+Sub.SetName( 'Sub' )
+Sub.SetAuthor( '' )
+Sub.SetComment( 'Python function' )
+Sub.Coords( 86 , 333 )
+PyMul = []
+PyMul.append( 'def Mul(a,b) : ' )
+PyMul.append( ' return a*b ' )
+Mul = GraphInLines.INode( 'Mul' , PyMul )
+Mul.InPort( 'a' , 'long' )
+Mul.InPort( 'b' , 'long' )
+Mul.OutPort( 'Result' , 'long' )
+Mul.SetName( 'Mul' )
+Mul.SetAuthor( '' )
+Mul.SetComment( 'Python function' )
+Mul.Coords( 616 , 247 )
+
+# Creation of intermediate Output variables and of Control Links
+Addf = Add.Port( 'f' )
+Mula = GraphInLines.Link( Addf , Mul.Port( 'a' ) )
+Mula.AddCoord( 1 , 570 , 356 )
+Mula.AddCoord( 2 , 570 , 186 )
+Subf = Sub.Port( 'f' )
+Mulb = GraphInLines.Link( Subf , Mul.Port( 'b' ) )
+Mulb.AddCoord( 1 , 282 , 376 )
+Mulb.AddCoord( 2 , 282 , 442 )
+Addb = GraphInLines.Link( Subf , Add.Port( 'b' ) )
+Addb.AddCoord( 1 , 283 , 209 )
+Addb.AddCoord( 2 , 283 , 374 )
+Addb.AddCoord( 3 , 283 , 442 )
+
+# Creation of Input datas
+Adda = Add.Input( 'a' , 1)
+Suba = Sub.Input( 'a' , 3)
+Subb = Sub.Input( 'b' , 4)
+
+# Creation of Output variables
+MulResult = Mul.Port( 'Result' )
+
+GraphInLines.Run()
+
+GraphInLines.DoneW()
+
+GraphInLines.PrintPorts()
sg.updateObjBrowser(1);
print
print "============= Test VISU and MED ============================="
print
+
+comp = catalog.GetComponent("VISU")
+if comp is None:
+ raise RuntimeError,"Component VISU not found in Module Catalog."
+
import sys
import SALOMEDS
import SALOME
import visu_gui
medFile = "pointe.med"
-medFile = os.getenv('SALOME_ROOT_DIR') + '/../SALOME_ROOT/data/' + medFile
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
print "Load ", medFile
studyCurrent = salome.myStudyName
-med_comp = salome.lcc.FindOrLoadComponent("FactoryServer", "Med")
-myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "Visu")
+med_comp = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
+myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
try:
if os.access(medFile, os.R_OK) :
med_obj = visu_gui.visu.getMedObjectFromStudy()
print "med_obj - ", med_obj
- myField = visu_gui.visu.getFieldObjectFromStudy(2,1)
- aMeshName = "FILED_DOUBLE_MESH"
+ myField1 = visu_gui.visu.getFieldObjectFromStudy(2,1)
+ aMeshName = "maa1"
anEntity = VISU.NODE
- aTimeStampId = 0
-
- myResult1 = myVisu.ImportMedField(myField)
+ aTimeStampId = -1
+
+ myResult1 = myVisu.ImportMedField(myField1)
aMesh1 = myVisu.MeshOnEntity(myResult1, aMeshName, anEntity);
- aScalarMap1= myVisu.ScalarMapOnField(myResult1, aMeshName, anEntity, myField.getName(), aTimeStampId)
- if(myField.getNumberOfComponents() > 1) :
- aVectors = myVisu.VectorsOnField(myResult1, aMeshName, anEntity, myField.getName(), aTimeStampId)
-
- myResult2 = myVisu.ImportFile(medFile)
- aMeshName = "maa1"
- anEntity = VISU.NODE
- aMesh2 = myVisu.MeshOnEntity(myResult2, aMeshName, anEntity)
-
- aScalarMap2 = myVisu.ScalarMapOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
- if(myField.getNumberOfComponents() > 1) :
- aCutPlanes = myVisu.CutPlanesOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
-
- sg.updateObjBrowser(0)
+ aScalarMap1= myVisu.ScalarMapOnField(myResult1, aMeshName, anEntity, myField1.getName(), aTimeStampId)
+
+ myResult2 = myVisu.ImportFile(medFile);
+ aMesh2 = myVisu.MeshOnEntity(myResult2, aMeshName, anEntity);
+
+ aTimeStampId = 3
+ aScalarMap2= myVisu.ScalarMapOnField(myResult2, aMeshName, anEntity, myField1.getName(), aTimeStampId)
+
+ sg.updateObjBrowser(0)
else : print "We have no permission to rewrite medFile, so readStructFileWithFieldType can't open this file";
else : print "We have no permission to read medFile, it will not be opened";
CPPFLAGS+=$(QT_MT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(QT_MT_LIBS) $(OCC_KERNEL_LIBS) $(OCC_OCAF_LIBS) $(OCC_VIEWER_LIBS) $(OCC_MODELER_LIBS) -lSalomeContainer -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lRegistry -lSalomeNotification -lOpUtil -lSalomeLoggerServer -lPlot2d
+#LDFLAGS+=$(QT_MT_LIBS) $(OCC_KERNEL_LIBS) $(OCC_OCAF_LIBS) $(OCC_VIEWER_LIBS) $(OCC_MODELER_LIBS) -lSalomeContainer -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lRegistry -lSalomeNotification -lOpUtil -lSalomeLoggerServer -lPlot2d
+LDFLAGS+=$(QT_MT_LIBS) -lSalomeContainer -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lRegistry -lSalomeNotification -lOpUtil -lSalomeLoggerServer -lPlot2d -lSalomeVTKFilter
@CONCLUDE@
# include "Utils_ORB_INIT.hxx"
# include "Utils_SINGLETON.hxx"
-
#include "SALOME_Container_i.hxx"
+# include "SALOME_NamingService.hxx"
#include <iostream>
#include <unistd.h>
using namespace std;
PySys_SetArgv( argc , argv ) ;
Py_InitModule( "InitPyRunMethod" , MethodPyVoidMethod ) ;
-
try
{
// Initialise the ORB.
ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
CORBA::ORB_var &orb = init( argc , argv ) ;
+ ASSERT(!CORBA::is_nil(orb));
// Obtain a reference to the root POA.
CORBA::Object_var obj =orb->resolve_initial_references("RootPOA") ;
PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj) ;
+ ASSERT(!CORBA::is_nil(root_poa));
+ // -------------------------------------------------------------------------------
+ // ---- naming service & Logger
+
+ CosNaming::NamingContext_var myNS;
+ SALOME_Logger::Logger_var log;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+
+ {
+ int SESSION=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+
+ for (int i = 1; i<=NumberOfTries; i++)
+ {
+ if (i!=1)
+ int a=nanosleep(&ts_req,&ts_rem);
+ try
+ {
+ CORBA::Object_var theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ myNS = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Session Server: CORBA::COMM_FAILURE: Unable to contact the Naming Service" );
+ }
+ if(!CORBA::is_nil(myNS))
+ {
+ MESSAGE( "Session Server: Naming Service was found" );
+ if(EnvL==1) // use Logger
+ {
+ for(int j=1; j<=NumberOfTries; j++)
+ {
+ if (j!=1)
+ int a=nanosleep(&ts_req, &ts_rem);
+ try
+ {
+ CORBA::Object_var object = myNS->resolve(name); // find Logger
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log))
+ {
+ MESSAGE( "Session Server: Logger Server was found" );
+ log->ping();
+ SESSION=1;
+ break;
+ }
+ }
+ catch(CosNaming::NamingContext::NotFound)
+ { MESSAGE( "Session Server: Logger Server wasn't found" ); }
+ catch(...)
+ { MESSAGE( "Session Server: Unknown exception" ); }
+ }
+ }
+ }
+ if ((SESSION==1)||((EnvL==0)&&(!CORBA::is_nil(myNS)))) // Naming service found, & Logger if needed
+ break;
+ }
+ }
+
// -------------------------------------------------------------------------------
// ---- container
pmanfac->activate() ;
MESSAGE("pmanfac->activate()")
-
// -------------------------------------------------------------------------------
// servant : session
- //SALOME_Session_i * mySALOME_Session = new SALOME_Session_i(argc, argv, orb, factory_poa) ;
- //PortableServer::ObjectId_var mySALOME_Sessionid = factory_poa->activate_object(mySALOME_Session) ;
-
SALOME_Session_i * mySALOME_Session = new SALOME_Session_i(argc, argv, orb, root_poa) ;
PortableServer::ObjectId_var mySALOME_Sessionid = root_poa->activate_object(mySALOME_Session) ;
MESSAGE("poa->activate_object(mySALOME_Session)");
CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES)
CXXFLAGS+=$(OCC_CXXFLAGS)
-LDFLAGS+=$(OCC_KERNEL_LIBS) -lOpUtil -lSalomeLoggerServer
+LDFLAGS+= -lOpUtil -lSalomeLoggerServer $(CAS_LDPATH) -lTKernel
@CONCLUDE@
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES)
CXXFLAGS += $(OCC_CXXFLAGS)
-LDFLAGS += -lSalomeGUI
+LDFLAGS += -lSalomeGUI
@CONCLUDE@
}
else {
QString command = "";
- if ( getenv("SALOME_ROOT_DIR") )
- command = QString( getenv( "SALOME_ROOT_DIR" ) ) + "/bin/runIDLparser -Wbcatalog=" + XmlFile;
- else if ( getenv("KERNEL_ROOT_DIR") )
+ if ( getenv("KERNEL_ROOT_DIR") )
command = QString( getenv( "KERNEL_ROOT_DIR" ) ) + "/bin/runIDLparser -Wbcatalog=" + XmlFile;
else {
QAD_MessageBox::error1( this,
tr("TOOLS_ERR_ERROR"),
- tr("SALOME_ROOT_DIR or KERNEL_ROOT_DIR variables are not defined"),
+ tr("KERNEL_ROOT_DIR variable is not defined"),
tr("TOOLS_BUT_OK") );
}
if (!Author.isEmpty()) command += ",author=" + Author;
#include "SALOME_NamingService.hxx"
#include "OpUtil.hxx"
-
+# include "Utils_ORB_INIT.hxx"
+# include "Utils_SINGLETON.hxx"
+# include "Utils_SALOME_Exception.hxx"
+# include "Utils_CommException.hxx"
int main (int argc, char * argv[])
{
//Engines::Container_var iGenFact = Engines::Container::_narrow(obj);
// Obtain a reference to the root POA
- CORBA::Object_var obj = orb->resolve_initial_references("RootPOA") ;
- PortableServer::POA_var poa = PortableServer::POA::_narrow(obj) ;
-
+ //
+ long TIMESleep = 250000000;
+ int NumberOfTries = 40;
+ int a;
+ timespec ts_req;
+ ts_req.tv_nsec=TIMESleep;
+ ts_req.tv_sec=0;
+ timespec ts_rem;
+ ts_rem.tv_nsec=0;
+ ts_rem.tv_sec=0;
+ CosNaming::NamingContext_var inc;
+ PortableServer::POA_var poa;
+ CORBA::Object_var theObj;
+ CORBA::Object_var obj;
+ CORBA::Object_var object;
+ SALOME_Logger::Logger_var log;
+ SALOME_NamingService &naming = *SINGLETON_<SALOME_NamingService>::Instance() ;
+ int TEST_CONTAINER=0;
+ const char * Env = getenv("USE_LOGGER");
+ int EnvL =0;
+ if ((Env!=NULL) && (strlen(Env)))
+ EnvL=1;
+ CosNaming::Name name;
+ name.length(1);
+ name[0].id=CORBA::string_dup("Logger");
+ PortableServer::POAManager_var manager;
+ for (int i = 1; i<=NumberOfTries; i++){
+ if (i!=1)
+ a=nanosleep(&ts_req,&ts_rem);
+ try{
+ obj = orb->resolve_initial_references("RootPOA");
+ if(!CORBA::is_nil(obj))
+ poa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(poa))
+ manager = poa->the_POAManager();
+ if(!CORBA::is_nil(orb))
+ theObj = orb->resolve_initial_references("NameService");
+ if (!CORBA::is_nil(theObj))
+ inc = CosNaming::NamingContext::_narrow(theObj);
+ }
+ catch( CORBA::COMM_FAILURE& )
+ {
+ MESSAGE( "Test Container: CORBA::COMM_FAILURE: Unable to contact the Naming Service" )
+ }
+ if(!CORBA::is_nil(inc)) {
+ MESSAGE( "Test Container: Naming Service was found" )
+ if(EnvL==1){
+ for(int j=1; j<=NumberOfTries; j++){
+ if (j!=1)
+ a=nanosleep(&ts_req, &ts_rem);
+ try{
+ object = inc->resolve(name);
+ }
+ catch(CosNaming::NamingContext::NotFound){ MESSAGE( "Test Container: Logger Server wasn't found" ) }
+ catch(...){ MESSAGE( "Test Container: Unknown exception" ) }
+ if (!CORBA::is_nil(object))
+ log = SALOME_Logger::Logger::_narrow(object);
+ if (!CORBA::is_nil(log)){
+ MESSAGE( "Test Container: Loger Server was found" )
+ log->ping();
+ TEST_CONTAINER=1;
+ break;
+ }
+ }}
+ }
+ if ((TEST_CONTAINER==1)||((EnvL==0)&&(!CORBA::is_nil(inc))))
+ break;
+ }
+ //
// Use Name Service to find container
SALOME_NamingService _NS(orb) ;
string containerName = "/Containers/" ;
EXPORT_HEADERS= VTKViewer_RenderWindow.h \
VTKViewer_ViewFrame.h \
VTKViewer_RenderWindowInteractor.h \
- VTKViewer_InteractorStyleSALOME.h
-
+ VTKViewer_InteractorStyleSALOME.h
+
# Libraries targets
LIB = libVTKViewer.la
LIB_SRC= VTKViewer.cxx \
VTKViewer_ViewFrame.cxx \
VTKViewer_RenderWindow.cxx \
VTKViewer_RenderWindowInteractor.cxx \
- VTKViewer_InteractorStyleSALOME.cxx
+ VTKViewer_InteractorStyleSALOME.cxx \
+ VTKViewer_VectorText.cxx
LIB_MOC = \
VTKViewer.h \
VTKViewer_ViewFrame.h \
VTKViewer_RenderWindowInteractor.h \
VTKViewer_RenderWindow.h
-
-
+
LIB_CLIENT_IDL = SALOMEDS.idl \
SALOME_ModuleCatalog.idl \
SALOME_Component.idl \
CPPFLAGS+=$(QT_INCLUDES) $(OGL_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES)
CXXFLAGS+=
-LDFLAGS+=$(VTK_LIBS) $(OGL_LIBS) $(QT_MT_LIBS)
+LDFLAGS+=$(VTK_LIBS) $(OGL_LIBS) $(QT_MT_LIBS) -lSalomeGUI
@CONCLUDE@
#include "VTKViewer_RenderWindow.h"
#include <qapplication.h>
+#include "QAD_Config.h"
#include "QAD_Application.h"
#include "QAD_Desktop.h"
#include <vtkPolyDataMapper.h>
#include <vtkDataSetCollection.h>
#include <vtkImageData.h>
+#include <vtkFollower.h>
//VRV: porting on Qt 3.0.5
this->Interactor->Render();
}
+//----------------------------------------------------------------------------
+void VTKViewer_InteractorStyleSALOME::ControlLblSize(double aOldScale, double aNewScale) {
+ m_Triedron->InitTraversal();
+ vtkActor *ac = m_Triedron->GetNextActor();
+ bool IsConeActor = true;
+ while(!(ac==NULL)) {
+ float aMaxXRange;
+ float aMaxYRange;
+ float aMaxZRange;
+ if(ac->IsA("vtkFollower")) {
+ float aScale[3];
+ ac->GetScale(aScale);
+
+ float aPosition[3];
+ ac->GetPosition(aPosition);
+
+ float aPercent = (aOldScale-aNewScale)/aOldScale;
+ ac->SetScale(aScale[0]*(1-aPercent),aScale[1]*(1-aPercent),aScale[2]*(1-aPercent));
+
+ //Set new position
+ float aLength = ac->GetLength();
+ if (aPosition[0]!=0) {
+ //x
+ aPosition[0] = aMaxXRange;
+ } else if (aPosition[1]!=0) {
+ //y
+ aPosition[1] = aMaxYRange;
+ } else if (aPosition[2]!=0) {
+ //z
+ aPosition[2] = aMaxZRange;
+ }
+ ac->SetPosition(aPosition);
+
+ IsConeActor = true;
+ }
+ else {
+ if (IsConeActor) {
+ //coneActor is the first in the list (see m_Triedron->AddItem(...) in VTKViewer_ViewFrame::AddVector(...))
+ IsConeActor = false;
+
+ float aPosition[3];
+ ac->GetPosition(aPosition);
+
+ if (aPosition[0]!=0) {
+ //x
+ float* aXRange = ac->GetXRange();
+ if (aXRange[0] < aXRange[1]) aMaxXRange = aXRange[1];
+ else aMaxXRange = aXRange[0];
+ } else if (aPosition[1]!=0) {
+ //y
+ float* aYRange = ac->GetYRange();
+ if (aYRange[0] < aYRange[1]) aMaxYRange = aYRange[1];
+ else aMaxYRange = aYRange[0];
+ } else if (aPosition[2]!=0) {
+ //z
+ float* aZRange = ac->GetZRange();
+ if (aZRange[0] < aZRange[1]) aMaxZRange = aZRange[1];
+ else aMaxZRange = aZRange[0];
+ }
+ }
+ }
+ ac = m_Triedron->GetNextActor();
+ }
+}
+
//----------------------------------------------------------------------------
void VTKViewer_InteractorStyleSALOME::DollyXY(int dx, int dy)
{
cam = this->CurrentRenderer->GetActiveCamera();
if (cam->GetParallelProjection())
{
+ double aOldScale = cam->GetParallelScale();
cam->SetParallelScale(cam->GetParallelScale()/zoomFactor);
+ double aNewScale = cam->GetParallelScale();
+
+ // for controlling label size
+ ControlLblSize(aOldScale,aNewScale);
}
- else
+ else
{
cam->Dolly(zoomFactor);
this->CurrentRenderer->ResetCameraClippingRange();
}*/
//VTKViewer_RenderWindow* aRW = dynamic_cast<VTKViewer_RenderWindow*>(this->Interactor->GetRenderWindow());
if (myGUIWindow) myGUIWindow->update();
+
}
public:
bool eventFilter(QObject* object, QEvent* event);
+ void ControlLblSize(double aOldScale, double aNewScale);
void startZoom();
void startPan();
void startGlobalPan();
}
VTKViewer_RenderWindow::~VTKViewer_RenderWindow() {
- //myRW->Delete(); //BUG SAL2954, Commented by SRN, to avoid problems when using rlogin
+ myRW->Delete(); //BUG SAL2954, Commented by SRN, to avoid problems when using rlogin
+ // Uncommented because of bug SAL3913
}
void VTKViewer_RenderWindow::paintEvent(QPaintEvent* theEvent) {
Edge_Actor = vtkActor::New();
Edge_Actor->PickableOff();
Edge_Actor->GetProperty()->SetColor(1,0,0);
- Edge_Actor->GetProperty()->SetRepresentationToSurface();
Edge_Actor->GetProperty()->SetLineWidth(5);
+ Edge_Actor->GetProperty()->SetRepresentationToWireframe();
Point_Actor = vtkActor::New();
Point_Actor->PickableOff();
Point_Actor->GetProperty()->SetColor(1,1,0);
- Point_Actor->GetProperty()->SetRepresentationToSurface();
Point_Actor->GetProperty()->SetPointSize(5);
+ Point_Actor->GetProperty()->SetRepresentationToPoints();
return ;
}
// GEOM actor
float r,g,b;
anActor->GetColor(r,g,b);
- return QColor(r*255,g*255,b*255);
+ return QColor(int(r*255),int(g*255),int(b*255));
}
else {
float color[3];
anActor->GetProperty()->GetColor(color);
- return QColor(color[0]*255,color[1]*255,color[2]*255);
+ return QColor(int(color[0]*255),int(color[1]*255),int(color[2]*255));
}
}
}
int aPartId = ite.Key();
if(0 > aPartId || aPartId >= aNbOfParts) break;
theSourcePolyData->GetCellPoints(aPartId,ptIds);
- aPolyData->InsertNextCell(theSourcePolyData->GetCellType(aPartId),ptIds);
+ vtkCell* aCell = theSourcePolyData->GetCell(aPartId);
+ aPolyData->InsertNextCell(aCell->GetCellType(),ptIds);
+ for (int i = 0, iEnd = aCell->GetNumberOfEdges(); i < iEnd; i++){
+ vtkCell* anEdgeCell = aCell->GetEdge(i);
+ aPolyData->InsertNextCell(VTK_LINE,anEdgeCell->GetPointIds());
+ }
}
ptIds->Delete();
theMapper->SetInput(aPolyData);
// Module : SALOME
// $Header$
-using namespace std;
#include "VTKViewer_ViewFrame.h"
#include "VTKViewer_RenderWindow.h"
-//#include "VTKViewer_InteractorStyleSALOME.h"
+
+#include "SALOME_Transform.h"
+#include "SALOME_TransformFilter.h"
+#include "SALOME_PassThroughFilter.h"
+#include "SALOME_GeometryFilter.h"
#include "QAD_Settings.h"
#include "QAD_Config.h"
#include "SALOME_Selection.h"
#include "SALOME_InteractiveObject.hxx"
#include "VTKViewer_InteractorStyleSALOME.h"
+#include "VTKViewer_VectorText.h"
#include "utilities.h"
// VTK Includes
#include <vtkActor.h>
#include <vtkRenderer.h>
-#include <vtkTransform.h>
#include <vtkPolyDataMapper.h>
#include <vtkMath.h>
-#include <vtkTextSource.h>
#include <vtkLine.h>
#include <vtkConeSource.h>
-#include <vtkTextMapper.h>
-#include <vtkMapper2D.h>
-#include <vtkActor2D.h>
-#include <vtkWindowToImageFilter.h>
-#include <vtkTIFFWriter.h>
-#include <vtkVectorText.h>
#include <vtkFollower.h>
+using namespace std;
/*!
Constructor
*/
vtkFollower* CreateTextActor(char *text, float aSize) {
- vtkVectorText* aTxt = vtkVectorText::New();
+ VTKViewer_VectorText* aTxt = VTKViewer_VectorText::New();
aTxt->SetText(text);
vtkPolyDataMapper* textMapper = vtkPolyDataMapper::New();
textMapper->SetInput(aTxt->GetOutput());
vtkFollower* textActor = vtkFollower::New();
textActor->SetMapper(textMapper);
- float aScale = 6 * aSize/100;
+ float aScale = 17 * aSize/100;
textActor->SetScale(aScale, aScale, aScale);
return textActor;
}
m_Renderer->GetActiveCamera()->ParallelProjectionOn();
m_Renderer->LightFollowCameraOn();
+ m_Renderer->TwoSidedLightingOn();
// Set BackgroundColor
QString BgrColorRed = QAD_CONFIG->getSetting("VTKViewer:BackgroundColorRed");
camera->SetFocalPoint(0,0,0);
camera->SetViewUp(0,0,1);
m_Renderer->ResetCamera();
+
+ double aOldScale = camera->GetParallelScale();
camera->SetParallelScale(500);
+ double aNewScale = camera->GetParallelScale();
+
+ //for controlling labels scale after reset
+ float dim;
+ QString Size = QAD_CONFIG->getSetting("Viewer:TrihedronSize");
+ if( Size.isEmpty() ){
+ dim = 100;
+ } else {
+ dim = Size.toFloat();
+ }
+ float aScale = 17 * dim/100;
+
+ m_Triedron->InitTraversal();
+ vtkActor *ac = m_Triedron->GetNextActor();
+ bool IsConeActor = true;
+ while(!(ac==NULL)) {
+ if(ac->IsA("vtkFollower")) {
+ ac->SetScale(aScale, aScale, aScale);
+ IsConeActor = true;
+ }
+ else {
+ if (IsConeActor) {
+ //coneActor is the first in the list (see m_Triedron->AddItem(...) in VTKViewer_ViewFrame::AddVector(...))
+ IsConeActor = false;
+ }
+ }
+ ac = m_Triedron->GetNextActor();
+ }
+
m_Renderer->ResetCameraClippingRange();
m_RW->update();
}
anActiveCamera->SetClippingRange( range );
}
-static void ResetCamera(vtkRenderer* theRenderer){
+static void ResetCamera(vtkRenderer* theRenderer, vtkActorCollection* theTriedron, VTKViewer_RenderWindowInteractor* theRWInteractor){
//see vtkRenderer::ResetCamera(float bounds[6]) method
float bounds[6];
if(!theRenderer) return;
float distance;
float width;
double vn[3], *vup;
+ int* winsize;
if ( theRenderer->GetActiveCamera() != NULL )
{
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
double ang = theRenderer->GetActiveCamera()->GetViewAngle();
distance = 2.0*width/tan(ang*vtkMath::Pi()/360.0);
+
+ // find size of the window
+ winsize = theRenderer->GetSize();
+
// check view-up vector against view plane normal
vup = theRenderer->GetActiveCamera()->GetViewUp();
if ( fabs(vtkMath::Dot(vup,vn)) > 0.999 )
// update the camera
theRenderer->GetActiveCamera()->SetFocalPoint(center[0],center[1],center[2]);
- theRenderer->GetActiveCamera()->SetPosition(center[0]+distance*vn[0],
+ theRenderer->GetActiveCamera()->SetPosition(center[0]+distance*vn[0],
center[1]+distance*vn[1],
center[2]+distance*vn[2]);
// setup default parallel scale
+ double aOldScale = theRenderer->GetActiveCamera()->GetParallelScale();
+
+ if(winsize[0]<winsize[1] )
+ width=width*(float(winsize[1])/float(winsize[0]));
+
theRenderer->GetActiveCamera()->SetParallelScale(width/2.0);
+ double aNewScale = theRenderer->GetActiveCamera()->GetParallelScale();
+
+ // for controlling label size
+ VTKViewer_InteractorStyleSALOME* Style = 0;
+ if (theRWInteractor->GetInteractorStyle()->IsA("VTKViewer_InteractorStyleSALOME")) {
+ Style = VTKViewer_InteractorStyleSALOME::SafeDownCast(theRWInteractor->GetInteractorStyle());
+ Style->ControlLblSize(aOldScale,aNewScale);
+ }
+
//workaround on VTK
//theRenderer->ResetCameraClippingRange(bounds);
ResetCameraClippingRange(theRenderer,bounds);
TriedronWasVisible = true;
}
bool hasVisibleActors = m_Renderer->VisibleActorCount() > 0;
- if ( hasVisibleActors ) // if there are visible actors, not to take into account Trihedron
- ResetCamera(m_Renderer);
+ if ( hasVisibleActors ) { // if there are visible actors, not to take into account Trihedron
+ ResetCamera(m_Renderer,m_Triedron,m_RWInteractor);
+ }
if(TriedronWasVisible) {
m_Triedron->InitTraversal();
vtkActor *ac = m_Triedron->GetNextActor();
ac->VisibilityOn();
ac = m_Triedron->GetNextActor();
}
- if ( !hasVisibleActors ) // if there are NO visible actors, fit view to see only Trihedron
- ResetCamera(m_Renderer);
+ if ( !hasVisibleActors ) { // if there are NO visible actors, fit view to see only Trihedron
+ ResetCamera(m_Renderer,m_Triedron,m_RWInteractor);
+ }
}
//m_Renderer->ResetCameraClippingRange();
m_RW->update();
void VTKViewer_ViewFrame::SetScale(double theScale[3]){
m_Transform->SetScale(theScale[0], theScale[1], theScale[2]);
m_Transform->Modified();
+ vtkActorCollection* theActors = m_Renderer->GetActors();
+ theActors->InitTraversal();
+ vtkActor *anActor;
+ while(anActor = theActors->GetNextActor())
+ anActor->GetMapper()->Update();
Repaint();
}