コード例 #1
0
void VertexBuffer::Copy(const VertexBuffer *source, uint destIndex)
{
	ASSERT(source != NULL);
	ASSERT(source->GetNumElements() > 0);
	ASSERT(source->GetStandardAttribs() == m_standardTypeAttribs);
	ASSERT(destIndex >= 0);
	ASSERT(destIndex + source->GetNumElements() <= GetNumElements());

	uint destOffset = GetVertexPosition(destIndex);
	memcpy(&m_buffer[destOffset], source->GetBuffer(), GetNumElements() * GetElementWidthInBytes());

	SetDirty();
}
コード例 #2
0
   void ShaderParamTextureCubeMap::AttachToRenderState(osg::StateSet &stateSet)
   {
      dtCore::RefPtr<osg::TextureCubeMap> texCube;

      if (GetTexture().empty() && GetTextureSourceType() != ShaderParamTexture::TextureSourceType::AUTO)
      {
         throw dtUtil::Exception(ShaderParameterException::INVALID_ATTRIBUTE,"Cannot attach to render state.  Texture "
            "for parameter " + GetName() + " has not been specified.", __FILE__, __LINE__);
      }

      osg::Uniform *uniform = NULL;

      if (IsShared())
         uniform = GetUniformParam();
      // Create a new one if unshared or if shared but not set yet
      if (uniform == NULL)
      {
         uniform = new osg::Uniform(osg::Uniform::SAMPLER_CUBE,GetName());
         uniform->set((int)GetTextureUnit());
         SetUniformParam(*uniform);
      }

      stateSet.addUniform(uniform);

      // Load (if necessary) and Set the Tex cube map on the StateSet
      if(GetTextureSourceType() == ShaderParamTexture::TextureSourceType::CUBEMAP_IMAGE_POSITIVE_X ||
         GetTextureSourceType() == ShaderParamTexture::TextureSourceType::CUBEMAP_IMAGE_NEGATIVE_X ||
         GetTextureSourceType() == ShaderParamTexture::TextureSourceType::CUBEMAP_IMAGE_POSITIVE_Y ||
         GetTextureSourceType() == ShaderParamTexture::TextureSourceType::CUBEMAP_IMAGE_NEGATIVE_Y ||
         GetTextureSourceType() == ShaderParamTexture::TextureSourceType::CUBEMAP_IMAGE_POSITIVE_Z ||
         GetTextureSourceType() == ShaderParamTexture::TextureSourceType::CUBEMAP_IMAGE_NEGATIVE_Z
      )
      {
         texCube = static_cast<osg::TextureCubeMap*>(GetTextureObject());

         // load or reload the image - allows caching from the template
         // Note - ImageSourceDirty may not be relevant anymore cause it now loads the image when you call SetTexture().
         // note - If shared, load only happens the first time it is assigned.
         // check only if face 0 exists. Is this sufficient?
         if (texCube->getImage(osg::TextureCubeMap::POSITIVE_X) == NULL || IsImageSourceDirty())
         {
            LoadImage();
            ApplyTextureCubeMapValues();
         }

         //Assign the completed texture attribute to the render state.
         stateSet.setTextureAttributeAndModes(GetTextureUnit(), texCube.get(), osg::StateAttribute::ON);
      }

      SetDirty(false);
   }
コード例 #3
0
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Update: update this model to the given time, in msec
void CModel::UpdateTo(float time)
{
	// update animation time, but don't calculate bone matrices - do that (lazily) when
	// something requests them; that saves some calculation work for offscreen models,
	// and also assures the world space, inverted bone matrices (required for normal
	// skinning) are up to date with respect to m_Transform
	m_AnimTime = time;

	// mark vertices as dirty
	SetDirty(RENDERDATA_UPDATE_VERTICES);

	// mark matrices as dirty
	InvalidatePosition();
}
コード例 #4
0
OListLayout *OListLayout :: AddColumn ( )
{
  OListLayout   *new_col = NULL;
  SetDirty();
  if ( !columns )
    columns = new DLL(OListLayout);
    
  new_col = new OListLayout(this);
  columns->AddTail(new_col);
  new_col->set_intern_id(GetTreeLayout()->IncreaseID());
  
// should emit slotLayoutChanged();
  return(new_col);
}
コード例 #5
0
ファイル: TextTrack.cpp プロジェクト: gcp/gecko-dev
void
TextTrack::RemoveCue(TextTrackCue& aCue, ErrorResult& aRv)
{
  aCue.SetActive(false);

  mCueList->RemoveCue(aCue, aRv);
  if (mTextTrackList) {
    HTMLMediaElement* mediaElement = mTextTrackList->GetMediaElement();
    if (mediaElement) {
      mediaElement->NotifyCueRemoved(aCue);
    }
  }
  SetDirty();
}
コード例 #6
0
ファイル: IControl.cpp プロジェクト: b-vesco/wdl-ol
void IControl::SetValueFromPlug(double value)
{
	if (mDefaultValue < 0.0) {
		mDefaultValue = mValue = value;
//		SetDirty(false);
 //   Redraw();
	}
//	else 
	if (mValue != value) {
		mValue = value;
		SetDirty(false);
		Redraw();
	}
}
コード例 #7
0
ファイル: IControl.cpp プロジェクト: b-vesco/wdl-ol
void IControl::OnMouseDown(int x, int y, IMouseMod* pMod)
{
	if (pMod->R) {
		PromptUserInput();
	}
#ifdef RTAS_API
  else if (pMod->A) {
    if (mDefaultValue >= 0.0) {
      mValue = mDefaultValue;
      SetDirty();
    }
  }
#endif
}
コード例 #8
0
ファイル: wxlwindow.cpp プロジェクト: gitrider/wxsj2
wxLayoutWindow::wxLayoutWindow(wxWindow *parent)
              : wxScrolledWindow(parent, wxID_ANY,
                                 wxDefaultPosition, wxDefaultSize,
                                 wxHSCROLL | wxVSCROLL |
                                 wxBORDER |
                                 wxWANTS_CHARS),
                m_llist(NULL)
{
#if wxUSE_STATUSBAR
    SetStatusBar(NULL); // don't use statusbar
#endif // wxUSE_STATUSBAR
    m_Editable = false;
    m_doSendEvents = false;
    m_ViewStartX = 0; m_ViewStartY = 0;
    m_DoPopupMenu = true;
    m_PopupMenu = MakeFormatMenu();
    m_memDC = new wxMemoryDC;
    m_bitmap = new wxBitmap(4,4);
    m_bitmapSize = wxPoint(4,4);
    m_llist = new wxLayoutList();
    m_BGbitmap = NULL;
    m_ScrollToCursor = false;
#ifndef __WXMSW__
    m_FocusFollowMode = false;
#endif
    SetWordWrap(false);
    SetWrapMargin(0);

    // no scrollbars initially
    m_hasHScrollbar =
    m_hasVScrollbar = false;

    m_Selecting = false;

#ifdef WXLAYOUT_USE_CARET
    // FIXME cursor size shouldn't be hardcoded
    wxCaret *caret = new wxCaret(this, 2, 20);
    SetCaret(caret);
    m_llist->SetCaret(caret);
#endif // WXLAYOUT_USE_CARET

    m_HaveFocus = false;
    m_HandCursor = false;
    m_CursorVisibility = -1;
    SetCursor(wxCURSOR_IBEAM);
    SetDirty();

    // at least under Windows, this should be the default behaviour
    m_AutoDeleteSelection = true;
}
コード例 #9
0
void
InfoBoxManager::ProcessQuickAccess(const int id, const TCHAR *Value)
{
  if (id < 0)
    return;

  // do approciate action
  if (InfoBoxes[id] != NULL)
    InfoBoxes[id]->HandleQuickAccess(Value);

  SetDirty();

  ResetDisplayTimeOut();
}
コード例 #10
0
ファイル: ServerList.cpp プロジェクト: HydraIRC/hydrairc
void CServerListView::UpdateItem(int ItemType, void *pItemData)
{
  HTREEITEM hItem;
  TVITEM item;
  char ItemName[MAX_SERVERLIST_ITEM_LEN+1];

  hItem = FindItem(ItemType,pItemData);
  if (hItem)
  {
    // delete the item
    item.mask = TVIF_TEXT | TVIF_PARAM;
    item.hItem = hItem; // we want more info about this tree node.
    item.pszText = ItemName;
    item.cchTextMax = MAX_SERVERLIST_ITEM_LEN; // TODO: check +1 ? for null terminator...
    if (m_tree.GetItem(&item))
    { 
      TreeItemInfo *pTII = (TreeItemInfo *)item.lParam;
#ifdef DEBUG
      ATLASSERT(pTII->m_Data == pItemData); // Double check we're attempting to update the right item
#endif

      // Set the item's dirty flag.
      //pTII->m_Flags |= STII_DIRTY;
      // and after all that, lol.. instead we just set a flag for the whole list
      // not individial items
      SetDirty();

      STIInfo *pSTI = new STIInfo(ItemType,pItemData);
      if (pSTI)
      {
        if (strncmp(pSTI->m_ItemName,item.pszText,MAX_SERVERLIST_ITEM_LEN) != 0)
        {
          // item name is different, update it!
          strncpy(ItemName,pSTI->m_ItemName,MAX_SERVERLIST_ITEM_LEN);
          ItemName[MAX_SERVERLIST_ITEM_LEN] = 0; // truncate!
          m_tree.SetItemText(hItem,ItemName);
          m_tree.SortChildren(m_tree.GetParentItem(hItem));
        }
        delete (pSTI);
      }
    }
  }
#ifdef DEBUG
  else
  {
    ATLASSERT(0); // couldn't find the item we're trying to update!
  }
#endif
}
コード例 #11
0
bool ConfigGroup::DeleteEntry(const wxChar *szName)
{
  ConfigEntry *pEntry = FindEntry(szName);
  wxCHECK( pEntry != NULL, FALSE );  // deleting non existing item?

  LineList *pLine = pEntry->GetLine();
  if ( pLine != NULL ) {
    // notice that we may do this test inside the previous "if" because the
    // last entry's line is surely !NULL
    if ( pEntry == m_pLastEntry ) {
      // our last entry is being deleted - find the last one which stays
      wxASSERT( m_pLine != NULL );  // if we have an entry with !NULL pLine...

      // go back until we find another entry or reach the group's line
      ConfigEntry *pNewLast = NULL;
      size_t n, nEntries = m_aEntries.Count();
      LineList *pl;
      for ( pl = pLine->Prev(); pl != m_pLine; pl = pl->Prev() ) {
        // is it our subgroup?
        for ( n = 0; (pNewLast == NULL) && (n < nEntries); n++ ) {
          if ( m_aEntries[n]->GetLine() == m_pLine )
            pNewLast = m_aEntries[n];
        }

        if ( pNewLast != NULL ) // found?
          break;
      }

      if ( pl == m_pLine ) {
        wxASSERT( !pNewLast );  // how comes it has the same line as we?

        // we've reached the group line without finding any subgroups
        m_pLastEntry = NULL;
      }
      else
        m_pLastEntry = pNewLast;
    }

    m_pConfig->LineListRemove(pLine);
  }

  // we must be written back for the changes to be saved
  SetDirty();

  m_aEntries.Remove(pEntry);
  delete pEntry;

  return TRUE;
}
コード例 #12
0
void PluginManager::EnablePlugin(const wxString & type, const wxString & path, bool enable)
{
   int cnt = GetPluginCount(type);

   for (int i = 0; i < cnt; i++) {
      wxString registered = GetPlugin(type, i);
      if (registered == path) {
         mConfig->SetPath(wxT(".."));
         mConfig->Write(wxT("Enabled"), enable);
         SetDirty(true);
         mConfig->SetPath(wxT("private"));
         break;
      }
   }
}
コード例 #13
0
void PluginManager::RegisterPlugin(const wxString & type, const wxString & path)
{
   if (IsRegistered(type, path)) {
      return;
   }

   mConfig->SetPath(wxString::Format(wxT("/%s/%d"), type.c_str(), GetPluginCount(type)));

   mConfig->Write(wxT("PluginPath"), path);
   SetDirty();

   mConfig->SetPath(wxT("private"));

   return;
}
コード例 #14
0
ファイル: effecteditor.cpp プロジェクト: BtbN/crimson-core
void EffectEditor::SetEffect(Effect *effect)
{
  _effect = effect;

	_stagesModel->SetEffect (effect);
	_programsModel->SetEffect (effect);
	_programsModel->SetStage (0);

	_gui.pushButtonAddStage->setEnabled (effect != 0);
  _groupView->SetGroupTreeItem(&effect->GetCategory());

  SetItem (effect);

	SetDirty (false);
}
コード例 #15
0
ファイル: InternalPropertyPage.cpp プロジェクト: avdbg/MPC-BE
BOOL CInternalPropertyPageWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
	if (message == WM_COMMAND || message == WM_HSCROLL || message == WM_VSCROLL) {
		WORD notify = HIWORD(wParam);
		// check only notifications that change the state of a control, otherwise false positives are possible.
		if (notify == BN_CLICKED
				|| notify == CBN_SELCHANGE
				|| notify == EN_CHANGE
				|| notify == CLBN_CHKCHANGE) {
			SetDirty(true);
		}
	}

	return __super::OnWndMsg(message, wParam, lParam, pResult);
}
コード例 #16
0
ファイル: VectorSpace.cpp プロジェクト: eriser/Voltex
void VectorSpace::setValues(std::tr1::array<double, 2048> table, int precision) {
    clear();
    double increment = 2048.0 / precision;
    for (double i = 0; i < 2048; i += increment) {
        VectorPoint point;
        point.x = i / 2048.0;
        point.y = (table[i] + 1) / 2;
        points.push_back(point);
    }
    std::sort(points.begin(), points.end());
    SetDirty();
    if (sendSignals) {
        tableChanged(index);
    }
}
コード例 #17
0
void CBkmrkProperties::SetDescriptionL(const TDesC& aDescription)
	{
	// The aDescription must be smaller that the maximim descriptor storage size
	__ASSERT_ALWAYS(aDescription.Length() <= Bookmark::KMaxDescriptorLength, User::Panic(Bookmark::KBookmarkErrTooLong, KErrArgument));

	iParent.LeaveIfNotWritableL();
	
	if (iDescription)
		{
		delete iDescription;
		iDescription = NULL;
		}
	iDescription = aDescription.AllocL();
	SetDirty();
	}
コード例 #18
0
ファイル: FilterProperties.cpp プロジェクト: JREkiwi/sagetv
INT_PTR CFilterProperties::OnReceiveMessage( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
    switch(uMsg)
    {
        case WM_INITDIALOG:
        {
            m_hwndDialog = hwnd;
			DisplayInfo();
            return (INT_PTR)TRUE;
        }

        case WM_DESTROY:
        {
            DestroyWindow(m_hwndDialog);
            return (INT_PTR)TRUE;
        }

        case WM_COMMAND:
        {
            switch (LOWORD (wParam)) {
			case IDOK: 
				SetDirty();
				break ;
			case IDC_BTN_UPDATE:
				DisplayInfo();
				break;
			default:;
            };
            return (INT_PTR)TRUE;
        }

        case WM_NOTIFY:
        {
            switch (wParam){
			case -1: break;
			default:;
            } // end switch (wParam)
			OnUpdate();
        }

        default:
            return (INT_PTR)FALSE;
    }
    
	return CBasePropertyPage::OnReceiveMessage(hwnd,uMsg,wParam,lParam);
    //return TRUE;

} // OnReceiveMessage
コード例 #19
0
void
InfoBoxManager::ProcessKey(InfoBoxContent::InfoBoxKeyCodes keycode)
{
  int focus = GetFocused();
  if (focus < 0)
    return;

  if (InfoBoxes[focus] != NULL)
    InfoBoxes[focus]->HandleKey(keycode);

  InputEvents::HideMenu();

  SetDirty();

  ResetDisplayTimeOut();
}
LRESULT CLogoMarkerPropertyPage::OnChangeEdt_yoffset(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	if (m_bShown)
	{
		CComBSTR bsText;
		double dText;
		GetDlgItemText(IDC_EDT_YOFFSET, bsText.m_str);
		VarR8FromStr(bsText,1033,0, &dText);
		m_ipMSymbol->put_YOffset(dText);
		// Change the page to dirty
		SetDirty(TRUE);
		//refresh property sheet
		m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
	}
	return 0;
}
コード例 #21
0
ファイル: IControl.cpp プロジェクト: b-vesco/wdl-ol
void IControl::OnMouseWheel(int x, int y, IMouseMod* pMod, int d)
{
#ifdef RTAS_API
  if (pMod->C) {
		mValue += 0.001 * d;
	}
#else
  if (pMod->C || pMod->S) {
		mValue += 0.001 * d;
	}
#endif
	else {
		mValue += 0.01 * d;
	}
	SetDirty();
}
コード例 #22
0
ファイル: StorageBase.cpp プロジェクト: cschladetsch/KAI
void StorageBase::Remove(const Label &label)
{
    Dictionary::iterator iter = dictionary.find(label);
    if (iter == dictionary.end())
        return;

    SetDirty();
    StorageBase *child = iter->second.GetBasePtr();
    dictionary.erase(iter);

    if (child)
    {
        child->SetParentHandle(Handle());
        child->RemovedFromContainer(*this);
    }
}
コード例 #23
0
//-----------------------------------------------------------------------------
// Purpose: Revert to last saved state
//-----------------------------------------------------------------------------
void CExpression::Revert( void )
{
	SetDirty( false );

	if ( undo.Size() <= 0 )
		return;

	// Go back to original data
	CExpUndoInfo *u = undo[ undo.Size() - 1 ];
	Assert( u );

	memcpy( setting, u->setting, GLOBAL_STUDIO_FLEX_CONTROL_COUNT * sizeof( float ) );
	memcpy( weight, u->weight, GLOBAL_STUDIO_FLEX_CONTROL_COUNT * sizeof( float ) );

	ResetUndo();
}
コード例 #24
0
ファイル: ecgdv.cpp プロジェクト: vagnerr/ECGHolterMonitor
BOOL TDrawDocument::Commit(BOOL force)
{
  if (!IsDirty() && !force)
	 return TRUE;

  TOutStream* os = OutStream(ofWrite);
  if (!os)
	 return FALSE;

	 *os << *ecg;

  delete os;

  SetDirty(FALSE);
  return TRUE;
}
コード例 #25
0
ファイル: CoreGLCanvas.cpp プロジェクト: Dangr8/Cities3D
void wxCoreGLCanvas::OnSize(wxSizeEvent& event)
{
#	ifdef __WXGTK__
	if(false == mPainted)
	{
		return;
	}
#	endif

    //this is also necessary to update the context on some platforms
    event.Skip();

	ResizeGL();

	SetDirty();
}
コード例 #26
0
ファイル: BCGPKnob.cpp プロジェクト: iclosure/jframework
//*******************************************************************************
void CBCGPKnob::SetImageList(UINT uiResID, int cx, const CBCGPSize& szMargin)
{
    m_Icons.Destroy();

    m_sizeIcon = CBCGPSize(0, 0);

    if (uiResID != 0)
    {
        m_Icons.Load(uiResID);
        m_sizeIcon.cx = cx;

        m_sizeIconMargin = szMargin;
    }

    SetDirty();
}
コード例 #27
0
void PhonemeEditor::CloseCaption_EditPhrase( CCloseCaptionPhrase *phrase )
{
	CEditPhraseParams params;
	memset( &params, 0, sizeof( params ) );
	strcpy( params.m_szDialogTitle, "Edit Phrase" );
	strcpy( params.m_szPrompt, "Current Phrase:" );
	wcscpy( params.m_szInputText, phrase->GetStream() );

	params.m_nLeft = -1;
	params.m_nTop = -1;

	params.m_bPositionDialog = true;

	if ( params.m_bPositionDialog )
	{
		RECT rcPhrase;
		CloseCaption_GetPhraseRect( phrase, rcPhrase );

		// Convert to screen coords
		POINT pt;
		pt.x = rcPhrase.left;
		pt.y = rcPhrase.top;

		ClientToScreen( (HWND)getHandle(), &pt );

		params.m_nLeft	= pt.x;
		params.m_nTop	= pt.y;
	}

	if ( !EditPhrase( &params ) )
	{
		SetFocus( (HWND)getHandle() );
		return;
	}

	SetFocus( (HWND)getHandle() );

	SetDirty( true );

	PushUndo();

	phrase->SetStream( params.m_szInputText );

	PushRedo();

	redraw();
}
コード例 #28
0
STDMETHODIMP 
CContextSamplePropPage::Apply( void )
{
    HRESULT hr = S_OK;
    long lMaxSize = 0;

    if ( ! m_bDirty )
    {
        return( S_OK );
    }

    hr = RetrieveDialogInformation();

    if( SUCCEEDED( hr ) )
    {
        //
        // Set all the properties that have changed.
        //
        if( !m_pPluginAdmin )
        {
            MessageBox( IDS_SERVER_CONNECT_ERROR );
            return( E_FAIL );
        }
        else
        {
            // Check the old values and only set if they have changed
            if( ( NULL != m_bstrOrigOutputPath.m_str )
                && ( NULL != m_bstrOutputPath.m_str )
                && _wcsicmp( m_bstrOrigOutputPath, m_bstrOutputPath ) )
            {
                m_pPluginAdmin->put_OutputPath( m_bstrOutputPath );
            }

            if( m_wmsOrigContextTypes != m_wmsContextTypes )
            {
                m_pPluginAdmin->put_ContextTypes( m_wmsContextTypes );
            }
        }
    }

    if( SUCCEEDED( hr ) )
    {
        SetDirty( FALSE );
    }

    return( hr );
} //end of Apply.
コード例 #29
0
void PHPProjectSettingsDlg::Save()
{
    PHPProject::Ptr_t pProject = PHPWorkspace::Get()->GetProject(m_projectName);
    CHECK_PTR_RET(pProject);

    PHPProjectSettingsData& data = pProject->GetSettings();

    // General settings
    data.SetRunAs(m_choicebook1->GetSelection() == 0 ? PHPProjectSettingsData::kRunAsCLI :
                  PHPProjectSettingsData::kRunAsWebsite);
    data.SetPhpExe(m_filePickerPHPExe->GetPath());
    data.SetIndexFile(m_filePickerIndex->GetPath());
    data.SetArgs(m_textCtrlProgramArgs->GetValue());
    data.SetWorkingDirectory(m_dirPickerWorkingDirectory->GetPath());
    data.SetIncludePath(m_textCtrlPHPIncludePath->GetValue());
    data.SetPauseWhenExeTerminates(m_checkBoxPauseWhenExecutionEnds->IsChecked());
    data.SetPhpIniFile(m_filePickerPhpIni->GetPath());
    data.SetProjectURL(m_textCtrlWebSiteURL->GetValue());
    data.SetUseSystemBrowser(m_checkBoxSystemBrowser->IsChecked());

    // Code Completion settings
    data.SetCcIncludePath(m_textCtrlCCIncludePath->GetValue());

    // Save the file mapping
    JSONElement::wxStringMap_t mapping;
    int itemCount = m_dvListCtrlFileMapping->GetItemCount();
    for(int i = 0; i < itemCount; ++i) {
        wxVariant source, target;
        m_dvListCtrlFileMapping->GetValue(source, i, 0);
        m_dvListCtrlFileMapping->GetValue(target, i, 1);
        mapping.insert(std::make_pair(source.GetString(), target.GetString()));
    }
    data.SetFileMapping(mapping);

    wxString fileExts = m_pgPropFileTypes->GetValue().GetString();
    fileExts.Replace(",", ";");
    pProject->SetImportFileSpec(fileExts);

    wxString excludeDirs = m_pgPropExcludeFolders->GetValue().GetString();
    excludeDirs.Replace(",", ";");
    pProject->SetExcludeFolders(excludeDirs);

    // Save the project content
    pProject->Save();
    SetDirty(false);
}
コード例 #30
0
ファイル: IControl.cpp プロジェクト: b-vesco/wdl-ol
void ISwitchControl::OnMouseDown(int x, int y, IMouseMod* pMod)
{
  if (pMod->R) {
    PromptUserInput();
  }
  else
  if (mBitmap.N > 1) {
    mValue += 1.0 / (double) (mBitmap.N - 1);
	}
	else {
		mValue += 1.0;
	}
	if (mValue > 1.001) {
		mValue = 0.0;
	}
	SetDirty();
}