Forum Replies Created
-
AuthorPosts
-
BineshBlocked
HI.
Also you can use handletopologychange function.
This is virtual function and you can reimplemented this function with current topology change.
You can search this function in project to learn how can use it.
Good luck
Behnam BineshBineshBlockedThanks Dear Hugo , My Problem fixed by another approach
first i create TopologySubsetData.cpp file in sofabasetopology and include TopologySubsetData.h & TopologySubsetData.inl and declare our template such as ::
template class sofa::component::topology::TopologySubsetDataImpl< sofa::component::topology::Point, sofa::helper::vector <unsigned int > > ;then i use this template in my plugin and undefined symbol error fixed
Thanks
Binesh
BineshBlockedYes , TopologySubSetDataImpl implemented in SofaBaseTopology and i use AddLinkerDependencies(SofaBaseTopology) in my cmakeFile , But after build i open cmake GUI project and i see that the SofaBaseTopology Dir NOT FOUND ,
Why ?BineshBlockedThanks Dear Hugo
i try this code but the problem still remains
The error line is :: “undefined symbol: _ZN4sofa9component8topology22TopologySubsetDataImpl
IjNS_6helper6vectorIjNS3_16CPUMemoryManagerIjEEEEE20
linkToPointDataArrayEv”i type definition for points like this ::
typedef helper::vector<unsigned int> SetIndexArray;
typedef sofa::component::topology::PointSubsetData< SetIndexArray > SubSetSetIndex;and finally i declare a variable from SubSetSetIdnex and init data in constructor.
so after build and run i got undefined symbol error
“** Thanks for support dear hugo , in future i upgrade our sofa **”
BineshBlockedUnfortunately , the problem still remains
🙁BineshBlockedThanks Dear Hugo ,
our SOFA version is old , about 2 years ago and we can not upgrade our sofa to newest version of sofa now , will happen in the future
so i try this cmake and report the resultThanks
Binesh
BineshBlockedHi pernod
yes of courseinclude(${SOFA_CMAKE_DIR}/preProject.cmake) set(HEADER_FILES FreezeSpring.h initFreezeSpring.h FreezeSpring.inl ) set(SOURCE_FILES FreezeSpring.cpp initFreezeSpring.cpp ) set(README_FILES FreezeSpring.txt ) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${MOC_FILES} ${SOURCE_FILES} ${README_FILES}) AddCompilerDefinitions("SOFA_BUILD_FREEZESPRING") AddLinkerDependencies(SofaComponentMain) include(${SOFA_CMAKE_DIR}/postProject.cmake)
Thanks @pernod
BineshBlockedHi Hugo,
Thanks for reply, i used this code but the error still available , when i write “SofaBase REQUIRED” i got an error like my previous post,
i’m so sorry but give me another solution , THANKS DEAR HUGOBinesh
BineshBlockedThanks Dear Hugo
yes , you right , my component stored in one plugin
now , i used “find_package(SOFA_LIB_COMPONENT_BASE_TOPOLOGY REQUIRED)” in my plugin’s cmake file but the cmake show me a error
//******************************************ERROR TEXT*****************************
error: By not providing “FindLIB_COMPONENT_BASE_TOPOLOGY.cmake” in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by “LIB_COMPONENT_BASE_TOPOLOGY”, but CMake did not find one. Could not find a package configuration file provided by “LIB_COMPONENT_BASE_TOPOLOGY” with any of the following names: LIB_COMPONENT_BASE_TOPOLOGYConfig.cmake lib_component_base_topology-config.cmake Add the installation prefix of “LIB_COMPONENT_BASE_TOPOLOGY” to CMAKE_PREFIX_PATH or set “LIB_COMPONENT_BASE_TOPOLOGY_DIR” to a directory containing one of the above files. If “LIB_COMPONENT_BASE_TOPOLOGY” provides a separate development package or SDK, be sure it has been installed.
//**********************************************************************************BineshBlockedThanks Dear Hugo
I read these topics and really very light but helpful for me
I wanna to study the codes
i’m waiting for solver’s Docs
Good Luck
BineshBineshBlockedI found it , I add this codes to my cmakelist and NOW i can use Qt class in my plugin
find_package(SofaGeneral REQUIRED)
find_package(SofaMisc REQUIRED)
find_package(SofaAdvanced REQUIRED)
find_package(Qt5 COMPONENTS Gui OpenGL Xml REQUIRED)
#startModifed
if(Qt5Core_FOUND)
message(“SofaGUIQt: Using Qt5”)
set(QT5_NO_LINK_QTMAIN 1)find_package(Qt5 COMPONENTS Gui OpenGL REQUIRED)
set(EXT_QT_INCLUDES ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS})
# target_include_directories(${EXT_QT_INCLUDES})set(EXT_QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5OpenGL_LIBRARIES})
qt5_wrap_cpp(MOC_FILES ${MOC_HEADER_FILES})
set(MOC_FILES_GROUP “Generated”)
qt5_wrap_ui(FORM_FILES ${UI_FILES})
set(FORM_FILES_GROUP “Generated”)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Widgets)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}”)
set(MOC_FILES_GROUP “Generated”)BineshBlockedThanks My Dear Hugo
I solved this problem , i read the code very precise and found ,
SOFA create object from factory for “stick” in many mode Like TriangleModel VS SphereModel,
when i checked DataTypes i realized that all collision model is Vec3Types in stick mode
so i change the scene and set response to “stick” and contact has been created
and i see a spring between 2 collision model
Thanks SOFA , I Love SOFABineshBlockedThanks jnbrunet
your idea is good but i use another method for this problem
i injected my code in sofaviewer::mouseEvent function and disable the mouse and set my model position in updateRay function and change the pickHandler code for my task
Thanks you soo much for your best idea
Good Luck My broBineshBlockedThank you so much dear jnbrunet
Your idea is good but i wanna to use ray method . i wan replace the mousecollision with my spherecollisionmodel . i dont want use mouse to incise and i want to use my collision model , and i want to incise i dont want to carve . i want to create a ray between to model and incise a meshBineshBlockedHi dear Hugo
yes of course . your answer was helpful
after 3 month i can develop the sofa . thanks a lot for every things
BineshBlockedYes
I share the widget and set a timer to initializegl function for my second window.BineshBlockedDear @Hugo
Thanks for your reply
I solve this problem
You guide me and i could solve this problem so Thanks a lotBineshBlockedcan you give me your code please?
BineshBlockedQtViewer::QtViewer(QWidget* parent, const char* name, const unsigned int nbMSAASamples) : QGLWidget(setupGLFormat(nbMSAASamples), parent, name,testwindow) { if(check){ SReal s = 100; SReal w = 300; window = new QWidget(); window->setFixedSize(600,600); window->setWindowTitle(":: SOFA ::"); window->show(); testwindow = new QGLWidget(window); testwindow->resize(600,600); testwindow->show(); paintGL(); drawScene(); resizeGL(300,300); initializeGL(); resetView(); drawScene(); DrawBox(&s,&w); DrawXYPlane(10,10,20,10,20,1); DrawXZPlane(10,10,20,10,20,1); DrawYZPlane(10,10,20,10,20,1); DrawLogo(); DisplayOBJs(); DisplayMenu(); drawTexture(QRectF(200,200,200,200),_materialMode); drawText(300,300,"Behnam"); //DrawAxis(100,100,100,50); update(); mytimer = new QTimer(); mytimer->start(); mytimer->singleShot(1,this,SLOT(updateGL())); } }
testwindow is my secondwindow that i create it and i want share context to this window
BineshBlocked
That is a screenshot
How can test and implement it ?BineshBlockedThanks Dear Hugo,
Yes of course , i create a QGLWidget object in QtViewer.h and pass it into QtViewer constructor as shareWidget parametr and in constructor i create a QWidget and new the QGLWidget object that create in header before … then in QGLWidget i pass my QWidget object as QWidget* parent for it.
finally i show my widget and QGLWidget with show() function.
and i call initializeGL() and PaintGL() and DrawLogo() function..
my windows will be show but no context sharing with mainwindow of sofa
it is show empty..
all that function calling was in constructor
whats your idea??Thanks So Much For Reply
BineshBlockedHi friends
can you tell me closer?
I am confused…in which class i can do your offer ?
How can create QOGWidget and where?
How can share context ? -
AuthorPosts