ENDIF(BUILD_APPLICATIONS)
#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# bbtk_config.xml for the build tree
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/bbtk_config_build.xml.in
+ ${BBTK_BIN_PATH}/bbtk_config.xml
+ @ONLY IMMEDIATE
+ )
+#-----------------------------------------------------------------------------
--- /dev/null
+<config>
+
+ <description> Sets the search directories in the build tree </description>
+
+ <bbs_path></bbs_path>
+ <bbs_path>.</bbs_path>
+ <bbs_path> @PROJECT_BINARY_DIR@/@BBTK_BBS_INSTALL_PATH@ </bbs_path>
+
+ <package_path> @BBTK_BIN_PATH@ </package_path>
+
+ <data_path> @BBTK_DATA_ROOT@ </data_path>
+
+ <default_doc_tmp> . </default_doc_tmp>
+
+</config>
#----------------------------------------------------------------------------
+#----------------------------------------------------------------------------
+# Doxygen
#----------------------------------------------------------------------------
IF(BUILD_bbtk_DOC_DOXYGEN)
SET(BBTK_PACKAGE_DOXYGEN_DOC_INSTALL_PATH
#----------------------------------------------------------------------------
# bbdoc
#---------------------------------------------------------------------------
-IF(BUILD_bbtk_DOC_BBTK_PACKAGE)
-
- # MARK_AS_ADVANCED( bbdoc_PATH )
-
- FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/packages)
- FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME})
-
-
- IF(WIN32)
- IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- SET(bbdoc_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)/bbdoc.exe)
- ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- SET(bbdoc_EXECUTABLE $(SolutionDir)/bin/$(OutDir)/bbdoc.exe)
- ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- ELSE(WIN32)
- SET(bbdoc_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/bbdoc)
- ENDIF(WIN32)
-
- # NEVER USE CONFIGURATION FILE BUT ALWAYS BUILD WITH THE JUST COMPILED LIBS
- # NOT THE INSTALLED ONES !
- # IF(-bbtk_USE_CONFIGURATION_FILE)
- # just pass the package name, not the full path name!
- # and pass the option '1' to bbdoc to use config file
- # SET(bbdoc_INPUT ${BBTK_PACKAGE_NAME} 1)
- # ELSE(-bbtk_USE_CONFIGURATION_FILE)
-
-
-
- IF(WIN32)
- IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- SET(bbdoc_INPUT ${EXECUTABLE_OUTPUT_PATH}/$(IntDir)/${BBTK_PACKAGE_NAME})
- ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- SET(bbdoc_INPUT $(SolutionDir)/bin/$(OutDir)/${BBTK_PACKAGE_NAME})
- ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
- ELSE(WIN32)
- SET(bbdoc_INPUT ${LIBRARY_OUTPUT_PATH}/${BBTK_PACKAGE_NAME})
- ENDIF(WIN32)
- # ENDIF(-bbtk_USE_CONFIGURATION_FILE)
-
-
- ADD_CUSTOM_COMMAND(
- OUTPUT ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html
- COMMAND
- ${bbdoc_EXECUTABLE} ${bbdoc_INPUT} ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html
- DEPENDS
- bb${BBTK_PACKAGE_NAME}
- ${bbdoc_EXECUTABLE}
- )
-
- ADD_CUSTOM_TARGET(${BBTK_PACKAGE_NAME}.html ALL
- DEPENDS ${PROJECT_BINARY_DIR}/doc/packages/${BBTK_PACKAGE_NAME}/${BBTK_PACKAGE_NAME}.html)
-
-ENDIF(BUILD_bbtk_DOC_BBTK_PACKAGE)
-
-
+IF(BUILD_bbtk_DOC_PACKAGE)
+ SUBDIRS(bbdoc)
+ #MESSAGE(ERROR "TT")
+ENDIF(BUILD_bbtk_DOC_PACKAGE)
+#---------------------------------------------------------------------------
--- /dev/null
+MACRO(BBTK_CREATE_PACKAGE_BBDOC PACKAGE_NAME)
+
+ # Create file make_doc_${PACKAGE_NAME}.bbs
+ SET(OUTPUT_PATH ${BBTK_BBS_INSTALL_PATH})
+ SET(OUTPUT_FILE ${PROJECT_BINARY_DIR}/${OUTPUT_PATH}/make_doc_${PACKAGE_NAME}.bbs)
+ SET(DOC_OUTPUT ${BBTK_DOC_INSTALL_PATH}/packages/bbdoc/${PACKAGE_NAME}/index.html)
+ FILE(WRITE
+ "${OUTPUT_FILE}"
+ "#-----------------------------------------\n"
+ "# Generates the html doc for package '${PACKAGE_NAME}'\n"
+ "# Automatically generated by cmake (macro BBTK_CREATE_PACKAGE_BBDOC)\n")
+ FILE(APPEND
+ "${OUTPUT_FILE}"
+ "#-----------------------------------------\n"
+ "include ${PACKAGE_NAME}\n"
+ "include ${PACKAGE_NAME}-appli\n"
+ "#-----------------------------------------\n"
+ "graph workspace 0 0 ${DOC_OUTPUT} ${BBTK_DOCUMENT_SCRIPTS_OUTPUT_PATH}/header.html \"Package ${PACKAGE_NAME} documentation\"\n"
+ )
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${DOC_OUTPUT}
+ COMMAND
+ # tth
+ ${BBTK_BBI} ${OUTPUT_FILE}
+ # ARGS
+ # ${OUTPUT_FILE}
+ # DEPENDS ${PACKAGE_NAME}
+ )
+ ADD_CUSTOM_TARGET(${PACKAGE_NAME}_index.html ALL
+ DEPENDS ${DOC_OUTPUT}
+ )
+ # Install
+# INSTALL(
+# FILES ${CMAKE_CURRENT_BINARY_DIR}/${TEX_FILE}.html
+# DESTINATION ${CMAKE_INSTALL_PREFIX}/${BBTK_DOC_INSTALL_PATH}/${TEX_FILE}
+# )
+
+
+ENDMACRO(BBTK_CREATE_PACKAGE_BBDOC NAME)
+
"#-----------------------------------------\n"
"include ${BBTK_PACKAGE_NAME}/${bbs}\n"
)
+ CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
+ ${PROJECT_BINARY_DIR}/${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs}
+ COPYONLY
+ )
+
ENDFOREACH(bbs)
FILE(APPEND
"${OUTPUT_FILE}"
"include ${BBTK_PACKAGE_NAME}/${bbs}\n"
"endefine\n"
)
+ CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/${bbs}
+ ${PROJECT_BINARY_DIR}/${BBTK_BBS_INSTALL_PATH}/${BBTK_PACKAGE_NAME}/${bbs}
+ COPYONLY
+ )
ENDFOREACH(bbs)
FILE(APPEND
"${OUTPUT_FILE}"
Program: bbtk
Module: $RCSfile: bbtkExecuter.cxx,v $ $
Language: C++
- Date: $Date: 2008/01/22 15:02:00 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
mRoot = new ComplexBlackBoxDescriptor("workspace"); //,f);
mRoot->AddToAuthor("bbi (internal)");
mRoot->AddToDescription("User's workspace");
- mCurrent.push_back(CBBDefinition(mRoot,"user"));
+ mOpenDefinition.push_back(CBBDefinition(mRoot,"user"));
// Register it into the user package
mPackage->RegisterBlackBox(mRoot);
// Insert the user package in the factory
InsertPackage(mPackage);
-
+ mOpenPackage.push_back(mPackage);
bbtkDebugDecTab("Core",9);
}
mPackage->ChangeBlackBoxName( mRoot->GetTypeName(), n );
}
+ void Executer::BeginPackage (const std::string &name)
+ {
+ bbtkDebugMessageInc("Core",9,"Executer::BeginPackage(\""<<name<<"\")"
+ <<std::endl);
+ Package* p;
+ try
+ {
+ p = GetGlobalFactory()->GetPackage(name);
+ }
+ catch (Exception e)
+ {
+ p = new Package(name,
+ "",
+ "",
+ "",
+ BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
+ InsertPackage(p);
+ }
+ mOpenPackage.push_back(p);
+ }
+
+ void Executer::EndPackage()
+ {
+ if (mOpenPackage.size()>1) mOpenPackage.pop_back();
+ }
void Executer::Define (const std::string &name,
const std::string &pack,
ComplexBlackBoxDescriptor* b = new ComplexBlackBoxDescriptor(name);
b->SetScriptFileName(scriptfilename);
- mCurrent.push_back( CBBDefinition( b, pack ) );
+ mOpenDefinition.push_back( CBBDefinition( b, pack ) );
bbtkDebugDecTab("Core",9);
}
<<Current()->GetTypeName()<<"\")"
<<std::endl);
// Does current package exist ?
- std::string pname(mCurrent.back().package);
Package* p;
+
+ std::string pname(mOpenDefinition.back().package);
+ if (pname.size()>0)
+ {
try
{
p = GetGlobalFactory()->GetPackage(pname);
BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
InsertPackage(p);
}
-
+ }
+ else
+ {
+ p = mOpenPackage.back();
+ }
p->RegisterBlackBox(Current());
- mCurrent.pop_back();
+ mOpenDefinition.pop_back();
}
Program: bbtk
Module: $RCSfile: bbtkExecuter.h,v $ $
Language: C++
- Date: $Date: 2008/01/22 16:55:04 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Sets the mode of dialog of the executer for Root inputs
void SetDialogMode(DialogModeType t) { mDialogMode = t; }
+ /// Starts a package block
+ void BeginPackage (const std::string &name );
+
+ /// Ends a package block
+ void EndPackage ();
+
/// Starts the definition of a new ComplexBlackBox in package pack
/// scriptfilename is the file from which the def is read
void Define (const std::string &name,
private:
/// Gets the current working black box
- ComplexBlackBoxDescriptor* Current() { return mCurrent.back().box; }
+ ComplexBlackBoxDescriptor* Current()
+ { return mOpenDefinition.back().box; }
/// Returns true when we are inside a define/endefine block
- // bool InDefinitionBlock() { return (mCurrent.size()>1); }
+ // bool InDefinitionBlock() { return (mOpenDefinition.size()>1); }
//==================================================================
// ATTRIBUTES
/// The stack of current working ComplexBlackBox
/// (is a stack for nested definitions)
/// only contains the root when outside a define/endefine block
- std::deque<CBBDefinition> mCurrent;
+ std::deque<CBBDefinition> mOpenDefinition;
+
+ /// The stack of current working package
+ /// (is a stack for nested definitions)
+ std::deque<Package*> mOpenPackage;
/// flag which is true when we are inside a Define/EndDefine block
// bool mDefineFlag;
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/01/28 10:50:54 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
info.help = "Executes the black box of name <box> (and connected boxes if needed). If the special keyword 'freeze' is given then freezes any further execution command. 'unfreeze' reverts to normal execution mode.";
mCommandDict[info.keyword] = info;
+ info.keyword = "package";
+ info.argmin = 1;
+ info.argmax = 1;
+ info.code = cPackage;
+ info.syntax = "package <name>";
+ info.help = "Begins the definition of a package.";
+ mCommandDict[info.keyword] = info;
+
+ info.keyword = "endpackage";
+ info.argmin = 0;
+ info.argmax = 0;
+ info.code = cEndPackage;
+ info.syntax = "endpackage";
+ info.help = "Ends the definition of a package.";
+ mCommandDict[info.keyword] = info;
+
info.keyword = "define";
info.argmin = 1;
info.argmax = 2;
mExecuter->Connect(left,right,left2,right2);
break;
+ case cPackage :
+ mExecuter->BeginPackage(words[1]);
+ break;
+
+ case cEndPackage :
+ mExecuter->EndPackage();
+ break;
+
case cDefine :
if (mFileName.size()>0)
{
}
if (words.size()==2)
{
- mExecuter->Define(words[1],"user",filename);
+ mExecuter->Define(words[1],"",filename);
}
else
{
//
bbtkDebugMessageInc("Interpreter",9,"Interpreter::SwitchToFile( \""
<<name<<"\")"<<std::endl);
-
+verbose = true;
std::vector<std::string> script_paths;
std::string libname; // full path library name
std::string pkgname; // e.g. <scriptname>.bbs
bool foundFile = false;
std::string::size_type slash_position = name.find_last_of("/\\");
- if (slash_position != std::string::npos)
+ if (false) //slash_position != std::string::npos)
{ // ------------------------------------- check user supplied location
fullnameGiven = true;
libname = Utilities::ExpandLibName(name, verbose);
path = currentDir;
}
- libname = Utilities::MakePkgnameFromPath(path, pkgname);
+ libname = Utilities::MakePkgnameFromPath(path, name); //pkgname);
// Check if library exists
if ( ! Utilities::FileExists(libname) )
{
Program: bbtk
Module: $RCSfile: bbtkInterpreter.h,v $ $
Language: C++
- Date: $Date: 2008/01/28 10:50:54 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
cDelete,
cConnect,
cExec,
+ cPackage,
+ cEndPackage,
cDefine,
cEndDefine,
cInput,
Program: bbtk
Module: $RCSfile: bbtkUtilities.h,v $
Language: C++
- Date: $Date: 2008/01/28 09:12:49 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
if (c != '/' && c != '\\')
libname += ConfigurationFile::GetInstance().Get_file_separator ();
libname += pkgname;
- libname += ".bbs";
+ int l = libname.size();
+ if (l>4)
+ {
+ if (libname.substr(l-4, 4) != ".bbs")
+ {
+ libname = libname + ".bbs";
+ }
+}
return libname;
}
Program: bbtk
Module: $RCSfile: bbtkVirtualExec.h,v $ $
Language: C++
- Date: $Date: 2008/01/22 16:55:04 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Sets the mode of dialog of the executer for Root inputs
virtual void SetDialogMode(DialogModeType t) = 0;
+ /// Starts a package block
+ virtual void BeginPackage (const std::string &name ) = 0;
+
+ /// Ends a package block
+ virtual void EndPackage () = 0;
+
/// Starts the definition of a new ComplexBlackBox in package pack
/// scriptfilename is the file from which the def is read
virtual void Define (const std::string &name,
define DoubleSlider
description "test object"
author "laurent.guigues at creatis.insa-lyon.fr"
- new Slider s1
- new Slider s2
- new Split s
-# connect ..
+new Slider slider1
+new Slider slider2
+new Split main
+
+connect slider1.Widget main.Widget1
+connect slider2.Widget main.Widget2
+
+exec main
+output Widget main.Widget "Widget"
endefine
--- /dev/null
+INCLUDE(${BBTK_DIR}/BBTKCreatePackageBBdoc.cmake)
+BBTK_CREATE_PACKAGE_BBDOC(${BBTK_PACKAGE_NAME})