コード例 #1
0
        /**
			@brief: Allows to Export Surface Voxels present in the entire volume
		*/

        public pxcmStatus ExportSurfaceVoxels(PXCMSurfaceVoxelsData surfaceVoxelsData)
        {
            return ExportSurfaceVoxels(surfaceVoxelsData, new PXCMPoint3DF32(0, 0, 0), new PXCMPoint3DF32(0, 0, 0));
        }
コード例 #2
0
        /**
            @brief: Allows user to export the voxels intersected by the surface
            scanned. Optionally allows to specify region of interest for 
			surface voxels to be exported. Voxels will be exported in parts over 
			multiple calls to this function. Client is expected to check return code to 
			determine if all voxels are exported successfully or not.
		   
            @param[out] surfaceVoxelsData: Pre-allocated instance of PXCMSurfaceVoxelsData 
            using CreatePXCMSurfaceVoxelsData method. On Success the function will fill 
            in center of each surface voxel in an array which can be obtained using QueryCenterOfSurfaceVoxels
            and Number of voxels which can be retrieved using QueryNumberOfSurfaceVoxels()

            @param[in] lowerLeftFrontPoint: Optional, PXCMPoint3DF32 represents lower 
            left corner of the front face of the bounding box which specifies region of interest for exporting 
            surface voxels 

            @param[in] upperRightRearPoint: Optional, PXCMPoint3DF32 represents upper 
            right corner of the rear face of the bounding box which specifies region of interest for exporting 
            surface voxels 
		   
           @returns: If Scene Perception module is able to export all the surface 
		   voxels it has acquired it will return PXCM_STATUS_NO_ERROR and after that 
		   any calls made to ExportSurfaceVoxels will restart exporting all the
		   voxels again.
		   If all voxels cannot be fit into specified surfaceVoxelsData, it will 
		   return warning code PXCM_STATUS_DATA_PENDING indicating that client 
		   should make additional calls to ExportSurfaceVoxels to get remaining 
		   voxels until PXCM_STATUS_NO_ERROR is returned.
		*/

        public pxcmStatus ExportSurfaceVoxels(PXCMSurfaceVoxelsData surfaceVoxelsData, PXCMPoint3DF32 lowerLeftFrontPoint, PXCMPoint3DF32 upperRightRearPoint) 
        {
            IntPtr unmanagedAddrlowerLeftFrontPoint = Marshal.AllocHGlobal(Marshal.SizeOf(lowerLeftFrontPoint));
            IntPtr unmanagedAddrupperRightRearPoint = Marshal.AllocHGlobal(Marshal.SizeOf(upperRightRearPoint));

            Marshal.StructureToPtr(lowerLeftFrontPoint, unmanagedAddrlowerLeftFrontPoint, false);
            Marshal.StructureToPtr(upperRightRearPoint, unmanagedAddrupperRightRearPoint, false);

            pxcmStatus retStatus = PXCMScenePerception_ExportSurfaceVoxels(instance, surfaceVoxelsData.instance, unmanagedAddrlowerLeftFrontPoint, unmanagedAddrupperRightRearPoint); ;

            Marshal.FreeHGlobal(unmanagedAddrlowerLeftFrontPoint);
            Marshal.FreeHGlobal(unmanagedAddrupperRightRearPoint);

            unmanagedAddrlowerLeftFrontPoint = IntPtr.Zero;
            unmanagedAddrupperRightRearPoint = IntPtr.Zero;
            return retStatus;
        }