枚举类型的引用方式

namespace osg { class OSG_EXPORT LOD : public Group { enum RangeMode { DISTANCE_FROM_EYE_POINT, PIXEL_SIZE_ON_SCREEN }; }; } 引用方式为:osg::LOD::DISTANCE_FROM_EYE_POINT,不需要RangeMode
分类: 其他 发布时间: 01-01 23:28 阅读次数: 0

osgEarth::Terrain的notifyTilesRemoved

notifyTilesRemoved只有声明没有实现,在编译时并没有报错 类似的还有fireTilesRemoved C++的类允许这么干
分类: 其他 发布时间: 01-01 23:28 阅读次数: 0

osgEarth中opengl版本的确定

osgEarth/VirtualProgram #if defined(OSG_GLES2_AVAILABLE) # define GLSL_VERSION 100 # define GLSL_VERSION_STR "100" # define GLSL_DEFAULT_PRECISION_FLOAT "precision highp float;" #elif defined(OSG_GLES3_AVAILABLE)
分类: 其他 发布时间: 01-01 23:27 阅读次数: 0

GLSL 数据精度

1. 默认精度 顶点着色器中默认精度 precision highp float; precision highp int; precision lowp sampler2D; precision lowp samplerCube; 像素着色器中默认精度 precision mediump int; precision lowp sampler2D; precision lowp samplerCube; float 没有默认精度 2. 着色器中各种类型的最低范围、精度 3. 建议 一般来说:
分类: 其他 发布时间: 01-01 23:27 阅读次数: 0

opengl着色器shader介绍

1. Shader Shader其实就是一段执行在GPU上的程序,此程序使用OpenGL ES SL语言来编写。它是一个描述顶点或像素特性的简单程序。在opengles中常用的shader有两种:vertex shader和fragment shader。Geometry Shader(几何着色器)是继Vertex Shader和Fragment Shader之后,由Shader Model 4引入的新的着色器。还有一个compute Shader由Shader Model 5引入的提供通用计
分类: 其他 发布时间: 01-01 23:27 阅读次数: 0

std::Map使用的一个技巧

注意一下代码的Entry& e = _table[key];,如果key不在map中,那么该代码应该会自动分配一个key和其数据空间 osgEarthDrivers/engine_rex/TileNodeRegistry struct RandomAccessTileMap { struct Entry { osg::ref_ptr<TileNode> tile; unsigned index;
分类: 其他 发布时间: 01-01 23:27 阅读次数: 0

std::map和std::vector

通过map可以快速的通过key查找元素,通过vector可以快速的查看元素的个数和查找第i个元素。map和vector都可以实现快速的元素插入 它们组合起来可以实现随机访问表,如: osgEarthDrivers/engine_rex/TileNodeRegistry struct RandomAccessTileMap { struct Entry { osg::ref_ptr<TileNode> tile;
分类: 其他 发布时间: 01-01 23:26 阅读次数: 0

std的list, vector, map, set 区别与用法比较

List封装了链表,Vector封装了数组, list和vector得最主要的区别在于vector使用连续内存存储的,他支持[]运算符,而list是以链表形式实现的,不支持[]。 Vector对于随机访问的速度很快,但是对于插入尤其是在头部插入元素速度很慢,在尾部插入速度很快。List对于随机访问速度慢得多,因为可能要遍历整个链表才能做到,但是对于插入就快的多了,不需要拷贝和移动数据,只需要改变指针的指向就可以了。另外对于新添加的元素,Vector有一套算法,而List可以任意加入。 Map,
分类: 其他 发布时间: 01-01 23:26 阅读次数: 0

osgEarth的Rex引擎原理分析(三十三)分页瓦片卸载器子节点的作用

目标:(十二)中的问题22 分页瓦片卸载器是在Rex引擎的setMap函数中创建的,创建之初就关联了活跃瓦片寄存器和资源释放器。作用见下面分析。 osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp void RexTerrainEngineNode::setMap(const Map* map, const TerrainOptions& options) { // Make a tile unloader _unloa
分类: 其他 发布时间: 01-01 23:26 阅读次数: 0

oracle----修改表结构

增加表字段: alter table 表名 add(age number(3)); alter table 表名 add(sex varchar2(10) default '男'); alter table 表名 add(photo varchar2(100) default 'nophoto.jpg'); 修改表字段: alter table 表名 modify(name varchar2(30)); alter table 表名 modify(sex varchar2(10) defaul
分类: 其他 发布时间: 01-01 23:25 阅读次数: 0

oracle-------约束

非空约束:不能为空,设置为: not null 唯一约束:列不能有重复的内容: CONSTRAINT uk_列名 UNIQUE (列名) 主键约束:既不能重复,也不能为空: CONSTRAINT pk_列名 PRIMARY KEY (列名) 当设置了复合主键之后,只有两个字段的内容都相同的时候才表示重复,才表示违反了约束。 主键约束=非空约束+唯一约束。 主外键约束: CONSTRAINT fk_列名 FOREIGN KEY(列名) REFERENCES 父表(列名) 删除表操作问题: 1,如
分类: 其他 发布时间: 01-01 23:25 阅读次数: 0

oracle------视图

创建语句: create view v_myemp as select * from emp e where e.sal > 2000; 查询语句: select * from user_views; 修改,同时将列名称列出来: create or replace view v_myemp (部门编号,部门名称,位置,部门人数,平均工资,总工资,最高工资,最低工资) as select d.deptno,d.dname,d.loc,count(e.empno) count, nvl(round
分类: 其他 发布时间: 01-01 23:25 阅读次数: 0

oracle-----序列

创建序列: create sequence mysql; 查询序列: select * from user_sequences; 插入序列: insert into member(mid,name)values(mysql.nextval,'A'); 删除序列: drop sequence mysql; 序列步长默认增长是1,设置为步长为3: create sequence mysql increment by 3; 设置步长为3,以30开始: create sequence mysql in
分类: 其他 发布时间: 01-01 23:25 阅读次数: 0

oracle------分页操作

显示前五行的数据: select * from ( select rownum rn,e.empno,e.ename,e.job,e.hiredate,e.sal from emp e where rownum <= 5) e1 where e1.rn > 0; 显示6-10行的数据: select * from ( select rownum rn,e.empno,e.ename,e.job,e.hiredate,e.sal from emp e where rownum <= 10) e1
分类: 其他 发布时间: 01-01 23:24 阅读次数: 0

超市购物,链表

interface ILink<E>{ public void add(E e); public int size(); public boolean isEmpty(); public Object [] toArray(); public E get(int index); public void set(int index,E data); public boolean contains(E data); public void remove(E data); public void c
分类: 其他 发布时间: 01-01 23:24 阅读次数: 0

停车场收费简单模拟

interface ILink<E>{ public void add(E e); public int size(); public boolean isEmpty(); public Object [] toArray(); public E get(int index); public void set(int index,E data); public boolean contains(E data); public void remove(E data); public void c
分类: 其他 发布时间: 01-01 23:23 阅读次数: 0

生产者和消费者多线程模拟

package yn.ngems.cn; class Message{ private String title; private String content; private boolean flag = true;//true,生产,不消费;false,消费,不生产 public synchronized void set(String title,String content) { if(this.flag == false) { try { super.wait(); } catch
分类: 其他 发布时间: 01-01 23:23 阅读次数: 0

四个线程,两个加减法线程对数据加减的调度模拟

public class ThreadDemo { public static void main(String[] args) throws InterruptedException { Resource res = new Resource(); PlusThread pt = new PlusThread(res); MinusThread mt = new MinusThread(res); new Thread(pt,"加法A").start(); new Thread(pt,"加法
分类: 其他 发布时间: 01-01 23:23 阅读次数: 0

生产电脑,取走电脑多线程

public class ThreadDemo{ public static void main(String[] args) { Resource res = new Resource(); new Thread(new Productor(res)).start(); new Thread(new Consumer(res)).start(); } } class Computer{ private static int count = 0; private String name; pr
分类: 其他 发布时间: 01-01 23:23 阅读次数: 0

多线程问题抢答模拟

package yn.ngems.cn; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; public class ThreadDemo{ public static void main(String[] args) throws Exception{ MyThread thread = new MyThread(); FutureTask<String> ftA = new Futur
分类: 其他 发布时间: 01-01 23:22 阅读次数: 0