Esempio n. 1
0
STDMETHODIMP CStreamSwitcherAllocator::GetBuffer(
    IMediaSample** ppBuffer,
    REFERENCE_TIME* pStartTime, REFERENCE_TIME* pEndTime,
    DWORD dwFlags)
{
    HRESULT hr = VFW_E_NOT_COMMITTED;

    if (!m_bCommitted) {
        return hr;
    }
    /*
    TRACE(_T("CStreamSwitcherAllocator::GetBuffer m_pPin->m_evBlock.Wait() + %x\n"), this);
        m_pPin->m_evBlock.Wait();
    TRACE(_T("CStreamSwitcherAllocator::GetBuffer m_pPin->m_evBlock.Wait() - %x\n"), this);
    */
    if (m_fMediaTypeChanged) {
        if (!m_pPin || !m_pPin->m_pFilter) {
            return hr;
        }

        CStreamSwitcherOutputPin* pOut = (static_cast<CStreamSwitcherFilter*>(m_pPin->m_pFilter))->GetOutputPin();
        if (!pOut || !pOut->CurrentAllocator()) {
            return hr;
        }

        ALLOCATOR_PROPERTIES Properties, Actual;
        if (FAILED(pOut->CurrentAllocator()->GetProperties(&Actual))) {
            return hr;
        }
        if (FAILED(GetProperties(&Properties))) {
            return hr;
        }

        if (!m_bCommitted || Properties.cbBuffer < Actual.cbBuffer) {
            Properties.cbBuffer = Actual.cbBuffer;
            if (FAILED(Decommit())) {
                return hr;
            }
            if (FAILED(SetProperties(&Properties, &Actual))) {
                return hr;
            }
            if (FAILED(Commit())) {
                return hr;
            }
            ASSERT(Actual.cbBuffer >= Properties.cbBuffer);
            if (Actual.cbBuffer < Properties.cbBuffer) {
                return hr;
            }
        }
    }

    hr = CMemAllocator::GetBuffer(ppBuffer, pStartTime, pEndTime, dwFlags);

    if (m_fMediaTypeChanged && SUCCEEDED(hr)) {
        (*ppBuffer)->SetMediaType(&m_mt);
        m_fMediaTypeChanged = false;
    }

    return hr;
}
/**
 * 設定画面のコンストラクタ
 */
SettingDialog::SettingDialog(wxWindow* parent, int id, const wxString& title)
:wxDialog(parent, id, title) 
{
     bottomPanel = new wxPanel(this, wxID_ANY);
     splitterWindow = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER);
     // 左側のツリー部分
     treePanel = new wxPanel(splitterWindow, wxID_ANY);
     settingTreeCtrl = new wxTreeCtrl(treePanel, ID_SettingPanelTree, wxDefaultPosition, wxDefaultSize, 
				      wxTR_HIDE_ROOT|wxTR_HAS_BUTTONS|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER);
     // 右側の設定画面部分
     settingPanel = new wxPanel(splitterWindow, wxID_ANY);
     spacePanel = new wxPanel(bottomPanel, wxID_ANY);
     // OK,キャンセルボタン
     okButton = new wxButton(bottomPanel, ID_OnOkSetting, wxT("OK"));
     cancelButton = new wxButton(bottomPanel, ID_OnCancelSetting, wxT("キャンセル"));

     SetProperties();
     DoLayout();

     // 初回は通信パネルを開く
#ifndef __WXMAC__
     wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
     vbox->Add(new NetworkSettingPanel(settingPanel));
     settingPanel->SetSizer(vbox);
#else
     // メインスレッドに更新してもらう
     SendUIUpdateEvent();
#endif
     this->SetTitle(wxT("設定 - 通信"));
}
Esempio n. 3
0
BOOL CMlsPropertyString::ExtractProperties(CString& csString)
{
	BOOL fResult = FALSE;

	TRY
	{
		m_PropertyStrings.RemoveAll();

		int nIndex = csString.Find('|');

		if (nIndex >= 0)
		{
			SetProperties(csString.Mid(nIndex+1));
			csString = csString.Left(nIndex);
			fResult = TRUE;
		}
	}
	CATCH_ALL(e)
	{
		fResult = FALSE;
	}
	END_CATCH_ALL

	return fResult;
}
VECGEOM_CUDA_HEADER_BOTH
void TransformationMatrix::SetTranslation(const Precision tx,
                                          const Precision ty,
                                          const Precision tz) {
  trans[0] = tx;
  trans[1] = ty;
  trans[2] = tz;
  SetProperties();
}
Esempio n. 5
0
Transformation3D::Transformation3D(
    const Precision tx, const Precision ty,
    const Precision tz, const Precision phi,
    const Precision theta, const Precision psi) :
fIdentity(false), fHasRotation(true), fHasTranslation(true) {
  SetTranslation(tx, ty, tz);
  SetRotation(phi, theta, psi);
  SetProperties();
}
Esempio n. 6
0
/*>void FillLoopInfo(LOOPINFO *loopinfo)
   -------------------------------------
   I/O:     LOOPINFO  *loopinfo     Input with PDB pointer arrays filled
                                    in listing the loop and contact 
                                    residues.
                                    Output with the residue property and
                                    contact property arrays completed.

   Fill in residue property flags in a loopinfo structure for both the
   loop and contacting residues.

   01.08.95 Original    By: ACRM
   02.08.95 Added AALoop and AAContact
*/
void FillLoopInfo(LOOPINFO *loopinfo)
{
   int  i;
   char res;
   
   
   for(i=0; i<loopinfo->length; i++)
   {
      res = throne((loopinfo->residues[i])->resnam);
      loopinfo->AALoop[i] = res;
      loopinfo->ResProps[i] = SetProperties(res);
   }
   for(i=0; i<loopinfo->ncontacts; i++)
   {
      res = throne((loopinfo->contacts[i])->resnam);
      loopinfo->AAContact[i] = res;
      loopinfo->ContactProps[i] = SetProperties(res);
   }
}
Esempio n. 7
0
///////////////////////////////////////////////////////////////////////////////
// Initialize - Initializes this Object with the given properties
Error ExplosionObject::Initialize( std::vector<Properties::Property> Properties )
{
    // Set this set as initialized.
    m_bInitialized = True;

    // Set properties
    SetProperties( Properties );

    return Errors::Success;
}
Esempio n. 8
0
void PBImage::Create(PBWindow *pParent, int left, int top, int width, int height, const char *path, int properties)
{

	PBImage::Create(pParent, left, top, width, height, path);

	SetProperties(properties);

	MarkAsChanged();

}
Esempio n. 9
0
Transformation3D::Transformation3D(
    const Precision tx, const Precision ty, const Precision tz,
    const Precision r0, const Precision r1, const Precision r2,
    const Precision r3, const Precision r4, const Precision r5,
    const Precision r6, const Precision r7, const Precision r8) :
fIdentity(false), fHasRotation(true), fHasTranslation(true){
  SetTranslation(tx, ty, tz);
  SetRotation(r0, r1, r2, r3, r4, r5, r6, r7, r8);
  SetProperties();
}
Esempio n. 10
0
void PBImage::Create(PBWindow *pParent, int left, int top, int width, int height)
{
	PBWindow::Create(pParent, left, top, width, height);

	FreeData();
	SetProperties(0);

	MarkAsChanged();

}
Esempio n. 11
0
// Constructor
_Collision::_Collision(const SpawnStruct &Object)
:	_Object(),
	TriangleIndexVertexArray(NULL),
	TriangleInfoMap(NULL),
	VertexList(NULL),
	FaceList(NULL) {
	
	gContactAddedCallback = CustomMaterialCallback;

	// Load collision mesh file
	_File MeshFile;
	if(MeshFile.OpenForRead(Object.Template->CollisionFile.c_str())) {

		// Read header
		int VertCount = MeshFile.ReadInt();
		int FaceCount = MeshFile.ReadInt();

		// Allocate memory for lists
		VertexList = new float[VertCount * 3];
		FaceList = new int[FaceCount * 3];

		// Read vertices
		int VertexIndex = 0;
		for(int i = 0; i < VertCount; i++) {
			VertexList[VertexIndex++] = MeshFile.ReadFloat();
			VertexList[VertexIndex++] = MeshFile.ReadFloat();
			VertexList[VertexIndex++] = -MeshFile.ReadFloat();
		}

		// Read faces
		int FaceIndex = 0;
		for(int i = 0; i < FaceCount; i++) {
			FaceList[FaceIndex+2] = MeshFile.ReadInt();
			FaceList[FaceIndex+1] = MeshFile.ReadInt();
			FaceList[FaceIndex+0] = MeshFile.ReadInt();
			FaceIndex += 3;
		}

		// Create triangle array
		TriangleIndexVertexArray = new btTriangleIndexVertexArray(FaceCount, FaceList, 3 * sizeof(int), VertCount * 3, VertexList, 3 * sizeof(float));

		// Create bvh shape
		btBvhTriangleMeshShape *Shape = new btBvhTriangleMeshShape(TriangleIndexVertexArray, true);
		TriangleInfoMap = new btTriangleInfoMap();
		btGenerateInternalEdgeInfo(Shape, TriangleInfoMap);

		// Create physics body
		CreateRigidBody(Object, Shape);
		SetProperties(Object);
		
		RigidBody->setCollisionFlags(RigidBody->getCollisionFlags() | btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);

		MeshFile.Close();
	}
}
Esempio n. 12
0
/**
 * @class UVWSConnection UVConnection.h
 * @brief implements an unsecured WebSocket connection over a libuv raw tcp socket.
 * sets up two connected CnxLayers ... a websocket layer, which will talk to a uv layer ... the object using us will request stuff which we push to the ws layer which then
 * talks over uv.
 *
 * connectState will be READY only once we have a correctly negotiated web socket
 */
UVWSConnection::UVWSConnection(std::string service, std::string host)
	: AbstractConnection(host, service)
	, CnxLayerUpper()
	, ws(this, &uv)
	, uv(&ws, service, host)
{
	SetHost(host);
	SetService(service);
	ConnectionPropertySet s;
	s.insert(CONNECTION_PERSISTENT);
	SetProperties(s);
}
Esempio n. 13
0
//done
BOOL TControl::Create()
{
	BOOL bRetval;

	dwStyle |= WS_CHILD;
	bRetval = TWindowObject::Create();

	if (bRetval)
        SetProperties();

    return bRetval;
}	//TControl::Create
Esempio n. 14
0
// Constructor
_Player::_Player(const SpawnStruct &Object)
:	_Object(),
	Sound(NULL),
	Camera(NULL),
	Light(NULL),
	JumpTimer(0.0f),
	TorqueFactor(4.0f) {

	// Graphics
	Node = irrScene->addSphereSceneNode(Object.Template->Radius, 24);
	Node->setMaterialTexture(0, irrDriver->getTexture("textures/player_outer0.png"));
	Node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR);
	Node->setMaterialFlag(EMF_LIGHTING, false);
	Node->setMaterialType(EMT_ONETEXTURE_BLEND);
	Node->getMaterial(0).MaterialTypeParam = pack_textureBlendFunc(EBF_ONE, EBF_ONE);

	// Emit Light
	if(Object.Template->EmitLight) {
		Light = irrScene->addLightSceneNode(0, vector3df(Object.Position[0], Object.Position[1], Object.Position[2]), video::SColorf(1.0f, 1.0f, 1.0f), 15.0f);
		Light->getLightData().Attenuation.set(0.5f, 0.05f, 0.05f);
		Light->getLightData().DiffuseColor.set(1.0f, 0.75f, 0.75f, 1.0f);
	}

	// Add glow
	ISceneNode *InnerNode;
	InnerNode = irrScene->addBillboardSceneNode(Node, dimension2df(1.5f, 1.5f));
	InnerNode->setMaterialFlag(EMF_LIGHTING, false);
	InnerNode->setMaterialFlag(EMF_ZBUFFER, false);
	InnerNode->setMaterialTexture(0, irrDriver->getTexture("textures/player_glow0.png"));
	InnerNode->setMaterialType(EMT_ONETEXTURE_BLEND);
	InnerNode->getMaterial(0).MaterialTypeParam = pack_textureBlendFunc(EBF_ONE, EBF_ONE);

	if(Physics.IsEnabled()) {

		// Create shape
		btSphereShape *Shape = new btSphereShape(Object.Template->Radius);

		// Set up physics
		CreateRigidBody(Object, Shape);
		RigidBody->setSleepingThresholds(0.1f, 0.1f);

		// Audio
		Sound = new _AudioSource(Audio.GetBuffer("player.ogg"), true, 0.0, 0.50f);
		Sound->SetPosition(Object.Position[0], Object.Position[1], Object.Position[2]);
		Sound->Play();
	}

	SetProperties(Object);
	Hookable = false;
	if(CollisionCallback == "")
		CollisionCallback = "OnHitPlayer";
}
Esempio n. 15
0
QtPoint::QtPoint (QGraphicsItem * parent, unsigned id, pSketcherModel &psketcher_model):
QtPrimitiveBase(parent),
Point(id,psketcher_model)
{
	SetProperties(PointPrimitive);
	SetSelectedProperties(SelectedPointPrimitive);
	SetMouseHoverProperties(HoverPointPrimitive);

	setZValue(GetProperties().GetZ());

	// Display the newly create ais_object
	Display();
}
Esempio n. 16
0
QtPoint::QtPoint (QGraphicsItem * parent, double x, double y, double z, bool x_free, bool y_free, bool z_free) :
QtPrimitiveBase(parent),
Point(x,y,z,x_free,y_free,z_free)
{
	SetProperties(PointPrimitive);
	SetSelectedProperties(SelectedPointPrimitive);
	SetMouseHoverProperties(HoverPointPrimitive);

	setZValue(GetProperties().GetZ());

	// Display the newly create ais_object
	Display();
}
Esempio n. 17
0
QtArc2D::QtArc2D (QGraphicsItem * parent,DOFPointer s_center, DOFPointer t_center, DOFPointer theta_1, DOFPointer theta_2, DOFPointer radius, SketchPlanePointer sketch_plane):
QtPrimitiveBase(parent),
Arc2D(s_center,t_center,theta_1,theta_2,radius,sketch_plane),
pending_db_save_(false)
{
	SetProperties(Primitive);
	SetSelectedProperties(SelectedPrimitive);
	SetMouseHoverProperties(HoverPrimitive);

	setZValue(GetProperties().GetZ());

	// Display the newly create ais_object
	Display();
}
Esempio n. 18
0
Config::Config(wxWindow* parent)
{
#if defined __WXMAC__
#if wxCHECK_VERSION(2,9,1)
  SetSheetStyle(wxPROPSHEET_BUTTONTOOLBOOK | wxPROPSHEET_SHRINKTOFIT);
#else
  SetSheetStyle(wxPROPSHEET_LISTBOOK | wxPROPSHEET_SHRINKTOFIT);
#endif
#else
  SetSheetStyle(wxPROPSHEET_LISTBOOK);
#endif
  SetSheetInnerBorder(3);
  SetSheetOuterBorder(3);

#if defined __WXMAC__
  #define IMAGE(img) wxImage(wxT("wxMaxima.app/Contents/Resources/config/") wxT(img))
#elif defined __WXMSW__
  #define IMAGE(img) wxImage(wxT("art/config/") wxT(img))
#else
  wxString prefix = wxT(PREFIX);
  #define IMAGE(img) wxImage(prefix + wxT("/share/wxMaxima/") + wxT(img))
#endif

  wxSize imageSize(32, 32);
  m_imageList = new wxImageList(32, 32);
  m_imageList->Add(IMAGE("options.png"));
  m_imageList->Add(IMAGE("maxima.png"));
  m_imageList->Add(IMAGE("styles.png"));

  Create(parent, wxID_ANY, _("wxMaxima configuration"),
      wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE);

  m_notebook = GetBookCtrl();

  m_notebook->SetImageList(m_imageList);

  m_notebook->AddPage(CreateOptionsPanel(), _("Options"), true, 0);
  m_notebook->AddPage(CreateMaximaPanel(), _("Maxima"), false, 1);
  m_notebook->AddPage(CreateStylePanel(), _("Style"), false, 2);

#ifndef __WXMAC__
  CreateButtons(wxOK | wxCANCEL);
#endif

  LayoutDialog();

  SetProperties();
  UpdateExample();
}
Esempio n. 19
0
HRESULT CDebugLog::Init(IApplicationContext *pAppCtx, IAssemblyName* pName, LPCWSTR szCodebase)
{
    HRESULT hr = S_OK;
    _ASSERTE(pName || szCodebase);

    hr = SetAsmName(pName, szCodebase);
    if (FAILED(hr)) {
        goto Exit;
    }

    hr = SetProperties(pAppCtx);

Exit:
    return hr;
}
Esempio n. 20
0
bool CPFAOptimize::SetProperties( map< int, vector< int > >& IntVecMap, const int& iRow, const int& iLine, const int& iValue )
{
	map< int, vector< int > >::iterator IntVecMapIt = IntVecMap.find( iRow );
	if( IntVecMap.end() == IntVecMapIt )
	{
		vector< int > TempVector;
		for( int i = 1; i < iLine; i++ )
		{
			TempVector.push_back( 0 );
		}
		IntVecMap.insert( map< int, vector< int > >::value_type( iRow, TempVector ) );
		return true;
	}
	return SetProperties( IntVecMapIt->second, iLine, iValue );
}
Esempio n. 21
0
BOOL CImconDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	
	// TODO: Add your specialized creation code here
  BOOL bResult;
  bResult = m_Dib.ReadFromFile(lpszPathName);
  if (bResult)
    {
     SetProperties();
     m_strFormat = "Bitmap"; 
    }
 
  return bResult;
}
Esempio n. 22
0
QtAngleLine2D::QtAngleLine2D(QGraphicsItem * parent, const Line2DPointer line1, const Line2DPointer line2, double angle, bool interior_angle):
    QtPrimitiveBase(parent),
    AngleLine2D(line1,line2,angle,interior_angle),
    pending_db_save_(false)
{
    SetProperties(Annotation);
    SetSelectedProperties(SelectedAnnotation);
    SetMouseHoverProperties(HoverAnnotation);

    setZValue(GetProperties().GetZ());

    angle_widget_ = 0;

    // Display the newly create ais_object
    Display();
}
Esempio n. 23
0
QtArc2D::QtArc2D (QGraphicsItem * parent, unsigned id, pSketcherModel &psketcher_model):
QtPrimitiveBase(parent),
Arc2D(id,psketcher_model),
pending_db_save_(false)
{
	SetProperties(Primitive);
	SetSelectedProperties(SelectedPrimitive);
	SetMouseHoverProperties(HoverPrimitive);

	setZValue(GetProperties().GetZ());

	radius_widget_ = 0;

	// Display the newly create ais_object
	Display();
}
Esempio n. 24
0
HRESULT CDebugLog::Init(IApplicationContext *pAppCtx, LPCWSTR szAsmName)
{
    HRESULT hr = S_OK;
    _ASSERTE(szAsmName);

    _pwzAsmName = WSTRDupDynamic(szAsmName);
    if (!_pwzAsmName) {
        hr = E_OUTOFMEMORY;
        goto Exit;
    }

    hr = SetProperties(pAppCtx);

Exit:
    return hr;
}
Esempio n. 25
0
QtArc2D::QtArc2D (QGraphicsItem * parent, double s1, double t1, double s2, double t2, double s3, double t3,
			SketchPlanePointer sketch_plane, bool s_center_free, bool t_center_free, bool theta_1_free, bool theta_2_free, bool radius_free):
QtPrimitiveBase(parent),
Arc2D(s1,t1,s2,t2,s3,t3, sketch_plane, s_center_free, t_center_free, theta_1_free, theta_2_free,radius_free),
pending_db_save_(false)
{
	SetProperties(Primitive);
	SetSelectedProperties(SelectedPrimitive);
	SetMouseHoverProperties(HoverPrimitive);

	setZValue(GetProperties().GetZ());

	radius_widget_ = 0;

	// Display the newly create ais_object
	Display();
}
Esempio n. 26
0
VECGEOM_CUDA_HEADER_BOTH
void TransformationMatrix::SetRotation(
    const Precision rot0, const Precision rot1, const Precision rot2,
    const Precision rot3, const Precision rot4, const Precision rot5,
    const Precision rot6, const Precision rot7, const Precision rot8) {

  rot[0] = rot0;
  rot[1] = rot1;
  rot[2] = rot2;
  rot[3] = rot3;
  rot[4] = rot4;
  rot[5] = rot5;
  rot[6] = rot6;
  rot[7] = rot7;
  rot[8] = rot8;

  SetProperties();
}
Esempio n. 27
0
QtPoint2D::QtPoint2D (QGraphicsItem * parent, unsigned id, pSketcherModel &psketcher_model):
QtPrimitiveBase(parent),
Point2D(id,psketcher_model),
pending_db_save_(false)
{
	SetProperties(PointPrimitive);
	SetSelectedProperties(SelectedPointPrimitive);
	SetMouseHoverProperties(HoverPointPrimitive);

	setZValue(GetProperties().GetZ());

	double x_position, y_position, z_position;

	Get3DLocation(x_position, y_position, z_position);

	// Display the newly create ais_object
	Display();
}
Esempio n. 28
0
QtPoint2D::QtPoint2D (QGraphicsItem * parent, DOFPointer s, DOFPointer t, SketchPlanePointer sketch_plane) :
Point2D(s,t,sketch_plane),
QtPrimitiveBase(parent),
pending_db_save_(false)
{
	SetProperties(PointPrimitive);
	SetSelectedProperties(SelectedPointPrimitive);
	SetMouseHoverProperties(HoverPointPrimitive);

	setZValue(GetProperties().GetZ());

	double x_position, y_position, z_position;

	Get3DLocation(x_position, y_position, z_position);

	// Display the newly create ais_object
	Display();
}
/*
 * Used to start listening to the sensor
 */
void CSensorBackendSym::StartListeningL()
    {
    // Check if data listening is enabled
    if(iBackendData.iDataListening)
        {
        SetProperties();
        // Start listening to the sensor 
        // Before calling this api the channel should be found and opened
        iBackendData.iSensorChannel->StartDataListeningL( this,
                KDesiredReadingCount,
                KMaximumReadingCount,
                KDefaultBufferingPeriod );
        }
    // start property listening if required         //put it above
    if ( iBackendData.iPropertyListening )
        {
        iBackendData.iSensorChannel->SetPropertyListenerL(this);
        }
    }
Esempio n. 30
0
Error
GeometryObject::Initialize(
    std::vector<Properties::Property> Properties
    )
{
    ASSERT( !m_bInitialized );

    //
    // Set this set as initialized.
    //
	m_bInitialized = True;

    //
    // Set the properties for this object.
    //
    SetProperties( Properties );

    return Errors::Success;
}