How to make a simple 3D Ifc Viewer in WPF with Xbim v2 - xbim

I am trying to make a small 3d viewer in VS2019 - are there any tutorials on XBim I have searched and cant find anything, I have seen this post How to make a simple 3D Ifc Viewer in WPF with Xbim I need a turorial as I have put the refrences for xbim into my VS but how to add control to the wpf form and load my new house from a folder. I just need the link please Thank you for assisting

The easiest way is to reuse components from XbimWindowsUI project. All components are available as a nuget package. Once you add the package, you can follow the SO answer you link in the question.
For reference:
<xbim:DrawingControl3D
Grid.Column="1"
Grid.Row="1"
x:Name="DrawingControl"
SelectedEntity="{Binding Path=SelectedItem, ElementName=MainWindow, Mode=TwoWay}"
Model="{Binding}"
Focusable="True"
MouseMove="DrawingControl_MouseMove">
<xbim:DrawingControl3D.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#D1CBC4" Offset="1"/>
<GradientStop Color="#C8FCFF"/>
</LinearGradientBrush>
</xbim:DrawingControl3D.Background>
</xbim:DrawingControl3D>
IfcStore ifcModel = IfcStore.Open("ifcFile.ifc");
var context = new Xbim3DModelContext(ifcModel);
context.CreateContext();
DrawingControl.Model = ifcModel;
DrawingControl.LoadGeometry(ifcModel);

Related

(ROS) Failed to create global planner

My setup is: ROS melodic, Ubuntu: 18.04
I want simulate turtlebot3 moving with my own global planner and have been following this tutorial to get started: http://wiki.ros.org/navigation/Tutorials/Writing%20A%20Global%20Path%20Planner%20As%20Plugin%20in%20ROS#Running_the_Plugin_on_the_Turtlebot. The tutorial seem to be made for ROS hydro, but as it was the best source of guidance I could find I hoped it would work.
The error I'm having is:
Failed to create the global_planner/GlobalPlanner planner, are you sure it is properly registered and that the containing library is built? Exception: MultiLibraryClassLoader: Could not create object of class type global_planner::GlobalPlanner as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
To my knowledge I've followed the tutorial as much as possible with a only a few things done differently because I wanted to test it, couldn't do as the tutorial asked, or because I thought it wouldn't impact the results. What I have done differently is:
I use the carrot_planner.h and carrot_planner.cpp files in the tutorial section 1 to test that it works before trying with my own code to avoid confusion about where possible errors come from. It's not 'different' from the tutorial to my knowledge, but figured I'd mention it. They are placed in catkin_ws/src/carrot_planner/src/global_planner/
The ros package I'm working from is in catkin_ws/src and is called the carrot_planner. In the tutorial step 1.3 I use add_library(global_planner_lib src/global_planner/carrot_planner.cpp). Would not imagine it affects the results either.
In section 3 of the tutorial it mentions that 'First, you need to copy the package that contains your global planner (in our case global_planner) into the catkin workspace of your Turtlebot (e.g. catkin_ws).' Since my package was already in catkin_ws/src/ I haven't moved it since I guess I didn't need to.
I've altered the 'move_base.launch' file in '/opt/ros/melodic/share/turtlebot3_navigation/launch/' instead of the 'move_base.launch.xml' in '/opt/ros/hydro/share/turtlebot_navigation/launch/includes/' as there doesn't seem to be a destination '...turtlebot3_navigation/launch/includes/'. There are files in launch, but no includes folder. Maybe that a difference from Hydro to Melodic, I don't know. There may be a whole lot of things that need to be done differently from the tutorial when using Melodic, or with turtlebot3, but I don't know.
I haven't made my own launch file for bringup of the turtlebot, but have instead followed this tutorial (https://emanual.robotis.com/docs/en/platform/turtlebot3/nav_simulation/) to guide me with turtlebot3. After finishing this step in the global planner tutorial 'Save and close the move_base.launch.xml. Note that the name of the planner is global_planner/GlobalPlanner the same specified in global_planner_plugin.xml. Now, you are ready to use your new planner' I tested whether it worked by running: 'roslaunch turtlebot3_gazebo turtlebot3_world.launch' and then I tried running: 'roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml' which led to the error I showed above. I have created the map-yaml, so there's no misunderstanding whether that's missing.
I would be very glad for any help, thank you ^^
Edit: My system only had 'navfn' on it, not 'global_planner' or 'carrot_planner', if that makes a difference.
After looking over the code I found a solution. It doesn't make everything work perfectly yet, but seems to solve the immediate problem.
The problem was that in my 'global_planner_plugin.xml' I just used the code provided in the tutorial:
<library path="lib/libglobal_planner_lib">
<class name="global_planner/GlobalPlanner" type="global_planner::GlobalPlanner" base_class_type="nav_core::BaseGlobalPlanner">
<description>This is a global planner plugin by iroboapp project.</description>
</class>
</library>
But in the carrot_planner.cpp file it says:
PLUGINLIB_EXPORT_CLASS(carrot_planner::CarrotPlanner, nav_core::BaseGlobalPlanner)
Changing type="global_planner::GlobalPlanner to type="carrot_planner::CarrotPlanner and then launching turtlebot3 doesn't give the same error anymore.

Websockets on Unreal Engine 4?

I am getting started with Unreal Engine 4. I come from Libgdx and I am familiarized using WebSockets clients in my games and NodeJS with 'ws' on the server.
How ever, I can't find information about Websockets and Unreal Engine 4.
I know that given that it is programmed with C++ you can add external static libraries to the unreal project.
Can I use this c++ websocket library?
https://github.com/zaphoyd/websocketpp
Will it run on Windows, Mac and console?
I am not an expert of c++ and static libraries.
Please help, thanks!
You can follow this tutorial on TCP Sockets.
You will need to make some changes on the code, as it doesn't run on UE 4.10 (the tutorial is originally from 2014).
On the .h file define 2 timer handles:
FTimerHandle TimerHandle_Connection;
FTimerHandle TimerHandle_Socket;
On the .cpp file, inside StartTCPReceiver(...) change the line where the timer is set to:
GetWorldTimerManager().SetTimer(TimerHandle_Connection, this, &AYourClass::TCPConnectionListener, 0.01, true);
and on TCPConnectionListener(...) change the line where the timer is set to:
GetWorldTimerManager().ClearTimer(TimerHandle_Connection);//optional, only if you want to stop listening for new connections
GetWorldTimerManager().SetTimer(TimerHandle_Socket, this, &AYourClass::TCPSocketListener, 0.01, true);
(Another option would be to thread these functions instead of having them in timers)
Just in case, if you are new to UE, don't add the code directly on the IDE. Go to the Content Browser > Add New > New C++ Class. You can create a new class that inherits from Actor, and when you want to start to listen to connections, you spawn that Actor.
You can use any websocket or third party asset with unreal engine. You can simply add the headers in your Build.cs file using PrivateIncludePathModuleNames for example (there's also a public include path) and it takes an array of strings where each string is a folder essentially. If you want to add a library (lib) file you can just add it like this:
if (Target.Platform == UnrealTargetPlatform.Win32 ||
Target.Platform == UnrealTargetPlatform.Win64)
{
PublicSystemLibraries.Add("crypt32.lib");
}
You can also add full paths here. If you want to do a delayed load you can just use PublicDelayLoadedDlls.Add("name") <- I may have the syntax wrong on this one but it's easy to google it.

Cocos2d-Swift v3.x Sprite Builder : In iPad iPhone sd images are used. -ipad suffix ignored

Code:
var bg = CCSprite(imageNamed:"Background.png")
Images used in Resource:
Background-hd.png
Background-ipad.png
Background-ipadhd.png
Background-iphone5hd.png
Background.png
In all device Background.png(320x480) used, other images are ignored. How to fix this ?
Retina display is not enabled...How to enable retina display in v3 ?
Here is working sample code with this problem.
I'm not really advanced user of SpriteBuilder but have some concerns about your issue.
As you are using Sprite Builder for starting the project, it configures your CCFileUtils to distinguish different devices' resources by looking at folders, not prefixes. In your app delegate you can see this line:
[CCBReader configureCCFileUtils];
going into this method you can see that search mode for file utils is set to CCFileUtilsSearchModeDirectory
sharedFileUtils.searchMode = CCFileUtilsSearchModeDirectory;
So you need to use Publish folders and copy your Background image to each of them with the same name (Background.png), but with different resolution for each device.
You don't need to use image suffixes in SpriteBuilder at all.
Finally Updated Cocos2d and now -hd,-ipad files are used. Just updated one line
sharedFileUtils.searchMode = CCFileUtilsSearchModeSuffix

cocos2dx running exported Json from cocos studio into an animation

I'm trying to read/load an exported JSON and resources from CocosStudio(this is a tool to generate animations)
But when i try to load or read is seams that the isn't any class or function in order to load this file. I did a web research and all i found were deprecated code or external libraries etc..
thinks like:
auto animation animation = extension::ccSkeletonAnimation::createWithFile("FILE.JSON","FILE.ATLAS");
animation->setPosition((x+y));
animation->setAnimation("a",true);
this->addChild(animation,0);
The code above is using an external tool similar to "cocosStudio", called "Spin"
Is it any that can provide some guidance on this...? or the proper class to set an animation a JSON file?
The cocos2dx version is 3.1
Thanks in advance!
Best regards!
I'm using this code to import animation from cocostudio to visual studio 12
cocostudio::Armature* armature;
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("DemoPlayer0.png","DemoPlayer0.plist","DemoPlayer.ExportJson");
armature = Armature::create("DemoPlayer");
armature->setPosition(ccp(visibleSize.width * 0.8,visibleSize.height * 0.5));
armature->getAnimation()->playByIndex(0);
armature->setScale(0.25);
this->addChild(armature);
Or you can check this code in help section of cocostudio.
//async loading export file
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("Cowboy0.png","Cowboy0.plist","Cowboy.ExportJson");
//Creat armature by name
CCArmature *armature = CCArmature::create("Cowboy");
//play animation by animation index
armature->getAnimation()->playByIndex(0);
//Change Permissions
armature->setScale(0.5f);
//Set the armature position
armature->setPosition(200,300);
//add to the current scene
this->addChild(armature,2)
Good luck !

Using particles in cocos2d android

I'm working on a game for android using Cocos2D-android and when I'm trying to use the CCQuadParticleSystem class, the CTOR just returns null. I spent hours searching for an example or a tutorial on this and all I found was other people asking about the same exact thing. It just returns null. I have my .plist file in my assets folder - the same file which is working just great with Cocos2D-X and IOS. According to the good people at github.com it should work so I must be doing something wrong but like I said... it just returns null when I call the CTOR with or without casting:
CCQuadParticleSystem p1 = (CCQuadParticleSystem) CCQuadParticleSystem.particleWithFile("fire.plist");
CCParticleSystem p2 = CCQuadParticleSystem.particleWithFile("fire.plist");
Please, anyone ???
if It's of use, this is the .plist file I'm working with
Have a look on this example :
link for plist
you'll get the way how to handle plist file .