How can I use the PCL visualizer (Windows) and avoid the WM_QUIT message closing my application when the visualizer closes - point-cloud-library

I am using the PCL visualizer saveScreenshot() to create a png of my pointcloud. That's all working, but when I call viewer.close(), the Windows implementation calls TerminateApp which sends a WM_QUIT that closes my application. What I want to happen is the visualizer window close and have my application continue.
I don't need any user interaction with the visualizer window. I'm just using it to get the .png from the pointcloud.
I tried initializing the visualizer without an interactor, but saveScreenshot() doesn't work with a null interactor.
Is there some way to set up the interactor without a message proc?

You can use pcl::io::savePNGFile() to export a PNG directly from your program

Can savePNGFile use camera intrinsics? Would I add camera intrinsics to the cloud to get the PNG I want?

Related

Is it possible to give beep sound using progress 4GL?

Is it possible to give beep sound using progress 4gl? If yes can you please help to share a demo program which plays beep sound if any errors? I am new to progress and it will be helpful.
take a look at the BELL statement
but you can not specifikate a sound file
it's the windows error sound
Assuming that you are using a Progress OpenEdge client that can use .Net classes, you can use the .Net console beep:
System.Console:Beep().
To play any wav you can use the SoundPlayer class:
def var o as System.Media.SoundPlayer.
o = new System.Media.SoundPlayer( 'c:\windows\media\chimes.wav' ).
o:PlaySync().

Client doesn't have a name/class at startup

I'm trying to start an application (Spotify) on a particular tag. Rules aren't applied and now I'm inspecting the client class by printing the class in a notification in the "manage" signal. This results in an empty notification.
client.connect_signal("manage", function (c, startup)
naughty.notify({title=c.class})
end)
When I restart awesome, it does print the client class, so why isn't it working when the client is initially started?
Using xprop, it also prints the class:
WM_CLASS(STRING) = "spotify", "Spotify"
Sounds like a bug in Spotify (and I think I heard about this one before). I would guess that Spotify does not follow ICCCM and only sets its WM_CLASS property after it made its window visible and not before.
I fear that you cannot do much about this except for complaining to Spotify devs to fix their stuff.
You could work around this by starting a timer in the manage signal that checks if a window turns out to be spotify a short time later. Alternatively, you could do something like client.connect_signal("property::class", function(c) if c.class == "Spotify" then print("This is now a spotify window") end end) to react to change to a window's class (of course you'd want to do something more useful to Spotify's windows than printing them).
(Per the ICCCM, a window is not allowed to change its class while it is visible, but who cares about standards...)
I had a similar issue with the claws-mail client. Inspecting it via xprop, it shows
WM_CLASS(STRING) = "claws-mail", "Claws-mail"
but awesome just did’t apply the rules for it. The trick was giving awesome-wm both of these class names in the rules section by providing a set of characters to chose from:
rule = {class = "[Cc]laws%-mail"}
I hope this works for your spotify application, too.
For further reading about patterns in lua I suggest this:
https://www.lua.org/pil/20.2.html

To check status of outlook whether its connected or disconnected without using Outlook UDF

I need to automate to check the status(Disconnected/connected/Trying to connect/Need Password) of outlook without using Outlook UDF.
Below is the code i am trying
Global $iPID = "C:\Program Files (x86)\Microsoft Office\Office14\outlook.exe"
Sleep(600)
Run($iPID, "", #SW_SHOWMAXIMIZED)
Sleep(6000)
;check the Status
$status =
Could some one please help me out check the status ??
About the ONLY option I can think of is to use hardcoded coordinates to find if the red X in the lower right when offline is true.
You can use the AutoIt Window Info tool to get the coordinates and the color.

How to read any keypress in interactive R (e.g. cursor-up or shift)?

How do you read any arbitrary keypress in R (interactive-mode), such as cursor-up or shift, and return the actual key(s) pressed?
Ideally in a device-independent, OS-independent way (I'm on Mac OS 10.8.x)
I'm talking about reading any actual arbitrary keypress including cursor-keys or modifier-keys, so scan() and readline() won't do it - cursor-keys get intercepted by the interactive console. And not just waiting for a keypress.
It's not clear this is easy or device-independent. I looked at documentation:
interactive(), options('device'), R_INTERACTIVE_DEVICE, R_DEFAULT_DEVICE
I read R-internals, which says "a graphics device... can handle requests/opportunities to take action such as... wait for an event, for example a mouse click or keypress." but it doesn't say much more.
I tried grDevices::getGraphicsEvent() but got:
> getGraphicsEvent('waiting for cursor keys', onKeybd=function(key) { print(key) } )
Error in setGraphicsEventEnv(which, as.environment(list(...))) :
this graphics device does not support event handling
It seems like if you dig deep enough you could use a toolkit-specific and/or OS-specific hack, e.g. with Quartz. This guy suggests Sudoku::playSudoku(), which uses Quartz to handle mouse and key input. I have Quartz. But a Quartz-specific solution won't work on Windows. This all seems quite messy.
Can someone please demystify all this?

VLC-Player in adobe Air App does not stop/quit

Well i have an adobe air , downloaded from below link.. it is wonderful app..
http://www.adobe.com/devnet/air/flex/articles/air_screenrecording.html
and this works fine. It captures my screen , record audio but it just does not stop or quit as vlc-player.exe continues to run in the task manager.
i tried lots of vlc- commands but it just does not stop once it starts capturing screen video.
I need help on it..
I know this is a old thread, but just in case someone wants to know...
You can't use rc-fake-tty because Windows doesn't support terminal. For Windows, tell VLC to run with only one instance, then send it the quit command as a separate NativeProcess call.
So, in the linked article, change the stopRecording() method to this:
public function stopRecording():void{
var startupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
startupInfo.executable = vlcFile;
var processArgs:Vector.<String> = new Vector.<String>();
processArgs.push("-I");
processArgs.push("rc"); //Remote control
processArgs.push("--one-instance");
processArgs.push("vlc://quit");
startupInfo.arguments = processArgs;
var killSwitch:NativeProcess = new NativeProcess();
killSwitch.start(startupInfo);
}
And make sure to add this:
processArgs.push("--one-instance");
To your initial screen record startupInfo in startRecording() method.
I quit using vlc for the same reason and started to write my recording application using .Net 4, but i am having less performance using c# now.
Edit:
VLC for windows does not support fake rc control so setting rc-fake-tty is useless. As the very last try, i wanna control is via socket. If you got it working this way, please make me informed.

Resources