Hello @Andrii
Brief answers to the two questions: 1) Yes; 2) No, not for now.
The answer to the 1st question. Yes, you can use the functionality of existing SAMSON Elements in your Element, but only the functionality which is exposed. Please, check SAMSON Introspection mechanism (note, that some parts of the introspection functionality described in the documentation have been updated and not yet modified in the documentation).
Let's say you want to use the functionality of a class called SEMyClass from the SAMSON Element with UUID 554FEFC0-CF52-A7EC-BEBB-3230C5705738. It can be done like this:
// Create a class proxy
SBProxy* classProxy = SAMSON::getProxy("SEMyClass", SBUUID("554FEFC0-CF52-A7EC-BEBB-3230C5705738"));
// Create an instance of the class
SBValue objectHolder = classProxy->createInstance();
Now you can use the exposed functionality of this class. Let's say the exposed class has an exposed function called multiply which multiplies two arguments. This function can be called like this:
SBValue resultHolder = classProxy->call(objectHolder, "multiply", 10.0, 3.14);
double result = SB_CAST<double>(resultHolder);
The answer to the 2nd question. For now, it is not possible to use the Twister functionality in the code, because its functionality is not exposed. It might be updated in the next version.