void PageItem_Table::resizeColumn(int column, double width, ResizeStrategy strategy) { ASSERT_VALID(); if (!validColumn(column)) return; if (strategy == MoveFollowing) resizeColumnMoveFollowing(column, width); else if (strategy == ResizeFollowing) resizeColumnResizeFollowing(column, width); else qWarning("Unknown resize strategy!"); // Update cells. TODO: Not for entire table. updateCells(); emit changed(); ASSERT_VALID(); }
void PageItem_Table::resizeRow(int row, double height, ResizeStrategy strategy) { ASSERT_VALID(); if (!validRow(row)) return; if (strategy == MoveFollowing) resizeRowMoveFollowing(row, height); else if (strategy == ResizeFollowing) resizeRowResizeFollowing(row, height); else qWarning("Unknown resize strategy!"); // Update cells. TODO: Not for entire table. updateCells(); emit changed(); ASSERT_VALID(); }
void PageItem_Table::resize(double width, double height) { ASSERT_VALID(); /* * Distribute width proportionally to columns, but don't let any column width below * MinimumColumnWidth. */ double requestedWidthFactor = width / tableWidth(); double oldMinWidth = *std::min_element(m_columnWidths.begin(), m_columnWidths.end()); double newMinWidth = qMax(oldMinWidth * requestedWidthFactor, MinimumColumnWidth); double actualWidthFactor = newMinWidth / oldMinWidth; for (int col = 0; col < columns(); ++col) { m_columnWidths[col] *= actualWidthFactor; m_columnPositions[col] *= actualWidthFactor; } /* * Distribute height proportionally to rows, but don't let any row height below * MinimumRowHeight. */ double requestedHeightFactor = height / tableHeight(); double oldMinHeight = *std::min_element(m_rowHeights.begin(), m_rowHeights.end()); double newMinHeight = qMax(oldMinHeight * requestedHeightFactor, MinimumRowHeight); double actualHeightFactor = newMinHeight / oldMinHeight; for (int row = 0; row < rows(); ++row) { m_rowHeights[row] *= actualHeightFactor; m_rowPositions[row] *= actualHeightFactor; } // Update cells. TODO: Not for entire table. updateCells(); emit changed(); ASSERT_VALID(); }
int ImportF::importFile(const char *fname) { char query[1024]; printf("\n\n\nImportF::importFile--------------------------------------------------------\n"); // copy the import file to a table execSQLCommand("TRUNCATE TABLE importtexttable;"); sprintf(query,"COPY importtexttable FROM '%s'",fname); execSQLCommand(query); // copy to the importtable execSQLCommand("TRUNCATE TABLE importtable;"); execSQLCommand("INSERT INTO importtable (sitelastmodified,sitemachineid,sitesitename,sitestatus,sitegroundheight,sitelocation,sitecontactslastmodified,sitecontactsmachineid,sitecontactsownername,sitecontactsnaturalperson,sitecontactscontactname,sitecontactspostaladdress,sitecontactstel,sitecontactsidnumber,sitecontactscontract,sitecontactscontractstartdate,sitecontactscontractenddate,sitecontactsmonthlyrental,sitecontactselectricitysupplier,sitecontactselectricityaccno,sitecontactselectricitypoleno,sitedescriptionlastmodified,sitedescriptionmachineid,sitedescriptionphysicaladdress,sitedescriptionstructuretype,sitedescriptionstructureheight,sitedescriptionstructurecapacity,sitedescriptionavailablecapacity,sitedescriptionpowersupply,sitedescriptionfencing,sitedescriptionaccess,sitedescriptioncontainertype,sitedescriptionsitedocumentation,radioinstallationlastmodified,radioinstallationmachineid,radioinstallationsector,radioinstallationpermanent,radioinstallationtechkey,radioinstallationeirp,radioinstallationdiversity,radioinstallationtxpower,radioinstallationtxlosses,radioinstallationtxantennaheight,radioinstallationtxantpatternkey,radioinstallationtxbearing,radioinstallationtxmechtilt,radioinstallationrxsensitivity,radioinstallationrxlosses,radioinstallationrxantennaheight,radioinstallationrxantpatternkey,radioinstallationrxbearing,radioinstallationrxmechtilt,radioinstallationbtlplot,radioinstallationflaga,radioinstallationflagb,radioinstallationflagc,celllastmodified,cellmachineid,cellmastercell,cellrisector,cellpermanent,cellcstraffic,cellpstraffic,celltxpower,cellbeacon,celllayerthreshold,txpatternfile,rxpatternfile,technologytechnologytype,frequencyallocationlistlastmodified,frequencyallocationlistmachineid,frequencyallocationlistci,frequencyallocationlistcarrier,frequencyallocationlistchannel) SELECT sitelastmodified,sitemachineid,sitesitename,sitestatus,sitegroundheight,GeomFromText(locationtext,4326),sitecontactslastmodified,sitecontactsmachineid,sitecontactsownername,sitecontactsnaturalperson,sitecontactscontactname,sitecontactspostaladdress,sitecontactstel,sitecontactsidnumber,sitecontactscontract,sitecontactscontractstartdate,sitecontactscontractenddate,sitecontactsmonthlyrental,sitecontactselectricitysupplier,sitecontactselectricityaccno,sitecontactselectricitypoleno,sitedescriptionlastmodified,sitedescriptionmachineid,sitedescriptionphysicaladdress,sitedescriptionstructuretype,sitedescriptionstructureheight,sitedescriptionstructurecapacity,sitedescriptionavailablecapacity,sitedescriptionpowersupply,sitedescriptionfencing,sitedescriptionaccess,sitedescriptioncontainertype,sitedescriptionsitedocumentation,radioinstallationlastmodified,radioinstallationmachineid,radioinstallationsector,radioinstallationpermanent,radioinstallationtechkey,radioinstallationeirp,radioinstallationdiversity,radioinstallationtxpower,radioinstallationtxlosses,radioinstallationtxantennaheight,radioinstallationtxantpatternkey,radioinstallationtxbearing,radioinstallationtxmechtilt,radioinstallationrxsensitivity,radioinstallationrxlosses,radioinstallationrxantennaheight,radioinstallationrxantpatternkey,radioinstallationrxbearing,radioinstallationrxmechtilt,radioinstallationbtlplot,radioinstallationflaga,radioinstallationflagb,radioinstallationflagc,celllastmodified,cellmachineid,cellmastercell,cellrisector,cellpermanent,cellcstraffic,cellpstraffic,celltxpower,cellbeacon,celllayerthreshold,txpatternfile,rxpatternfile,technologytechnologytype,frequencyallocationlistlastmodified,frequencyallocationlistmachineid,frequencyallocationlistci,frequencyallocationlistcarrier,frequencyallocationlistchannel FROM importtexttable;"); /* frequencyallocationlistlastmodified, frequencyallocationlistmachineid,frequencyallocationlistci,frequencyallocationlistcarrier,frequencyallocationlistchannel,locationtext */ #if 0 execSQLCommand("UPDATE importtable SET id = importtexttable.id"); // drop the import table execSQLCommand("DROP TABLE importtmptable"); // copy the table to the import table execSQLCommand("CREATE TABLE importtable AS SELECT * FROM importtexttable"); // add an extra postgis type column execSQLCommand("ALTER TABLE importtable ADD sitelocation geometry"); // convert the text column as a binary column execSQLCommand("UPDATE importtable SET sitelocation = GeomFromText(locationtext);"); // drop the location text column execSQLCommand("ALTER TABLE importtable DROP COLUMN locationtext;"); // load the table from file sprintf(query,"COPY importtable FROM '%s'",fname); execSQLCommand(query); printf("ImportF::importFile [%s]\n",query); #endif // drop the temporary table dropTmpTables(); // update the site table printf("\n\n\n\nupdateSiteTable();\n"); updateSiteTable(); // update all the ratio installations updateRadioInstallations(); // update all the cells updateCells(); // update the frequency allocation updateFrequencyAllocation(); // drop all the temporary tables // dropTmpTables(); return 1; }
void PageItem_Table::handleStyleChanged() { doc()->dontResize = true; updateCells(); doc()->dontResize = false; }
void PageItem_Table::unsetBottomBorder() { m_style.resetBottomBorder(); updateCells(rows() - 1, 0, rows() - 1, columns() - 1); emit changed(); }
void PageItem_Table::setBottomBorder(const TableBorder& border) { m_style.setBottomBorder(border); updateCells(rows() - 1, 0, rows() - 1, columns() - 1); emit changed(); }
void PageItem_Table::unsetTopBorder() { m_style.resetTopBorder(); updateCells(0, 0, 0, columns() - 1); emit changed(); }
void PageItem_Table::setTopBorder(const TableBorder& border) { m_style.setTopBorder(border); updateCells(0, 0, 0, columns() - 1); emit changed(); }
void PageItem_Table::unsetLeftBorder() { m_style.resetLeftBorder(); updateCells(0, 0, rows() - 1, 0); emit changed(); }
void PageItem_Table::setLeftBorder(const TableBorder& border) { m_style.setLeftBorder(border); updateCells(0, 0, rows() - 1, 0); emit changed(); }
template <typename PointT> bool PCLVisualizer::updatePointCloud (const typename pcl::PointCloud<PointT>::ConstPtr &cloud, const PointCloudColorHandler<PointT> &color_handler, const std::string &id) { // Check to see if this ID entry already exists (has it been already added to the visualizer?) CloudActorMap::iterator am_it = cloud_actor_map_->find (id); if (am_it == cloud_actor_map_->end ()) return (false); // Get the current poly data vtkSmartPointer<vtkPolyData> polydata = reinterpret_cast<vtkPolyDataMapper*>(am_it->second.actor->GetMapper ())->GetInput (); if (!polydata) return (false); vtkSmartPointer<vtkCellArray> vertices = polydata->GetVerts (); vtkSmartPointer<vtkPoints> points = polydata->GetPoints (); // Copy the new point array in vtkIdType nr_points = cloud->points.size (); points->SetNumberOfPoints (nr_points); // Get a pointer to the beginning of the data array float *data = ((vtkFloatArray*)points->GetData ())->GetPointer (0); // If the dataset is dense (no NaNs) if (cloud->is_dense) { for (vtkIdType i = 0; i < nr_points; ++i) memcpy (&data[i * 3], &cloud->points[i].x, 12); // sizeof (float) * 3 } else { vtkIdType j = 0; // true point index for (vtkIdType i = 0; i < nr_points; ++i) { // Check if the point is invalid if (!pcl_isfinite (cloud->points[i].x) || !pcl_isfinite (cloud->points[i].y) || !pcl_isfinite (cloud->points[i].z)) continue; memcpy (&data[j * 3], &cloud->points[i].x, 12); // sizeof (float) * 3 j++; } nr_points = j; points->SetNumberOfPoints (nr_points); } vtkSmartPointer<vtkIdTypeArray> cells = vertices->GetData (); updateCells (cells, am_it->second.cells, nr_points); // Set the cells and the vertices vertices->SetCells (nr_points, cells); // Get the colors from the handler vtkSmartPointer<vtkDataArray> scalars; color_handler.getColor (scalars); polydata->GetPointData ()->SetScalars (scalars); polydata->Update (); am_it->second.actor->GetMapper ()->ImmediateModeRenderingOff (); // Update the mapper reinterpret_cast<vtkPolyDataMapper*>(am_it->second.actor->GetMapper ())->SetInput (polydata); return (true); }
template <typename PointT> void PCLVisualizer::convertPointCloudToVTKPolyData ( const typename pcl::PointCloud<PointT>::ConstPtr &cloud, vtkSmartPointer<vtkPolyData> &polydata, vtkSmartPointer<vtkIdTypeArray> &initcells) { vtkSmartPointer<vtkCellArray> vertices; if (!polydata) { allocVtkPolyData (polydata); vertices = vtkSmartPointer<vtkCellArray>::New (); polydata->SetVerts (vertices); } // Create the supporting structures vertices = polydata->GetVerts (); if (!vertices) vertices = vtkSmartPointer<vtkCellArray>::New (); vtkIdType nr_points = cloud->points.size (); // Create the point set vtkSmartPointer<vtkPoints> points = polydata->GetPoints (); if (!points) { points = vtkSmartPointer<vtkPoints>::New (); points->SetDataTypeToFloat (); polydata->SetPoints (points); } points->SetNumberOfPoints (nr_points); // Get a pointer to the beginning of the data array float *data = ((vtkFloatArray*)points->GetData ())->GetPointer (0); // Set the points if (cloud->is_dense) { for (vtkIdType i = 0; i < nr_points; ++i) memcpy (&data[i * 3], &cloud->points[i].x, 12); // sizeof (float) * 3 } else { vtkIdType j = 0; // true point index for (vtkIdType i = 0; i < nr_points; ++i) { // Check if the point is invalid if (!pcl_isfinite (cloud->points[i].x) || !pcl_isfinite (cloud->points[i].y) || !pcl_isfinite (cloud->points[i].z)) continue; memcpy (&data[j * 3], &cloud->points[i].x, 12); // sizeof (float) * 3 j++; } nr_points = j; points->SetNumberOfPoints (nr_points); } vtkSmartPointer<vtkIdTypeArray> cells = vertices->GetData (); updateCells (cells, initcells, nr_points); // Set the cells and the vertices vertices->SetCells (nr_points, cells); }
static int brl_writeStatus (BrailleDisplay *brl, const unsigned char *s) { updateCells(statusCells, s, sizeof(statusCells)); return 1; }
void CCalendarWidget::do_update() { updateCells(); }