ParticleHandler(MultiParticleHandler * _owner):owner(_owner){ params = new ofParameterGroup(); params->setName("partGroup"); setFPS(30); nn = make_shared<MyNN>(); physics = new PhysicsHandler(this); forceHandler = new ForceHandler(this); init(); CPARAM(lineStyle,0,0,10); // lineStyle.addListener(this,&ParticleHandler::changedLineStyle); CPARAM(originType,0,0,10); CPARAM(kNN,6,-1,20); kNN.addListener(this ,&ParticleHandler::changedLineStyle); params->add(*forceHandler->forcesParams); params->add(*physics->params); originType.addListener(this ,&ParticleHandler::changeOrigin); };
MultiParticleHandler(ofApp* a):AppViz(a){ params = new ofParameterGroup(); params->setName("Particles"); CPARAM(pointSize,8,0,50); CPARAM(lineWidth,8,0,50); CPARAM(drawAttr , false,false,true); CPARAM(zoom,1,0.1,10); CPARAM(distortFactor,1,0.01,10); CPARAM(defaultNumPart,10000,27,200000); particlesList.resize(NUMTHREAD_PART); initGL(); for(auto &f:particlesList){ f = new ParticleHandler(this); params->add(*f->params); } start(); for(auto &f:particlesList){ f->originType = 0; } }
NDASVOL_LINKAGE BOOL NDASVOL_CALL NdasRequestDeviceEjectW( const NDAS_SCSI_LOCATION* NdasScsiLocation, PNDAS_REQUEST_DEVICE_EJECT_DATAW EjectData) { // Slot Number should not be zero CPARAM(0 != NdasScsiLocation->SlotNo); // For now TargetID and LUN should be 0 // This will be changed when NDAS SCSI devices are hosted by a single // NDAS SCSI controller. CPARAM(0 == NdasScsiLocation->LUN && 0 == NdasScsiLocation->TargetID); CPARAM(sizeof(NDAS_REQUEST_DEVICE_EJECT_DATAW) == EjectData->Size); PNP_VETO_TYPE VetoType = static_cast<PNP_VETO_TYPE>(EjectData->VetoType); BOOL fSuccess = pRequestNdasScsiDeviceEject( NdasScsiLocation->SlotNo, &EjectData->ConfigRet, &VetoType, EjectData->VetoName, MAX_PATH); if (!fSuccess) { XTLTRACE2(NdasVolTrace, TRACE_LEVEL_ERROR, "pRequestNdasScsiDeviceEject failed, error=0x%X\n", GetLastError()); return FALSE; } EjectData->VetoType = static_cast<DWORD>(VetoType); return TRUE; }
//-------------------------------------------------------------- void ofApp::setup(){ params = new ofParameterGroup(); viz.linkApp(this); ofBackground(0); osc.setup(6001); #ifndef DEBUG ofLog() << ofToDataPath("",true); ofSetDataPathRoot("../Resources/"); ofLog() << ofToDataPath("",true); #endif syphon.setName("HeyOF"); ofSetFrameRate(30); outTexture.allocate(widthOut, heightOut); #ifdef LEAPMOTION leap.open(); #endif params->add(*viz.params); CPARAM(alphaFade,255,0,255); // CPARAM(mainColor,ofColor(255,255,255,255),ofColor(0),ofColor(255)) params->setName("mainParams"); panel = new ofxPanel(*params); vizNumber = 0; // glove.init(); outTexture.begin(); ofClear(0); outTexture.end(); // ofDrawRectangle(0, 0, widthOut, heightOut); }
NDASVOL_LINKAGE BOOL NDASVOL_CALL NdasIsNdasPathW( IN LPCWSTR FilePath) { CPARAM(IsValidStringPtrW(FilePath, UINT_PTR(-1))); XTLTRACE2(NdasVolTrace, 4, "NdasIsNdasPathW(%ls)\n", FilePath); XTL::AutoProcessHeapPtr<TCHAR> mountPoint = pGetVolumeMountPointForPath(FilePath); if (mountPoint.IsInvalid()) { XTLTRACE2(NdasVolTrace, TRACE_LEVEL_ERROR, _T("pGetVolumeMountPointForPath(%s) failed, error=0x%X\n"), FilePath, GetLastError()); return FALSE; } XTL::AutoProcessHeapPtr<TCHAR> volumeName = pGetVolumeDeviceNameForMountPoint(mountPoint); if (volumeName.IsInvalid()) { XTLTRACE2(NdasVolTrace, TRACE_LEVEL_ERROR, _T("pGetVolumeDeviceNameForMountPoint(%s) failed, error=0x%X\n"), mountPoint, GetLastError()); return FALSE; } // Volume is a \\.\C: XTL::AutoFileHandle hVolume = ::CreateFileW( volumeName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hVolume.IsInvalid()) { return FALSE; } return NdasIsNdasVolume(hVolume); }
NDASVOL_LINKAGE BOOL NDASVOL_CALL NdasIsNdasPathA( IN LPCSTR FilePath) { CPARAM(IsValidStringPtrA(FilePath, UINT_PTR(-1))); XTLTRACE2(NdasVolTrace, 4, "NdasIsNdasPathA(%hs)\n", FilePath); int nChars = ::MultiByteToWideChar(CP_ACP, 0, FilePath, -1, NULL, 0); ++nChars; // additional terminating NULL char XTL::AutoProcessHeapPtr<WCHAR> wszFilePath = reinterpret_cast<LPWSTR>( ::HeapAlloc(::GetProcessHeap(), HEAP_ZERO_MEMORY, nChars * sizeof(WCHAR))); if (wszFilePath.IsInvalid()) { ::SetLastError(ERROR_OUTOFMEMORY); return FALSE; } nChars = ::MultiByteToWideChar(CP_ACP, 0, FilePath, -1, wszFilePath, nChars); return NdasIsNdasPathW(wszFilePath); }
NDASVOL_LINKAGE BOOL NDASVOL_CALL NdasEnumNdasScsiLocationsForVolume( IN HANDLE hVolume, NDASSCSILOCATIONENUMPROC EnumProc, LPVOID Context) { CPARAM(!::IsBadCodePtr((FARPROC)EnumProc)); XTL::AutoProcessHeapPtr<VOLUME_DISK_EXTENTS> extents = pVolumeGetVolumeDiskExtents(hVolume); if (extents.IsInvalid()) { XTLTRACE2(NdasVolTrace, TRACE_LEVEL_ERROR, "IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS failed, error=0x%X\n", GetLastError()); return FALSE; } for (DWORD i = 0; i < extents->NumberOfDiskExtents; ++i) { const DISK_EXTENT* diskExtent = &extents->Extents[i]; SCSI_ADDRESS scsiAddress = {0}; if (!pGetScsiAddressForDiskNumber(diskExtent->DiskNumber, &scsiAddress)) { XTLTRACE2(NdasVolTrace, 1, "Disk %d does not seem to be attached to the SCSI controller.\n", diskExtent->DiskNumber); continue; } XTLTRACE2(NdasVolTrace, 2, "SCSI Address (PortNumber=%d,PathId=%d,TargetId=%d,LUN=%d)\n", scsiAddress.PortNumber, scsiAddress.PathId, scsiAddress.TargetId, scsiAddress.Lun); DWORD ndasSlotNumber; if (!pGetNdasSlotNumberForScsiPortNumber(scsiAddress.PortNumber, &ndasSlotNumber)) { XTLTRACE2(NdasVolTrace, 2, "ScsiPort %d does not seem to an NDAS SCSI.\n", scsiAddress.PortNumber); continue; } XTLTRACE2(NdasVolTrace, 2, "Detected Disk %d/%d has NDAS Slot Number=%d (first found only).\n", i, extents->NumberOfDiskExtents, ndasSlotNumber); NDAS_SCSI_LOCATION ndasScsiLocation = {0}; ndasScsiLocation.SlotNo = ndasSlotNumber; ndasScsiLocation.TargetID = scsiAddress.TargetId; ndasScsiLocation.LUN = scsiAddress.Lun; BOOL fContinue = EnumProc(&ndasScsiLocation, Context); if (!fContinue) { return TRUE; } } return TRUE; }